CUDA Driver API. API Reference Manual (January 2024) - page 10

 

  Index      Manuals     CUDA Driver API. API Reference Manual (January 2024)

 

Search            copyright infringement  

 

   

 

   

 

Content      ..     8      9      10      11     ..

 

 

 

CUDA Driver API. API Reference Manual (January 2024) - page 10

 

 

Modules
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_OUT_OF_MEMORY,
CUDA_ERROR_UNKNOWN
Description
Deprecated This function is deprecated as of CUDA 5.0.
This function is deprecated and should no longer be used. It is no longer necessary to associate a
CUDA context with a D3D10 device in order to achieve maximum interoperability performance.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuD3D10GetDevice, cuGraphicsD3D10RegisterResource
CUresult cuD3D10CtxCreateOnDevice (CUcontext *pCtx,
unsigned int flags, ID3D10Device *pD3DDevice, CUdevice
cudaDevice)
Create a CUDA context for interoperability with Direct3D 10.
Parameters
pCtx
- Returned newly created CUDA context
flags
- Context creation flags (see cuCtxCreate() for details)
pD3DDevice
- Direct3D device to create interoperability context with
cudaDevice
- The CUDA device on which to create the context. This device must be among the devices returned
when querying CU_D3D10_DEVICES_ALL from cuD3D10GetDevices.
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_OUT_OF_MEMORY,
CUDA_ERROR_UNKNOWN
|
637
Modules
Description
Deprecated This function is deprecated as of CUDA 5.0.
This function is deprecated and should no longer be used. It is no longer necessary to associate a
CUDA context with a D3D10 device in order to achieve maximum interoperability performance.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuD3D10GetDevices, cuGraphicsD3D10RegisterResource
CUresult cuD3D10GetDirect3DDevice (ID3D10Device
**ppD3DDevice)
Get the Direct3D 10 device against which the current CUDA context was created.
Parameters
ppD3DDevice
- Returned Direct3D device corresponding to CUDA context
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT
Description
Deprecated This function is deprecated as of CUDA 5.0.
This function is deprecated and should no longer be used. It is no longer necessary to associate a
CUDA context with a D3D10 device in order to achieve maximum interoperability performance.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuD3D10GetDevice
|
638
Modules
CUresult cuD3D10MapResources (unsigned int count,
ID3D10Resource **ppResources)
Map Direct3D resources for access by CUDA.
Parameters
count
- Number of resources to map for CUDA
ppResources
- Resources to map for CUDA
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_HANDLE,
CUDA_ERROR_ALREADY_MAPPED, CUDA_ERROR_UNKNOWN
Description
Deprecated This function is deprecated as of CUDA 3.0.
Maps the count Direct3D resources in ppResources for access by CUDA.
The resources in ppResources may be accessed in CUDA kernels until they are unmapped.
Direct3D should not access any resources while they are mapped by CUDA. If an application does so,
the results are undefined.
This function provides the synchronization guarantee that any Direct3D calls issued
before cuD3D10MapResources() will complete before any CUDA kernels issued after
cuD3D10MapResources() begin.
If any of ppResources have not been registered for use with CUDA or if ppResources
contains any duplicate entries, then CUDA_ERROR_INVALID_HANDLE is
returned. If any of ppResources are presently mapped for access by CUDA, then
CUDA_ERROR_ALREADY_MAPPED is returned.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsMapResources
|
639
Modules
CUresult cuD3D10RegisterResource (ID3D10Resource
*pResource, unsigned int Flags)
Register a Direct3D resource for access by CUDA.
Parameters
pResource
- Resource to register
Flags
- Parameters for resource registration
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_OUT_OF_MEMORY,
CUDA_ERROR_UNKNOWN
Description
Deprecated This function is deprecated as of CUDA 3.0.
Registers the Direct3D resource pResource for access by CUDA.
If this call is successful, then the application will be able to map and unmap this resource until it
is unregistered through cuD3D10UnregisterResource(). Also on success, this call will increase the
internal reference count on pResource. This reference count will be decremented when this resource
is unregistered through cuD3D10UnregisterResource().
This call is potentially high-overhead and should not be called every frame in interactive applications.
The type of pResource must be one of the following.
ID3D10Buffer: Cannot be used with Flags set to CU_D3D10_REGISTER_FLAGS_ARRAY.
ID3D10Texture1D: No restrictions.
ID3D10Texture2D: No restrictions.
ID3D10Texture3D: No restrictions.
The Flags argument specifies the mechanism through which CUDA will access the Direct3D
resource. The following values are allowed.
CU_D3D10_REGISTER_FLAGS_NONE: Specifies that CUDA will access this resource
through a CUdeviceptr. The pointer, size, and (for textures), pitch for each subresource
of this allocation may be queried through cuD3D10ResourceGetMappedPointer(),
cuD3D10ResourceGetMappedSize(), and cuD3D10ResourceGetMappedPitch() respectively. This
option is valid for all resource types.
CU_D3D10_REGISTER_FLAGS_ARRAY: Specifies that CUDA will access this resource
through a CUarray queried on a sub-resource basis through cuD3D10ResourceGetMappedArray().
|
640
Modules
This option is only valid for resources of type ID3D10Texture1D, ID3D10Texture2D, and
ID3D10Texture3D.
Not all Direct3D resources of the above types may be used for interoperability with CUDA. The
following are some limitations.
The primary rendertarget may not be registered with CUDA.
Resources allocated as shared may not be registered with CUDA.
Textures which are not of a format which is 1, 2, or 4 channels of 8, 16, or 32-bit integer or
floating-point data cannot be shared.
Surfaces of depth or stencil formats cannot be shared.
If Direct3D interoperability is not initialized on this context then
CUDA_ERROR_INVALID_CONTEXT is returned. If pResource is of incorrect type or is already
registered, then CUDA_ERROR_INVALID_HANDLE is returned. If pResource cannot be
registered, then CUDA_ERROR_UNKNOWN is returned.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsD3D10RegisterResource
CUresult cuD3D10ResourceGetMappedArray (CUarray *pArray,
ID3D10Resource *pResource, unsigned int SubResource)
Get an array through which to access a subresource of a Direct3D resource which has been mapped for
access by CUDA.
Parameters
pArray
- Returned array corresponding to subresource
pResource
- Mapped resource to access
SubResource
- Subresource of pResource to access
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_NOT_MAPPED
|
641
Modules
Description
Deprecated This function is deprecated as of CUDA 3.0.
Returns in *pArray an array through which the subresource of the mapped Direct3D resource
pResource, which corresponds to SubResource may be accessed. The value set in pArray may
change every time that pResource is mapped.
If pResource is not registered, then CUDA_ERROR_INVALID_HANDLE is returned. If
pResource was not registered with usage flags CU_D3D10_REGISTER_FLAGS_ARRAY,
then CUDA_ERROR_INVALID_HANDLE is returned. If pResource is not mapped, then
CUDA_ERROR_NOT_MAPPED is returned.
For usage requirements of the SubResource parameter, see cuD3D10ResourceGetMappedPointer().
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsSubResourceGetMappedArray
CUresult cuD3D10ResourceGetMappedPitch (size_t *pPitch,
size_t *pPitchSlice, ID3D10Resource *pResource, unsigned int
SubResource)
Get the pitch of a subresource of a Direct3D resource which has been mapped for access by CUDA.
Parameters
pPitch
- Returned pitch of subresource
pPitchSlice
- Returned Z-slice pitch of subresource
pResource
- Mapped resource to access
SubResource
- Subresource of pResource to access
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_NOT_MAPPED
|
642
Modules
Description
Deprecated This function is deprecated as of CUDA 3.0.
Returns in *pPitch and *pPitchSlice the pitch and Z-slice pitch of the subresource of the
mapped Direct3D resource pResource, which corresponds to SubResource. The values set in
pPitch and pPitchSlice may change every time that pResource is mapped.
The pitch and Z-slice pitch values may be used to compute the location of a sample on a surface as
follows.
For a 2D surface, the byte offset of the sample at position x, y from the base pointer of the surface is:
y * pitch + (bytes per pixel) * x
For a 3D surface, the byte offset of the sample at position x, y, z from the base pointer of the surface is:
z* slicePitch + y * pitch + (bytes per pixel) * x
Both parameters pPitch and pPitchSlice are optional and may be set to NULL.
If pResource is not of type IDirect3DBaseTexture10 or one of its sub-types or if pResource has
not been registered for use with CUDA, then CUDA_ERROR_INVALID_HANDLE is returned. If
pResource was not registered with usage flags CU_D3D10_REGISTER_FLAGS_NONE, then
CUDA_ERROR_INVALID_HANDLE is returned. If pResource is not mapped for access by
CUDA, then CUDA_ERROR_NOT_MAPPED is returned.
For usage requirements of the SubResource parameter, see cuD3D10ResourceGetMappedPointer().
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsSubResourceGetMappedArray
CUresult cuD3D10ResourceGetMappedPointer (CUdeviceptr
*pDevPtr, ID3D10Resource *pResource, unsigned int
SubResource)
Get a pointer through which to access a subresource of a Direct3D resource which has been mapped for
access by CUDA.
Parameters
pDevPtr
- Returned pointer corresponding to subresource
|
643
Modules
pResource
- Mapped resource to access
SubResource
- Subresource of pResource to access
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_NOT_MAPPED
Description
Deprecated This function is deprecated as of CUDA 3.0.
Returns in *pDevPtr the base pointer of the subresource of the mapped Direct3D resource
pResource, which corresponds to SubResource. The value set in pDevPtr may change every
time that pResource is mapped.
If pResource is not registered, then CUDA_ERROR_INVALID_HANDLE is returned. If
pResource was not registered with usage flags CU_D3D10_REGISTER_FLAGS_NONE,
then CUDA_ERROR_INVALID_HANDLE is returned. If pResource is not mapped, then
CUDA_ERROR_NOT_MAPPED is returned.
If pResource is of type ID3D10Buffer, then SubResource must be 0. If pResource is of
any other type, then the value of SubResource must come from the subresource calculation in
D3D10CalcSubResource().
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsResourceGetMappedPointer
CUresult cuD3D10ResourceGetMappedSize (size_t *pSize,
ID3D10Resource *pResource, unsigned int SubResource)
Get the size of a subresource of a Direct3D resource which has been mapped for access by CUDA.
Parameters
pSize
- Returned size of subresource
pResource
- Mapped resource to access
|
644
Modules
SubResource
- Subresource of pResource to access
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_NOT_MAPPED
Description
Deprecated This function is deprecated as of CUDA 3.0.
Returns in *pSize the size of the subresource of the mapped Direct3D resource pResource, which
corresponds to SubResource. The value set in pSize may change every time that pResource is
mapped.
If pResource has not been registered for use with CUDA, then
CUDA_ERROR_INVALID_HANDLE is returned. If pResource was not registered with usage flags
CU_D3D10_REGISTER_FLAGS_NONE, then CUDA_ERROR_INVALID_HANDLE is returned. If
pResource is not mapped for access by CUDA, then CUDA_ERROR_NOT_MAPPED is returned.
For usage requirements of the SubResource parameter, see cuD3D10ResourceGetMappedPointer().
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsResourceGetMappedPointer
CUresult cuD3D10ResourceGetSurfaceDimensions (size_t
*pWidth, size_t *pHeight, size_t *pDepth, ID3D10Resource
*pResource, unsigned int SubResource)
Get the dimensions of a registered surface.
Parameters
pWidth
- Returned width of surface
pHeight
- Returned height of surface
pDepth
- Returned depth of surface
|
645
Modules
pResource
- Registered resource to access
SubResource
- Subresource of pResource to access
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE
Description
Deprecated This function is deprecated as of CUDA 3.0.
Returns in *pWidth, *pHeight, and *pDepth the dimensions of the subresource of the mapped
Direct3D resource pResource, which corresponds to SubResource.
Because anti-aliased surfaces may have multiple samples per pixel, it is possible that the dimensions of
a resource will be an integer factor larger than the dimensions reported by the Direct3D runtime.
The parameters pWidth, pHeight, and pDepth are optional. For 2D surfaces, the value returned in
*pDepth will be 0.
If pResource is not of type IDirect3DBaseTexture10 or IDirect3DSurface10 or if pResource has
not been registered for use with CUDA, then CUDA_ERROR_INVALID_HANDLE is returned.
For usage requirements of the SubResource parameter, see cuD3D10ResourceGetMappedPointer().
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsSubResourceGetMappedArray
CUresult cuD3D10ResourceSetMapFlags (ID3D10Resource
*pResource, unsigned int Flags)
Set usage flags for mapping a Direct3D resource.
Parameters
pResource
- Registered resource to set flags for
Flags
- Parameters for resource mapping
|
646
Modules
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_ALREADY_MAPPED
Description
Deprecated This function is deprecated as of CUDA 3.0.
Set flags for mapping the Direct3D resource pResource.
Changes to flags will take effect the next time pResource is mapped. The Flags argument may be
any of the following.
CU_D3D10_MAPRESOURCE_FLAGS_NONE: Specifies no hints about how this resource
will be used. It is therefore assumed that this resource will be read from and written to by CUDA
kernels. This is the default value.
CU_D3D10_MAPRESOURCE_FLAGS_READONLY: Specifies that CUDA kernels which
access this resource will not write to this resource.
CU_D3D10_MAPRESOURCE_FLAGS_WRITEDISCARD: Specifies that CUDA kernels which
access this resource will not read from this resource and will write over the entire contents of the
resource, so none of the data previously stored in the resource will be preserved.
If pResource has not been registered for use with CUDA, then
CUDA_ERROR_INVALID_HANDLE is returned. If pResource is presently mapped for access by
CUDA then CUDA_ERROR_ALREADY_MAPPED is returned.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsResourceSetMapFlags
CUresult cuD3D10UnmapResources (unsigned int count,
ID3D10Resource **ppResources)
Unmap Direct3D resources.
Parameters
count
- Number of resources to unmap for CUDA
ppResources
- Resources to unmap for CUDA
|
647
Modules
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_NOT_MAPPED,
CUDA_ERROR_UNKNOWN
Description
Deprecated This function is deprecated as of CUDA 3.0.
Unmaps the count Direct3D resources in ppResources.
This function provides the synchronization guarantee that any CUDA kernels issued
before cuD3D10UnmapResources() will complete before any Direct3D calls issued after
cuD3D10UnmapResources() begin.
If any of ppResources have not been registered for use with CUDA or if ppResources
contains any duplicate entries, then CUDA_ERROR_INVALID_HANDLE is returned.
If any of ppResources are not presently mapped for access by CUDA, then
CUDA_ERROR_NOT_MAPPED is returned.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsUnmapResources
CUresult cuD3D10UnregisterResource (ID3D10Resource
*pResource)
Unregister a Direct3D resource.
Parameters
pResource
- Resources to unregister
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_HANDLE,
CUDA_ERROR_UNKNOWN
|
648
Modules
Description
Deprecated This function is deprecated as of CUDA 3.0.
Unregisters the Direct3D resource pResource so it is not accessible by CUDA unless registered
again.
If pResource is not registered, then CUDA_ERROR_INVALID_HANDLE is returned.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsUnregisterResource
6.43. Direct3D 11 Interoperability
This section describes the Direct3D 11 interoperability functions of the low-level CUDA driver
application programming interface. Note that mapping of Direct3D 11 resources is performed with the
graphics API agnostic, resource mapping interface described in Graphics Interoperability.
Direct3D 11 Interoperability [DEPRECATED]
enum CUd3d11DeviceList
CUDA devices corresponding to a D3D11 device
Values
CU_D3D11_DEVICE_LIST_ALL = 0x01
The CUDA devices for all GPUs used by a D3D11 device
CU_D3D11_DEVICE_LIST_CURRENT_FRAME = 0x02
The CUDA devices for the GPUs used by a D3D11 device in its currently rendering frame
CU_D3D11_DEVICE_LIST_NEXT_FRAME = 0x03
The CUDA devices for the GPUs to be used by a D3D11 device in the next frame
|
649
Modules
CUresult cuD3D11GetDevice (CUdevice *pCudaDevice,
IDXGIAdapter *pAdapter)
Gets the CUDA device corresponding to a display adapter.
Parameters
pCudaDevice
- Returned CUDA device corresponding to pAdapter
pAdapter
- Adapter to query for CUDA device
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_NO_DEVICE, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_NOT_FOUND, CUDA_ERROR_UNKNOWN
Description
Returns in *pCudaDevice the CUDA-compatible device corresponding to the adapter pAdapter
obtained from IDXGIFactory::EnumAdapters.
If no device on pAdapter is CUDA-compatible the call will return CUDA_ERROR_NO_DEVICE.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuD3D11GetDevices, cudaD3D11GetDevice
CUresult cuD3D11GetDevices (unsigned int
*pCudaDeviceCount, CUdevice *pCudaDevices, unsigned
int cudaDeviceCount, ID3D11Device *pD3D11Device,
CUd3d11DeviceList deviceList)
Gets the CUDA devices corresponding to a Direct3D 11 device.
Parameters
pCudaDeviceCount
- Returned number of CUDA devices corresponding to pD3D11Device
|
650
Modules
pCudaDevices
- Returned CUDA devices corresponding to pD3D11Device
cudaDeviceCount
- The size of the output device array pCudaDevices
pD3D11Device
- Direct3D 11 device to query for CUDA devices
deviceList
- The set of devices to return. This set may be CU_D3D11_DEVICE_LIST_ALL for all devices,
CU_D3D11_DEVICE_LIST_CURRENT_FRAME for the devices used to render the current frame
(in SLI), or CU_D3D11_DEVICE_LIST_NEXT_FRAME for the devices used to render the next
frame (in SLI).
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_NO_DEVICE, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_NOT_FOUND, CUDA_ERROR_UNKNOWN
Description
Returns in *pCudaDeviceCount the number of CUDA-compatible device corresponding
to the Direct3D 11 device pD3D11Device. Also returns in *pCudaDevices at most
cudaDeviceCount of the CUDA-compatible devices corresponding to the Direct3D 11 device
pD3D11Device.
If any of the GPUs being used to render pDevice are not CUDA capable then the call will return
CUDA_ERROR_NO_DEVICE.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuD3D11GetDevice, cudaD3D11GetDevices
|
651
Modules
CUresult cuGraphicsD3D11RegisterResource
(CUgraphicsResource *pCudaResource, ID3D11Resource
*pD3DResource, unsigned int Flags)
Register a Direct3D 11 resource for access by CUDA.
Parameters
pCudaResource
- Returned graphics resource handle
pD3DResource
- Direct3D resource to register
Flags
- Parameters for resource registration
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_OUT_OF_MEMORY,
CUDA_ERROR_UNKNOWN
Description
Registers the Direct3D 11 resource pD3DResource for access by CUDA and returns a CUDA handle
to pD3Dresource in pCudaResource. The handle returned in pCudaResource may be used
to map and unmap this resource until it is unregistered. On success this call will increase the internal
reference count on pD3DResource. This reference count will be decremented when this resource is
unregistered through cuGraphicsUnregisterResource().
This call is potentially high-overhead and should not be called every frame in interactive applications.
The type of pD3DResource must be one of the following.
ID3D11Buffer: may be accessed through a device pointer.
ID3D11Texture1D: individual subresources of the texture may be accessed via arrays
ID3D11Texture2D: individual subresources of the texture may be accessed via arrays
ID3D11Texture3D: individual subresources of the texture may be accessed via arrays
The Flags argument may be used to specify additional parameters at register time. The valid values
for this parameter are
CU_GRAPHICS_REGISTER_FLAGS_NONE: Specifies no hints about how this resource will be
used.
CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST: Specifies that CUDA will bind this
resource to a surface reference.
|
652
Modules
CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER: Specifies that CUDA will perform
texture gather operations on this resource.
Not all Direct3D resources of the above types may be used for interoperability with CUDA. The
following are some limitations.
The primary rendertarget may not be registered with CUDA.
Textures which are not of a format which is 1, 2, or 4 channels of 8, 16, or 32-bit integer or
floating-point data cannot be shared.
Surfaces of depth or stencil formats cannot be shared.
A complete list of supported DXGI formats is as follows. For compactness the notation A_{B,C,D}
represents A_B, A_C, and A_D.
DXGI_FORMAT_A8_UNORM
DXGI_FORMAT_B8G8R8A8_UNORM
DXGI_FORMAT_B8G8R8X8_UNORM
DXGI_FORMAT_R16_FLOAT
DXGI_FORMAT_R16G16B16A16_{FLOAT,SINT,SNORM,UINT,UNORM}
DXGI_FORMAT_R16G16_{FLOAT,SINT,SNORM,UINT,UNORM}
DXGI_FORMAT_R16_{SINT,SNORM,UINT,UNORM}
DXGI_FORMAT_R32_FLOAT
DXGI_FORMAT_R32G32B32A32_{FLOAT,SINT,UINT}
DXGI_FORMAT_R32G32_{FLOAT,SINT,UINT}
DXGI_FORMAT_R32_{SINT,UINT}
DXGI_FORMAT_R8G8B8A8_{SINT,SNORM,UINT,UNORM,UNORM_SRGB}
DXGI_FORMAT_R8G8_{SINT,SNORM,UINT,UNORM}
DXGI_FORMAT_R8_{SINT,SNORM,UINT,UNORM}
If pD3DResource is of incorrect type or is already registered then
CUDA_ERROR_INVALID_HANDLE is returned. If pD3DResource cannot be registered then
CUDA_ERROR_UNKNOWN is returned. If Flags is not one of the above specified value then
CUDA_ERROR_INVALID_VALUE is returned.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuGraphicsUnregisterResource, cuGraphicsMapResources, cuGraphicsSubResourceGetMappedArray,
cuGraphicsResourceGetMappedPointer, cudaGraphicsD3D11RegisterResource
|
653
Modules
6.43.1. Direct3D 11 Interoperability [DEPRECATED]
Direct3D 11 Interoperability
This section describes deprecated Direct3D 11 interoperability functionality.
CUresult cuD3D11CtxCreate (CUcontext *pCtx, CUdevice
*pCudaDevice, unsigned int Flags, ID3D11Device *pD3DDevice)
Create a CUDA context for interoperability with Direct3D 11.
Parameters
pCtx
- Returned newly created CUDA context
pCudaDevice
- Returned pointer to the device on which the context was created
Flags
- Context creation flags (see cuCtxCreate() for details)
pD3DDevice
- Direct3D device to create interoperability context with
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_OUT_OF_MEMORY,
CUDA_ERROR_UNKNOWN
Description
Deprecated This function is deprecated as of CUDA 5.0.
This function is deprecated and should no longer be used. It is no longer necessary to associate a
CUDA context with a D3D11 device in order to achieve maximum interoperability performance.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuD3D11GetDevice, cuGraphicsD3D11RegisterResource
|
654
Modules
CUresult cuD3D11CtxCreateOnDevice (CUcontext *pCtx,
unsigned int flags, ID3D11Device *pD3DDevice, CUdevice
cudaDevice)
Create a CUDA context for interoperability with Direct3D 11.
Parameters
pCtx
- Returned newly created CUDA context
flags
- Context creation flags (see cuCtxCreate() for details)
pD3DDevice
- Direct3D device to create interoperability context with
cudaDevice
- The CUDA device on which to create the context. This device must be among the devices returned
when querying CU_D3D11_DEVICES_ALL from cuD3D11GetDevices.
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_OUT_OF_MEMORY,
CUDA_ERROR_UNKNOWN
Description
Deprecated This function is deprecated as of CUDA 5.0.
This function is deprecated and should no longer be used. It is no longer necessary to associate a
CUDA context with a D3D11 device in order to achieve maximum interoperability performance.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuD3D11GetDevices, cuGraphicsD3D11RegisterResource
|
655
Modules
CUresult cuD3D11GetDirect3DDevice (ID3D11Device
**ppD3DDevice)
Get the Direct3D 11 device against which the current CUDA context was created.
Parameters
ppD3DDevice
- Returned Direct3D device corresponding to CUDA context
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT
Description
Deprecated This function is deprecated as of CUDA 5.0.
This function is deprecated and should no longer be used. It is no longer necessary to associate a
CUDA context with a D3D11 device in order to achieve maximum interoperability performance.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuD3D11GetDevice
6.44. VDPAU Interoperability
This section describes the VDPAU interoperability functions of the low-level CUDA driver application
programming interface.
CUresult cuGraphicsVDPAURegisterOutputSurface
(CUgraphicsResource *pCudaResource, VdpOutputSurface
vdpSurface, unsigned int flags)
Registers a VDPAU VdpOutputSurface object.
Parameters
pCudaResource
- Pointer to the returned object handle
|
656
Modules
vdpSurface
- The VdpOutputSurface to be registered
flags
- Map flags
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_ALREADY_MAPPED,
CUDA_ERROR_INVALID_CONTEXT,
Description
Registers the VdpOutputSurface specified by vdpSurface for access by CUDA. A handle to the
registered object is returned as pCudaResource. The surface's intended usage is specified using
flags, as follows:
CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this resource
will be used. It is therefore assumed that this resource will be read from and written to by CUDA.
This is the default value.
CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA will not
write to this resource.
CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that CUDA will not
read from this resource and will write over the entire contents of the resource, so none of the data
previously stored in the resource will be preserved.
The VdpOutputSurface is presented as an array of subresources that may be accessed using pointers
returned by cuGraphicsSubResourceGetMappedArray. The exact number of valid arrayIndex
values depends on the VDPAU surface format. The mapping is shown in the table below. mipLevel
must be 0.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuCtxCreate, cuVDPAUCtxCreate, cuGraphicsVDPAURegisterVideoSurface,
cuGraphicsUnregisterResource, cuGraphicsResourceSetMapFlags, cuGraphicsMapResources,
cuGraphicsUnmapResources, cuGraphicsSubResourceGetMappedArray, cuVDPAUGetDevice,
cudaGraphicsVDPAURegisterOutputSurface
|
657
Modules
CUresult cuGraphicsVDPAURegisterVideoSurface
(CUgraphicsResource *pCudaResource, VdpVideoSurface
vdpSurface, unsigned int flags)
Registers a VDPAU VdpVideoSurface object.
Parameters
pCudaResource
- Pointer to the returned object handle
vdpSurface
- The VdpVideoSurface to be registered
flags
- Map flags
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_ALREADY_MAPPED,
CUDA_ERROR_INVALID_CONTEXT,
Description
Registers the VdpVideoSurface specified by vdpSurface for access by CUDA. A handle to the
registered object is returned as pCudaResource. The surface's intended usage is specified using
flags, as follows:
CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this resource
will be used. It is therefore assumed that this resource will be read from and written to by CUDA.
This is the default value.
CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA will not
write to this resource.
CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that CUDA will not
read from this resource and will write over the entire contents of the resource, so none of the data
previously stored in the resource will be preserved.
The VdpVideoSurface is presented as an array of subresources that may be accessed using pointers
returned by cuGraphicsSubResourceGetMappedArray. The exact number of valid arrayIndex
values depends on the VDPAU surface format. The mapping is shown in the table below. mipLevel
must be 0.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
|
658
Modules
See also:
cuCtxCreate, cuVDPAUCtxCreate, cuGraphicsVDPAURegisterOutputSurface,
cuGraphicsUnregisterResource, cuGraphicsResourceSetMapFlags, cuGraphicsMapResources,
cuGraphicsUnmapResources, cuGraphicsSubResourceGetMappedArray, cuVDPAUGetDevice,
cudaGraphicsVDPAURegisterVideoSurface
CUresult cuVDPAUCtxCreate (CUcontext *pCtx, unsigned
int flags, CUdevice device, VdpDevice vdpDevice,
VdpGetProcAddress *vdpGetProcAddress)
Create a CUDA context for interoperability with VDPAU.
Parameters
pCtx
- Returned CUDA context
flags
- Options for CUDA context creation
device
- Device on which to create the context
vdpDevice
- The VdpDevice to interop with
vdpGetProcAddress
- VDPAU's VdpGetProcAddress function pointer
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_OUT_OF_MEMORY
Description
Creates a new CUDA context, initializes VDPAU interoperability, and associates the CUDA context
with the calling thread. It must be called before performing any other VDPAU interoperability
operations. It may fail if the needed VDPAU driver facilities are not available. For usage of the flags
parameter, see cuCtxCreate().
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
|
659
Modules
cuCtxCreate, cuGraphicsVDPAURegisterVideoSurface, cuGraphicsVDPAURegisterOutputSurface,
cuGraphicsUnregisterResource, cuGraphicsResourceSetMapFlags, cuGraphicsMapResources,
cuGraphicsUnmapResources, cuGraphicsSubResourceGetMappedArray, cuVDPAUGetDevice
CUresult cuVDPAUGetDevice (CUdevice *pDevice,
VdpDevice vdpDevice, VdpGetProcAddress
*vdpGetProcAddress)
Gets the CUDA device associated with a VDPAU device.
Parameters
pDevice
- Device associated with vdpDevice
vdpDevice
- A VdpDevice handle
vdpGetProcAddress
- VDPAU's VdpGetProcAddress function pointer
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE
Description
Returns in *pDevice the CUDA device associated with a vdpDevice, if applicable.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cuCtxCreate, cuVDPAUCtxCreate, cuGraphicsVDPAURegisterVideoSurface,
cuGraphicsVDPAURegisterOutputSurface, cuGraphicsUnregisterResource,
cuGraphicsResourceSetMapFlags, cuGraphicsMapResources, cuGraphicsUnmapResources,
cuGraphicsSubResourceGetMappedArray, cudaVDPAUGetDevice
6.45. EGL Interoperability
This section describes the EGL interoperability functions of the low-level CUDA driver application
programming interface.
|
660
Modules
CUresult cuEGLStreamConsumerAcquireFrame
(CUeglStreamConnection *conn, CUgraphicsResource
*pCudaResource, CUstream *pStream, unsigned int
timeout)
Acquire an image frame from the EGLStream with CUDA as a consumer.
Parameters
conn
- Connection on which to acquire
pCudaResource
- CUDA resource on which the stream frame will be mapped for use.
pStream
- CUDA stream for synchronization and any data migrations implied by
CUeglResourceLocationFlags.
timeout
- Desired timeout in usec for a new frame to be acquired. If set as
CUDA_EGL_INFINITE_TIMEOUT, acquire waits infinitely. After timeout occurs CUDA
consumer tries to acquire an old frame if available and EGL_SUPPORT_REUSE_NV flag is set.
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_LAUNCH_TIMEOUT,
Description
Acquire an image frame from EGLStreamKHR. This API can also acquire an old frame presented by
the producer unless explicitly disabled by setting EGL_SUPPORT_REUSE_NV flag to EGL_FALSE
during stream initialization. By default, EGLStream is created with this flag set to EGL_TRUE.
cuGraphicsResourceGetMappedEglFrame can be called on pCudaResource to get CUeglFrame.
See also:
cuEGLStreamConsumerConnect, cuEGLStreamConsumerDisconnect,
cuEGLStreamConsumerAcquireFrame, cuEGLStreamConsumerReleaseFrame,
cudaEGLStreamConsumerAcquireFrame
|
661
Modules
CUresult cuEGLStreamConsumerConnect
(CUeglStreamConnection *conn, EGLStreamKHR stream)
Connect CUDA to EGLStream as a consumer.
Parameters
conn
- Pointer to the returned connection handle
stream
- EGLStreamKHR handle
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_INVALID_CONTEXT,
Description
Connect CUDA as a consumer to EGLStreamKHR specified by stream.
The EGLStreamKHR is an EGL object that transfers a sequence of image frames from one API to
another.
See also:
cuEGLStreamConsumerConnect, cuEGLStreamConsumerDisconnect,
cuEGLStreamConsumerAcquireFrame, cuEGLStreamConsumerReleaseFrame,
cudaEGLStreamConsumerConnect
CUresult cuEGLStreamConsumerConnectWithFlags
(CUeglStreamConnection *conn, EGLStreamKHR stream,
unsigned int flags)
Connect CUDA to EGLStream as a consumer with given flags.
Parameters
conn
- Pointer to the returned connection handle
stream
- EGLStreamKHR handle
flags
- Flags denote intended location - system or video.
|
662
Modules
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_INVALID_CONTEXT,
Description
Connect CUDA as a consumer to EGLStreamKHR specified by stream with specified flags
defined by CUeglResourceLocationFlags.
The flags specify whether the consumer wants to access frames from system memory or video memory.
Default is CU_EGL_RESOURCE_LOCATION_VIDMEM.
See also:
cuEGLStreamConsumerConnect, cuEGLStreamConsumerDisconnect,
cuEGLStreamConsumerAcquireFrame, cuEGLStreamConsumerReleaseFrame,
cudaEGLStreamConsumerConnectWithFlags
CUresult cuEGLStreamConsumerDisconnect
(CUeglStreamConnection *conn)
Disconnect CUDA as a consumer to EGLStream .
Parameters
conn
- Conection to disconnect.
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_INVALID_CONTEXT,
Description
Disconnect CUDA as a consumer to EGLStreamKHR.
See also:
cuEGLStreamConsumerConnect, cuEGLStreamConsumerDisconnect,
cuEGLStreamConsumerAcquireFrame, cuEGLStreamConsumerReleaseFrame,
cudaEGLStreamConsumerDisconnect
|
663
Modules
CUresult cuEGLStreamConsumerReleaseFrame
(CUeglStreamConnection *conn, CUgraphicsResource
pCudaResource, CUstream *pStream)
Releases the last frame acquired from the EGLStream.
Parameters
conn
- Connection on which to release
pCudaResource
- CUDA resource whose corresponding frame is to be released
pStream
- CUDA stream on which release will be done.
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE,
Description
Release the acquired image frame specified by pCudaResource to EGLStreamKHR. If
EGL_SUPPORT_REUSE_NV flag is set to EGL_TRUE, at the time of EGL creation this API doesn't
release the last frame acquired on the EGLStream. By default, EGLStream is created with this flag set
to EGL_TRUE.
See also:
cuEGLStreamConsumerConnect, cuEGLStreamConsumerDisconnect,
cuEGLStreamConsumerAcquireFrame, cuEGLStreamConsumerReleaseFrame,
cudaEGLStreamConsumerReleaseFrame
CUresult cuEGLStreamProducerConnect
(CUeglStreamConnection *conn, EGLStreamKHR stream,
EGLint width, EGLint height)
Connect CUDA to EGLStream as a producer.
Parameters
conn
- Pointer to the returned connection handle
stream
- EGLStreamKHR handle
|
664
Modules
width
- width of the image to be submitted to the stream
height
- height of the image to be submitted to the stream
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_INVALID_CONTEXT,
Description
Connect CUDA as a producer to EGLStreamKHR specified by stream.
The EGLStreamKHR is an EGL object that transfers a sequence of image frames from one API to
another.
See also:
cuEGLStreamProducerConnect, cuEGLStreamProducerDisconnect,
cuEGLStreamProducerPresentFrame, cudaEGLStreamProducerConnect
CUresult cuEGLStreamProducerDisconnect
(CUeglStreamConnection *conn)
Disconnect CUDA as a producer to EGLStream .
Parameters
conn
- Conection to disconnect.
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_INVALID_CONTEXT,
Description
Disconnect CUDA as a producer to EGLStreamKHR.
See also:
cuEGLStreamProducerConnect, cuEGLStreamProducerDisconnect,
cuEGLStreamProducerPresentFrame, cudaEGLStreamProducerDisconnect
|
665
Modules
CUresult cuEGLStreamProducerPresentFrame
(CUeglStreamConnection *conn, CUeglFrame eglframe,
CUstream *pStream)
Present a CUDA eglFrame to the EGLStream with CUDA as a producer.
Parameters
conn
- Connection on which to present the CUDA array
eglframe
- CUDA Eglstream Proucer Frame handle to be sent to the consumer over EglStream.
pStream
- CUDA stream on which to present the frame.
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE,
Description
When a frame is presented by the producer, it gets associated with the EGLStream and thus it is illegal
to free the frame before the producer is disconnected. If a frame is freed and reused it may lead to
undefined behavior.
If producer and consumer are on different GPUs (iGPU and dGPU) then frametype
CU_EGL_FRAME_TYPE_ARRAY is not supported. CU_EGL_FRAME_TYPE_PITCH can be used
for such cross-device applications.
The CUeglFrame is defined as:
‎ typedef struct CUeglFrame_st {
union {
CUarray pArray[MAX_PLANES];
void*
pPitch[MAX_PLANES];
} frame;
unsigned int width;
unsigned int height;
unsigned int depth;
unsigned int pitch;
unsigned int planeCount;
unsigned int numChannels;
CUeglFrameType frameType;
CUeglColorFormat eglColorFormat;
CUarray_format cuFormat;
} CUeglFrame;
For CUeglFrame of type CU_EGL_FRAME_TYPE_PITCH, the application may present sub-region of
a memory allocation. In that case, the pitched pointer will specify the start address of the sub-region in
the allocation and corresponding CUeglFrame fields will specify the dimensions of the sub-region.
See also:
|
666
Modules
cuEGLStreamProducerConnect, cuEGLStreamProducerDisconnect,
cuEGLStreamProducerReturnFrame, cudaEGLStreamProducerPresentFrame
CUresult cuEGLStreamProducerReturnFrame
(CUeglStreamConnection *conn, CUeglFrame *eglframe,
CUstream *pStream)
Return the CUDA eglFrame to the EGLStream released by the consumer.
Parameters
conn
- Connection on which to return
eglframe
- CUDA Eglstream Proucer Frame handle returned from the consumer over EglStream.
pStream
- CUDA stream on which to return the frame.
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_LAUNCH_TIMEOUT
Description
This API can potentially return CUDA_ERROR_LAUNCH_TIMEOUT if the consumer has not
returned a frame to EGL stream. If timeout is returned the application can retry.
See also:
cuEGLStreamProducerConnect, cuEGLStreamProducerDisconnect,
cuEGLStreamProducerPresentFrame, cudaEGLStreamProducerReturnFrame
CUresult cuEventCreateFromEGLSync (CUevent
*phEvent, EGLSyncKHR eglSync, unsigned int flags)
Creates an event from EGLSync object.
Parameters
phEvent
- Returns newly created event
eglSync
- Opaque handle to EGLSync object
flags
- Event creation flags
|
667
Modules
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_OUT_OF_MEMORY
Description
Creates an event *phEvent from an EGLSyncKHR eglSync with the flags specified via flags. Valid
flags include:
CU_EVENT_DEFAULT: Default event creation flag.
CU_EVENT_BLOCKING_SYNC: Specifies that the created event should use blocking
synchronization. A CPU thread that uses cuEventSynchronize() to wait on an event created with
this flag will block until the event has actually been completed.
Once the eglSync gets destroyed, cuEventDestroy is the only API that can be invoked on the event.
cuEventRecord and TimingData are not supported for events created from EGLSync.
The EGLSyncKHR is an opaque handle to an EGL sync object. typedef void* EGLSyncKHR
See also:
cuEventQuery, cuEventSynchronize, cuEventDestroy
CUresult cuGraphicsEGLRegisterImage
(CUgraphicsResource *pCudaResource, EGLImageKHR
image, unsigned int flags)
Registers an EGL image.
Parameters
pCudaResource
- Pointer to the returned object handle
image
- An EGLImageKHR image which can be used to create target resource.
flags
- Map flags
Returns
CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_ALREADY_MAPPED,
CUDA_ERROR_INVALID_CONTEXT,
|
668
Modules
Description
Registers the EGLImageKHR specified by image for access by CUDA. A handle to the registered
object is returned as pCudaResource. Additional Mapping/Unmapping is not required for the
registered resource and cuGraphicsResourceGetMappedEglFrame can be directly called on the
pCudaResource.
The application will be responsible for synchronizing access to shared objects. The application must
ensure that any pending operation which access the objects have completed before passing control to
CUDA. This may be accomplished by issuing and waiting for glFinish command on all GLcontexts
(for OpenGL and likewise for other APIs). The application will be also responsible for ensuring that
any pending operation on the registered CUDA resource has completed prior to executing subsequent
commands in other APIs accesing the same memory objects. This can be accomplished by calling
cuCtxSynchronize or cuEventSynchronize (preferably).
The surface's intended usage is specified using flags, as follows:
CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this resource
will be used. It is therefore assumed that this resource will be read from and written to by CUDA.
This is the default value.
CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA will not
write to this resource.
CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that CUDA will not
read from this resource and will write over the entire contents of the resource, so none of the data
previously stored in the resource will be preserved.
The EGLImageKHR is an object which can be used to create EGLImage target resource. It is defined
as a void pointer. typedef void* EGLImageKHR
See also:
cuGraphicsEGLRegisterImage, cuGraphicsUnregisterResource, cuGraphicsResourceSetMapFlags,
cuGraphicsMapResources, cuGraphicsUnmapResources, cudaGraphicsEGLRegisterImage
CUresult cuGraphicsResourceGetMappedEglFrame
(CUeglFrame *eglFrame, CUgraphicsResource resource,
unsigned int index, unsigned int mipLevel)
Get an eglFrame through which to access a registered EGL graphics resource.
Parameters
eglFrame
- Returned eglFrame.
|
669
Modules
resource
- Registered resource to access.
index
- Index for cubemap surfaces.
mipLevel
- Mipmap level for the subresource to access.
Returns
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_NOT_MAPPED
Description
Returns in *eglFrame an eglFrame pointer through which the registered graphics resource
resource may be accessed. This API can only be called for registered EGL graphics resources.
The CUeglFrame is defined as:
‎ typedef struct CUeglFrame_st {
union {
CUarray pArray[MAX_PLANES];
void*
pPitch[MAX_PLANES];
} frame;
unsigned int width;
unsigned int height;
unsigned int depth;
unsigned int pitch;
unsigned int planeCount;
unsigned int numChannels;
CUeglFrameType frameType;
CUeglColorFormat eglColorFormat;
CUarray_format cuFormat;
} CUeglFrame;
If resource is not registered then CUDA_ERROR_NOT_MAPPED is returned. *
See also:
cuGraphicsMapResources, cuGraphicsSubResourceGetMappedArray,
cuGraphicsResourceGetMappedPointer, cudaGraphicsResourceGetMappedEglFrame
|
670
Chapter 7.
Data Structures
Here are the data structures with brief descriptions:
CUaccessPolicyWindow_v1
CUarrayMapInfo_v1
CUasyncNotificationInfo
CUcheckpointCheckpointArgs
CUcheckpointLockArgs
CUcheckpointRestoreArgs
CUcheckpointUnlockArgs
CUctxCigParam
CUctxCreateParams
CUDA_ARRAY3D_DESCRIPTOR_v2
CUDA_ARRAY_DESCRIPTOR_v2
CUDA_ARRAY_MEMORY_REQUIREMENTS_v1
CUDA_ARRAY_SPARSE_PROPERTIES_v1
CUDA_BATCH_MEM_OP_NODE_PARAMS_v2
CUDA_CHILD_GRAPH_NODE_PARAMS
CUDA_CONDITIONAL_NODE_PARAMS
CUDA_EVENT_RECORD_NODE_PARAMS
CUDA_EVENT_WAIT_NODE_PARAMS
CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1
CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2
CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1
CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2
CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1
CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1
CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1
CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1
CUDA_GRAPH_INSTANTIATE_PARAMS
CUDA_HOST_NODE_PARAMS_v1
CUDA_HOST_NODE_PARAMS_v2
CUDA_KERNEL_NODE_PARAMS_v1
|
671
Data Structures
CUDA_KERNEL_NODE_PARAMS_v2
CUDA_KERNEL_NODE_PARAMS_v3
CUDA_LAUNCH_PARAMS_v1
CUDA_MEM_ALLOC_NODE_PARAMS_v1
CUDA_MEM_ALLOC_NODE_PARAMS_v2
CUDA_MEM_FREE_NODE_PARAMS
CUDA_MEMCPY2D_v2
CUDA_MEMCPY3D_PEER_v1
CUDA_MEMCPY3D_v2
CUDA_MEMCPY_NODE_PARAMS
CUDA_MEMSET_NODE_PARAMS_v1
CUDA_MEMSET_NODE_PARAMS_v2
CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1
CUDA_RESOURCE_DESC_v1
CUDA_RESOURCE_VIEW_DESC_v1
CUDA_TEXTURE_DESC_v1
CUdevprop_v1
CUdevResource
CUdevSmResource
CUeglFrame_v1
CUexecAffinityParam_v1
CUexecAffinitySmCount_v1
CUextent3D_v1
CUgraphEdgeData
CUgraphExecUpdateResultInfo_v1
CUgraphNodeParams
CUipcEventHandle_v1
CUipcMemHandle_v1
CUlaunchAttribute
CUlaunchAttributeValue
CUlaunchConfig
CUlaunchMemSyncDomainMap
CUmemAccessDesc_v1
CUmemAllocationProp_v1
CUmemcpy3DOperand_v1
CUmemcpyAttributes_v1
CUmemDecompressParams
Structure describing the parameters that compose a single decompression operation
CUmemFabricHandle_v1
CUmemLocation_v1
CUmemPoolProps_v1
CUmemPoolPtrExportData_v1
CUmulticastObjectProp_v1
|
672
Data Structures
CUoffset3D_v1
CUstreamBatchMemOpParams_v1
CUtensorMap
7.1.
CUaccessPolicyWindow_v1 Struct
Reference
Specifies an access policy for a window, a contiguous extent of memory beginning
at base_ptr and ending at base_ptr + num_bytes. num_bytes is limited by
CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into many
segments and assign segments such that: sum of "hit segments" / window == approx. ratio. sum
of "miss segments" / window == approx 1-ratio. Segments and ratio specifications are fitted to the
capabilities of the architecture. Accesses in a hit segment apply the hitProp access policy. Accesses in a
miss segment apply the missProp access policy.
void *CUaccessPolicyWindow_v1::base_ptr
Starting address of the access policy window. CUDA driver may align it.
CUaccessProperty CUaccessPolicyWindow_v1::hitProp
CUaccessProperty set for hit.
float CUaccessPolicyWindow_v1::hitRatio
hitRatio specifies percentage of lines assigned hitProp, rest are assigned missProp.
CUaccessProperty CUaccessPolicyWindow_v1::missProp
CUaccessProperty set for miss. Must be either NORMAL or STREAMING
size_t CUaccessPolicyWindow_v1::num_bytes
Size in bytes of the window policy. CUDA driver may restrict the maximum size and alignment.
7.2.
CUarrayMapInfo_v1 Struct Reference
Specifies the CUDA array or CUDA mipmapped array memory mapping information
|
673
Data Structures
unsigned int CUarrayMapInfo_v1::deviceBitMask
Device ordinal bit mask
unsigned int CUarrayMapInfo_v1::extentDepth
Depth in elements
unsigned int CUarrayMapInfo_v1::extentHeight
Height in elements
unsigned int CUarrayMapInfo_v1::extentWidth
Width in elements
unsigned int CUarrayMapInfo_v1::flags
flags for future use, must be zero now.
unsigned int CUarrayMapInfo_v1::layer
For CUDA layered arrays must be a valid layer index. Otherwise, must be zero
unsigned int CUarrayMapInfo_v1::level
For CUDA mipmapped arrays must a valid mipmap level. For CUDA arrays must be zero
CUmemHandleType
CUarrayMapInfo_v1::memHandleType
Memory handle type
CUmemOperationType
CUarrayMapInfo_v1::memOperationType
Memory operation type
unsigned long long CUarrayMapInfo_v1::offset
Offset within mip tail
Offset within the memory
|
674
Data Structures
unsigned int CUarrayMapInfo_v1::offsetX
Starting X offset in elements
unsigned int CUarrayMapInfo_v1::offsetY
Starting Y offset in elements
unsigned int CUarrayMapInfo_v1::offsetZ
Starting Z offset in elements
unsigned int CUarrayMapInfo_v1::reserved
Reserved for future use, must be zero now.
CUresourcetype CUarrayMapInfo_v1::resourceType
Resource type
unsigned long long CUarrayMapInfo_v1::size
Extent in bytes
CUarraySparseSubresourceType
CUarrayMapInfo_v1::subresourceType
Sparse subresource type
7.3.
CUasyncNotificationInfo Struct
Reference
Information passed to the user via the async notification callback
unsigned long long
CUasyncNotificationInfo::bytesOverBudget
The number of bytes that the process has allocated above its device memory budget
|
675
Data Structures
CUasyncNotificationInfo::@4
CUasyncNotificationInfo::info
Information about the notification. type must be checked in order to interpret this field.
CUasyncNotificationInfo::@4::@5
CUasyncNotificationInfo::overBudget
Information about notifications of type CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET
CUasyncNotificationType CUasyncNotificationInfo::type
The type of notification being sent
7.4.
CUcheckpointCheckpointArgs Struct
Reference
CUDA checkpoint optional checkpoint arguments
cuuint64_t CUcheckpointCheckpointArgs::reserved
Reserved for future use, must be zeroed
7.5.
CUcheckpointLockArgs Struct Reference
CUDA checkpoint optional lock arguments
unsigned int CUcheckpointLockArgs::reserved0
Reserved for future use, must be zero
cuuint64_t CUcheckpointLockArgs::reserved1
Reserved for future use, must be zeroed
unsigned int CUcheckpointLockArgs::timeoutMs
Timeout in milliseconds to attempt to lock the process, 0 indicates no timeout
|
676
Data Structures
7.6.
CUcheckpointRestoreArgs Struct
Reference
CUDA checkpoint optional restore arguments
cuuint64_t CUcheckpointRestoreArgs::reserved
Reserved for future use, must be zeroed
7.7.
CUcheckpointUnlockArgs Struct
Reference
CUDA checkpoint optional unlock arguments
cuuint64_t CUcheckpointUnlockArgs::reserved
Reserved for future use, must be zeroed
7.8.
CUctxCigParam Struct Reference
CIG Context Create Params
7.9.
CUctxCreateParams Struct Reference
Params for creating CUDA context Exactly one of execAffinityParams and cigParams must be non-
NULL.
7.10. CUDA_ARRAY3D_DESCRIPTOR_v2
Struct Reference
3D array descriptor
size_t CUDA_ARRAY3D_DESCRIPTOR_v2::Depth
Depth of 3D array
|
677
Data Structures
unsigned int CUDA_ARRAY3D_DESCRIPTOR_v2::Flags
Flags
CUarray_format
CUDA_ARRAY3D_DESCRIPTOR_v2::Format
Array format
size_t CUDA_ARRAY3D_DESCRIPTOR_v2::Height
Height of 3D array
unsigned int
CUDA_ARRAY3D_DESCRIPTOR_v2::NumChannels
Channels per array element
size_t CUDA_ARRAY3D_DESCRIPTOR_v2::Width
Width of 3D array
7.11. CUDA_ARRAY_DESCRIPTOR_v2
Struct Reference
Array descriptor
CUarray_format
CUDA_ARRAY_DESCRIPTOR_v2::Format
Array format
size_t CUDA_ARRAY_DESCRIPTOR_v2::Height
Height of array
|
678
Data Structures
unsigned int
CUDA_ARRAY_DESCRIPTOR_v2::NumChannels
Channels per array element
size_t CUDA_ARRAY_DESCRIPTOR_v2::Width
Width of array
7.12. CUDA_ARRAY_MEMORY_REQUIREMENTS
Struct Reference
CUDA array memory requirements
size_t
CUDA_ARRAY_MEMORY_REQUIREMENTS_v1::alignment
alignment requirement
size_t
CUDA_ARRAY_MEMORY_REQUIREMENTS_v1::size
Total required memory size
7.13. CUDA_ARRAY_SPARSE_PROPERTIES_v1
Struct Reference
CUDA array sparse properties
unsigned int
CUDA_ARRAY_SPARSE_PROPERTIES_v1::depth
Depth of sparse tile in elements
|
679
Data Structures
unsigned int
CUDA_ARRAY_SPARSE_PROPERTIES_v1::flags
Flags will either be zero or CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL
unsigned int
CUDA_ARRAY_SPARSE_PROPERTIES_v1::height
Height of sparse tile in elements
unsigned int
CUDA_ARRAY_SPARSE_PROPERTIES_v1::miptailFirstLevel
First mip level at which the mip tail begins.
unsigned long long
CUDA_ARRAY_SPARSE_PROPERTIES_v1::miptailSize
Total size of the mip tail.
unsigned int
CUDA_ARRAY_SPARSE_PROPERTIES_v1::width
Width of sparse tile in elements
7.15. CUDA_CHILD_GRAPH_NODE_PARAMS
Struct Reference
Child graph node parameters
CUgraph
CUDA_CHILD_GRAPH_NODE_PARAMS::graph
The child graph to clone into the node for node creation, or a handle to the graph owned by the node
for node query. The graph must not contain conditional nodes. Graphs containing memory allocation or
memory free nodes must set the ownership to be moved to the parent.
|
680
Data Structures
CUgraphChildGraphNodeOwnership
CUDA_CHILD_GRAPH_NODE_PARAMS::ownership
The ownership relationship of the child graph node.
7.16. CUDA_CONDITIONAL_NODE_PARAMS
Struct Reference
Conditional node parameters
CUcontext
CUDA_CONDITIONAL_NODE_PARAMS::ctx
Context on which to run the node. Must match context used to create the handle and all body nodes.
CUgraphConditionalHandle
CUDA_CONDITIONAL_NODE_PARAMS::handle
Conditional node handle. Handles must be created in advance of creating the node using
cuGraphConditionalHandleCreate.
CUgraph
*CUDA_CONDITIONAL_NODE_PARAMS::phGraph_out
CUDA-owned array populated with conditional node child graphs during creation of the node. Valid
for the lifetime of the conditional node. The contents of the graph(s) are subject to the following
constraints:
Allowed node types are kernel nodes, empty nodes, child graphs, memsets, memcopies, and
conditionals. This applies recursively to child graphs and conditional bodies.
All kernels, including kernels in nested conditionals or child graphs at any level, must belong to the
same CUDA context.
These graphs may be populated using graph node creation APIs or cuStreamBeginCaptureToGraph.
CU_GRAPH_COND_TYPE_IF: phGraph_out[0] is executed when the condition is
non-zero. If size == 2, phGraph_out[1] will be executed when the condition is zero.
CU_GRAPH_COND_TYPE_WHILE: phGraph_out[0] is executed as long as the condition is non-
zero. CU_GRAPH_COND_TYPE_SWITCH: phGraph_out[n] is executed when the condition is equal
to n. If the condition >= size, no body graph is executed.
|
681
Data Structures
unsigned int
CUDA_CONDITIONAL_NODE_PARAMS::size
Size of graph output array. Allowed values are 1 for CU_GRAPH_COND_TYPE_WHILE,
1 or 2 for CU_GRAPH_COND_TYPE_IF, or any value greater than zero for
CU_GRAPH_COND_TYPE_SWITCH.
CUgraphConditionalNodeType
CUDA_CONDITIONAL_NODE_PARAMS::type
Type of conditional node.
7.17. CUDA_EVENT_RECORD_NODE_PARAMS
Struct Reference
Event record node parameters
CUevent
CUDA_EVENT_RECORD_NODE_PARAMS::event
The event to record when the node executes
7.18. CUDA_EVENT_WAIT_NODE_PARAMS
Struct Reference
Event wait node parameters
CUevent
CUDA_EVENT_WAIT_NODE_PARAMS::event
The event to wait on from the node
|
682
Data Structures
7.19. CUDA_EXT_SEM_SIGNAL_NODE_PARAMS
Struct Reference
Semaphore signal node parameters
CUexternalSemaphore
*CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1::extSemArray
Array of external semaphore handles.
unsigned int
CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1::numExtSems
Number of handles and parameters supplied in extSemArray and paramsArray.
const
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS
*CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1::paramsArray
Array of external semaphore signal parameters.
7.20. CUDA_EXT_SEM_SIGNAL_NODE_PARAMS
Struct Reference
Semaphore signal node parameters
CUexternalSemaphore
*CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2::extSemArray
Array of external semaphore handles.
unsigned int
CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2::numExtSems
Number of handles and parameters supplied in extSemArray and paramsArray.
|
683
Data Structures
const
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS
*CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2::paramsArray
Array of external semaphore signal parameters.
7.21. CUDA_EXT_SEM_WAIT_NODE_PARAMS_v
Struct Reference
Semaphore wait node parameters
CUexternalSemaphore
*CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1::extSemArray
Array of external semaphore handles.
unsigned int
CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1::numExtSems
Number of handles and parameters supplied in extSemArray and paramsArray.
const
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS
*CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1::paramsArray
Array of external semaphore wait parameters.
7.22. CUDA_EXT_SEM_WAIT_NODE_PARAMS_v
Struct Reference
Semaphore wait node parameters
|
684
Data Structures
CUexternalSemaphore
*CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2::extSemArray
Array of external semaphore handles.
unsigned int
CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2::numExtSems
Number of handles and parameters supplied in extSemArray and paramsArray.
const
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS
*CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2::paramsArray
Array of external semaphore wait parameters.
7.23. CUDA_EXTERNAL_MEMORY_BUFFER_DE
Struct Reference
External memory buffer descriptor
unsigned int
CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1::flags
Flags reserved for future use. Must be zero.
unsigned long long
CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1::offset
Offset into the memory object where the buffer's base is
unsigned long long
CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1::size
Size of the buffer
|
685
Data Structures
7.24. CUDA_EXTERNAL_MEMORY_HANDLE_DE
Struct Reference
External memory handle descriptor
int
CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1::fd
File descriptor referencing the memory object. Valid when type is
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD
unsigned int
CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1::flags
Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED
void
*CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1::handle
Valid NT handle. Must be NULL if 'name' is non-NULL
const void
*CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1::name
Name of a valid memory object. Must be NULL if 'handle' is non-NULL.
const void
*CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1::nvSciBufO
A handle representing an NvSciBuf Object. Valid when type is
CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
unsigned long long
CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1::size
Size of the memory allocation
|
686
Data Structures
CUexternalMemoryHandleType
CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1::type
Type of the handle
CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1::@19::@20
CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1::win32
Win32 handle referencing the semaphore object. Valid when type is one of the following:
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
Exactly one of 'handle' and 'name' must be non-NULL. If type is one of the following:
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT then 'name' must be
NULL.
7.25. CUDA_EXTERNAL_MEMORY_MIPMAPPED
Struct Reference
External memory mipmap descriptor
struct CUDA_ARRAY3D_DESCRIPTOR
CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v
Format, dimension and type of base level of the mipmap chain
unsigned int
CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v
Total number of levels in the mipmap chain
|
687
Data Structures
unsigned long long
CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v
Offset into the memory object where the base level of the mipmap chain is.
7.26. CUDA_EXTERNAL_SEMAPHORE_HANDLE
Struct Reference
External semaphore handle descriptor
int
CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1::fd
File descriptor referencing the semaphore object. Valid when type is one of the following:
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD
unsigned int
CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1::flags
Flags reserved for the future. Must be zero.
void
*CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1::handle
Valid NT handle. Must be NULL if 'name' is non-NULL
const void
*CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1::name
Name of a valid synchronization primitive. Must be NULL if 'handle' is non-NULL.
const void
*CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1::nvSciS
Valid NvSciSyncObj. Must be non NULL
|
688
Data Structures
CUexternalSemaphoreHandleType
CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1::type
Type of the handle
CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1::@21::@
CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1::win32
Win32 handle referencing the semaphore object. Valid when type is one of the following:
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 Exactly
one of 'handle' and 'name' must be non-NULL. If type is one of the following:
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT then
'name' must be NULL.
7.27. CUDA_EXTERNAL_SEMAPHORE_SIGNAL_
Struct Reference
External semaphore signal parameters
void
*CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1::fen
Pointer to NvSciSyncFence. Valid if CUexternalSemaphoreHandleType is of type
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC.
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1::@23
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1::fenc
Parameters for fence objects
|
689
Data Structures
unsigned int
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1::flags
Only when CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a
CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC,
the valid flag is CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC
which indicates that while signaling the CUexternalSemaphore, no memory synchronization
operations should be performed for any external memory object imported as
CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. For all other types of
CUexternalSemaphore, flags must be zero.
unsigned long long
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1::key
Value of key to release the mutex with
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1::@23
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1::keye
Parameters for keyed mutex objects
unsigned long long
CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1::valu
Value of fence to be signaled
7.28. CUDA_EXTERNAL_SEMAPHORE_WAIT_PA
Struct Reference
External semaphore wait parameters
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::@27::@
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::fence
Parameters for fence objects
|
690
Data Structures
unsigned int
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::flags
Only when CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a
CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC,
the valid flag is CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC
which indicates that while waiting for the CUexternalSemaphore, no memory
synchronization operations should be performed for any external memory object imported
as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. For all other types of
CUexternalSemaphore, flags must be zero.
unsigned long long
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::key
Value of key to acquire the mutex with
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::@27::@
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::keyedM
Parameters for keyed mutex objects
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::@27::@
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::nvSciS
Pointer to NvSciSyncFence. Valid if CUexternalSemaphoreHandleType is of type
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC.
unsigned int
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::timeout
Timeout in milliseconds to wait to acquire the mutex
unsigned long long
CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1::value
Value of fence to be waited on
|
691
Data Structures
7.29. CUDA_GRAPH_INSTANTIATE_PARAMS
Struct Reference
Graph instantiation parameters
cuuint64_t
CUDA_GRAPH_INSTANTIATE_PARAMS::flags
Instantiation flags
CUgraphNode
CUDA_GRAPH_INSTANTIATE_PARAMS::hErrNode_out
The node which caused instantiation to fail, if any
CUstream
CUDA_GRAPH_INSTANTIATE_PARAMS::hUploadStream
Upload stream
CUgraphInstantiateResult
CUDA_GRAPH_INSTANTIATE_PARAMS::result_out
Whether instantiation was successful. If it failed, the reason why
7.30. CUDA_HOST_NODE_PARAMS_v1
Struct Reference
Host node parameters
CUhostFn CUDA_HOST_NODE_PARAMS_v1::fn
The function to call when the node executes
void *CUDA_HOST_NODE_PARAMS_v1::userData
Argument to pass to the function
|
692
Data Structures
7.31. CUDA_HOST_NODE_PARAMS_v2
Struct Reference
Host node parameters
CUhostFn CUDA_HOST_NODE_PARAMS_v2::fn
The function to call when the node executes
void *CUDA_HOST_NODE_PARAMS_v2::userData
Argument to pass to the function
7.32. CUDA_KERNEL_NODE_PARAMS_v1
Struct Reference
GPU kernel node parameters
unsigned int
CUDA_KERNEL_NODE_PARAMS_v1::blockDimX
X dimension of each thread block
unsigned int
CUDA_KERNEL_NODE_PARAMS_v1::blockDimY
Y dimension of each thread block
unsigned int
CUDA_KERNEL_NODE_PARAMS_v1::blockDimZ
Z dimension of each thread block
**CUDA_KERNEL_NODE_PARAMS_v1::extra
Extra options
|
693
Data Structures
CUfunction CUDA_KERNEL_NODE_PARAMS_v1::func
Kernel to launch
unsigned int
CUDA_KERNEL_NODE_PARAMS_v1::gridDimX
Width of grid in blocks
unsigned int
CUDA_KERNEL_NODE_PARAMS_v1::gridDimY
Height of grid in blocks
unsigned int
CUDA_KERNEL_NODE_PARAMS_v1::gridDimZ
Depth of grid in blocks
**CUDA_KERNEL_NODE_PARAMS_v1::kernelParams
Array of pointers to kernel parameters
unsigned int
CUDA_KERNEL_NODE_PARAMS_v1::sharedMemBytes
Dynamic shared-memory size per thread block in bytes
7.33. CUDA_KERNEL_NODE_PARAMS_v2
Struct Reference
GPU kernel node parameters
unsigned int
CUDA_KERNEL_NODE_PARAMS_v2::blockDimX
X dimension of each thread block
|
694
Data Structures
unsigned int
CUDA_KERNEL_NODE_PARAMS_v2::blockDimY
Y dimension of each thread block
unsigned int
CUDA_KERNEL_NODE_PARAMS_v2::blockDimZ
Z dimension of each thread block
CUcontext CUDA_KERNEL_NODE_PARAMS_v2::ctx
Context for the kernel task to run in. The value NULL will indicate the current context should be used
by the api. This field is ignored if func is set.
**CUDA_KERNEL_NODE_PARAMS_v2::extra
Extra options
CUfunction CUDA_KERNEL_NODE_PARAMS_v2::func
Kernel to launch
unsigned int
CUDA_KERNEL_NODE_PARAMS_v2::gridDimX
Width of grid in blocks
unsigned int
CUDA_KERNEL_NODE_PARAMS_v2::gridDimY
Height of grid in blocks
unsigned int
CUDA_KERNEL_NODE_PARAMS_v2::gridDimZ
Depth of grid in blocks
|
695
Data Structures
CUkernel CUDA_KERNEL_NODE_PARAMS_v2::kern
Kernel to launch, will only be referenced if func is NULL
**CUDA_KERNEL_NODE_PARAMS_v2::kernelParams
Array of pointers to kernel parameters
unsigned int
CUDA_KERNEL_NODE_PARAMS_v2::sharedMemBytes
Dynamic shared-memory size per thread block in bytes
7.34. CUDA_KERNEL_NODE_PARAMS_v3
Struct Reference
GPU kernel node parameters
unsigned int
CUDA_KERNEL_NODE_PARAMS_v3::blockDimX
X dimension of each thread block
unsigned int
CUDA_KERNEL_NODE_PARAMS_v3::blockDimY
Y dimension of each thread block
unsigned int
CUDA_KERNEL_NODE_PARAMS_v3::blockDimZ
Z dimension of each thread block
CUcontext CUDA_KERNEL_NODE_PARAMS_v3::ctx
Context for the kernel task to run in. The value NULL will indicate the current context should be used
by the api. This field is ignored if func is set.
|
696
Data Structures
**CUDA_KERNEL_NODE_PARAMS_v3::extra
Extra options
CUfunction CUDA_KERNEL_NODE_PARAMS_v3::func
Kernel to launch
unsigned int
CUDA_KERNEL_NODE_PARAMS_v3::gridDimX
Width of grid in blocks
unsigned int
CUDA_KERNEL_NODE_PARAMS_v3::gridDimY
Height of grid in blocks
unsigned int
CUDA_KERNEL_NODE_PARAMS_v3::gridDimZ
Depth of grid in blocks
CUkernel CUDA_KERNEL_NODE_PARAMS_v3::kern
Kernel to launch, will only be referenced if func is NULL
**CUDA_KERNEL_NODE_PARAMS_v3::kernelParams
Array of pointers to kernel parameters
unsigned int
CUDA_KERNEL_NODE_PARAMS_v3::sharedMemBytes
Dynamic shared-memory size per thread block in bytes
|
697
Data Structures
7.35. CUDA_LAUNCH_PARAMS_v1 Struct
Reference
Kernel launch parameters
unsigned int CUDA_LAUNCH_PARAMS_v1::blockDimX
X dimension of each thread block
unsigned int CUDA_LAUNCH_PARAMS_v1::blockDimY
Y dimension of each thread block
unsigned int CUDA_LAUNCH_PARAMS_v1::blockDimZ
Z dimension of each thread block
CUfunction CUDA_LAUNCH_PARAMS_v1::function
Kernel to launch
unsigned int CUDA_LAUNCH_PARAMS_v1::gridDimX
Width of grid in blocks
unsigned int CUDA_LAUNCH_PARAMS_v1::gridDimY
Height of grid in blocks
unsigned int CUDA_LAUNCH_PARAMS_v1::gridDimZ
Depth of grid in blocks
CUstream CUDA_LAUNCH_PARAMS_v1::hStream
Stream identifier
**CUDA_LAUNCH_PARAMS_v1::kernelParams
Array of pointers to kernel parameters
|
698
Data Structures
unsigned int
CUDA_LAUNCH_PARAMS_v1::sharedMemBytes
Dynamic shared-memory size per thread block in bytes
7.36. CUDA_MEM_ALLOC_NODE_PARAMS_v1
Struct Reference
Memory allocation node parameters
size_t
CUDA_MEM_ALLOC_NODE_PARAMS_v1::accessDescCount
in: number of memory access descriptors. Must not exceed the number of GPUs.
const CUmemAccessDesc
*CUDA_MEM_ALLOC_NODE_PARAMS_v1::accessDescs
in: array of memory access descriptors. Used to describe peer GPU access
size_t
CUDA_MEM_ALLOC_NODE_PARAMS_v1::bytesize
in: size in bytes of the requested allocation
CUdeviceptr
CUDA_MEM_ALLOC_NODE_PARAMS_v1::dptr
out: address of the allocation returned by CUDA
struct CUmemPoolProps
CUDA_MEM_ALLOC_NODE_PARAMS_v1::poolProps
in: location where the allocation should reside (specified in location). handleTypes must be
CU_MEM_HANDLE_TYPE_NONE. IPC is not supported.
|
699
Data Structures
7.37. CUDA_MEM_ALLOC_NODE_PARAMS_v2
Struct Reference
Memory allocation node parameters
size_t
CUDA_MEM_ALLOC_NODE_PARAMS_v2::accessDescCount
in: number of memory access descriptors. Must not exceed the number of GPUs.
const CUmemAccessDesc
*CUDA_MEM_ALLOC_NODE_PARAMS_v2::accessDescs
in: array of memory access descriptors. Used to describe peer GPU access
size_t
CUDA_MEM_ALLOC_NODE_PARAMS_v2::bytesize
in: size in bytes of the requested allocation
CUdeviceptr
CUDA_MEM_ALLOC_NODE_PARAMS_v2::dptr
out: address of the allocation returned by CUDA
struct CUmemPoolProps
CUDA_MEM_ALLOC_NODE_PARAMS_v2::poolProps
in: location where the allocation should reside (specified in location). handleTypes must be
CU_MEM_HANDLE_TYPE_NONE. IPC is not supported.
7.38. CUDA_MEM_FREE_NODE_PARAMS
Struct Reference
Memory free node parameters
|
700
Data Structures
CUdeviceptr
CUDA_MEM_FREE_NODE_PARAMS::dptr
in: the pointer to free
7.39. CUDA_MEMCPY2D_v2 Struct
Reference
2D memory copy parameters
CUarray CUDA_MEMCPY2D_v2::dstArray
Destination array reference
CUdeviceptr CUDA_MEMCPY2D_v2::dstDevice
Destination device pointer
void *CUDA_MEMCPY2D_v2::dstHost
Destination host pointer
CUmemorytype
CUDA_MEMCPY2D_v2::dstMemoryType
Destination memory type (host, device, array)
size_t CUDA_MEMCPY2D_v2::dstPitch
Destination pitch (ignored when dst is array)
size_t CUDA_MEMCPY2D_v2::dstXInBytes
Destination X in bytes
size_t CUDA_MEMCPY2D_v2::dstY
Destination Y
|
701
Data Structures
size_t CUDA_MEMCPY2D_v2::Height
Height of 2D memory copy
CUarray CUDA_MEMCPY2D_v2::srcArray
Source array reference
CUdeviceptr CUDA_MEMCPY2D_v2::srcDevice
Source device pointer
const void *CUDA_MEMCPY2D_v2::srcHost
Source host pointer
CUmemorytype
CUDA_MEMCPY2D_v2::srcMemoryType
Source memory type (host, device, array)
size_t CUDA_MEMCPY2D_v2::srcPitch
Source pitch (ignored when src is array)
size_t CUDA_MEMCPY2D_v2::srcXInBytes
Source X in bytes
size_t CUDA_MEMCPY2D_v2::srcY
Source Y
size_t CUDA_MEMCPY2D_v2::WidthInBytes
Width of 2D memory copy in bytes
7.40. CUDA_MEMCPY3D_PEER_v1 Struct
Reference
3D memory cross-context copy parameters
|
702
Data Structures
size_t CUDA_MEMCPY3D_PEER_v1::Depth
Depth of 3D memory copy
CUarray CUDA_MEMCPY3D_PEER_v1::dstArray
Destination array reference
CUcontext CUDA_MEMCPY3D_PEER_v1::dstContext
Destination context (ignored with dstMemoryType is CU_MEMORYTYPE_ARRAY)
CUdeviceptr CUDA_MEMCPY3D_PEER_v1::dstDevice
Destination device pointer
size_t CUDA_MEMCPY3D_PEER_v1::dstHeight
Destination height (ignored when dst is array; may be 0 if Depth==1)
void *CUDA_MEMCPY3D_PEER_v1::dstHost
Destination host pointer
size_t CUDA_MEMCPY3D_PEER_v1::dstLOD
Destination LOD
CUmemorytype
CUDA_MEMCPY3D_PEER_v1::dstMemoryType
Destination memory type (host, device, array)
size_t CUDA_MEMCPY3D_PEER_v1::dstPitch
Destination pitch (ignored when dst is array)
size_t CUDA_MEMCPY3D_PEER_v1::dstXInBytes
Destination X in bytes
|
703
Data Structures
size_t CUDA_MEMCPY3D_PEER_v1::dstY
Destination Y
size_t CUDA_MEMCPY3D_PEER_v1::dstZ
Destination Z
size_t CUDA_MEMCPY3D_PEER_v1::Height
Height of 3D memory copy
CUarray CUDA_MEMCPY3D_PEER_v1::srcArray
Source array reference
CUcontext CUDA_MEMCPY3D_PEER_v1::srcContext
Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY)
CUdeviceptr CUDA_MEMCPY3D_PEER_v1::srcDevice
Source device pointer
size_t CUDA_MEMCPY3D_PEER_v1::srcHeight
Source height (ignored when src is array; may be 0 if Depth==1)
const void *CUDA_MEMCPY3D_PEER_v1::srcHost
Source host pointer
size_t CUDA_MEMCPY3D_PEER_v1::srcLOD
Source LOD
CUmemorytype
CUDA_MEMCPY3D_PEER_v1::srcMemoryType
Source memory type (host, device, array)
|
704
Data Structures
size_t CUDA_MEMCPY3D_PEER_v1::srcPitch
Source pitch (ignored when src is array)
size_t CUDA_MEMCPY3D_PEER_v1::srcXInBytes
Source X in bytes
size_t CUDA_MEMCPY3D_PEER_v1::srcY
Source Y
size_t CUDA_MEMCPY3D_PEER_v1::srcZ
Source Z
size_t CUDA_MEMCPY3D_PEER_v1::WidthInBytes
Width of 3D memory copy in bytes
7.41. CUDA_MEMCPY3D_v2 Struct
Reference
3D memory copy parameters
size_t CUDA_MEMCPY3D_v2::Depth
Depth of 3D memory copy
CUarray CUDA_MEMCPY3D_v2::dstArray
Destination array reference
CUdeviceptr CUDA_MEMCPY3D_v2::dstDevice
Destination device pointer
size_t CUDA_MEMCPY3D_v2::dstHeight
Destination height (ignored when dst is array; may be 0 if Depth==1)
|
705
Data Structures
void *CUDA_MEMCPY3D_v2::dstHost
Destination host pointer
size_t CUDA_MEMCPY3D_v2::dstLOD
Destination LOD
CUmemorytype
CUDA_MEMCPY3D_v2::dstMemoryType
Destination memory type (host, device, array)
size_t CUDA_MEMCPY3D_v2::dstPitch
Destination pitch (ignored when dst is array)
size_t CUDA_MEMCPY3D_v2::dstXInBytes
Destination X in bytes
size_t CUDA_MEMCPY3D_v2::dstY
Destination Y
size_t CUDA_MEMCPY3D_v2::dstZ
Destination Z
size_t CUDA_MEMCPY3D_v2::Height
Height of 3D memory copy
void *CUDA_MEMCPY3D_v2::reserved0
Must be NULL
void *CUDA_MEMCPY3D_v2::reserved1
Must be NULL
|
706
Data Structures
CUarray CUDA_MEMCPY3D_v2::srcArray
Source array reference
CUdeviceptr CUDA_MEMCPY3D_v2::srcDevice
Source device pointer
size_t CUDA_MEMCPY3D_v2::srcHeight
Source height (ignored when src is array; may be 0 if Depth==1)
const void *CUDA_MEMCPY3D_v2::srcHost
Source host pointer
size_t CUDA_MEMCPY3D_v2::srcLOD
Source LOD
CUmemorytype
CUDA_MEMCPY3D_v2::srcMemoryType
Source memory type (host, device, array)
size_t CUDA_MEMCPY3D_v2::srcPitch
Source pitch (ignored when src is array)
size_t CUDA_MEMCPY3D_v2::srcXInBytes
Source X in bytes
size_t CUDA_MEMCPY3D_v2::srcY
Source Y
size_t CUDA_MEMCPY3D_v2::srcZ
Source Z
|
707
Data Structures
size_t CUDA_MEMCPY3D_v2::WidthInBytes
Width of 3D memory copy in bytes
7.42. CUDA_MEMCPY_NODE_PARAMS
Struct Reference
Memcpy node parameters
CUcontext
CUDA_MEMCPY_NODE_PARAMS::copyCtx
Context on which to run the node
struct CUDA_MEMCPY3D
CUDA_MEMCPY_NODE_PARAMS::copyParams
Parameters for the memory copy
int CUDA_MEMCPY_NODE_PARAMS::flags
Must be zero
int CUDA_MEMCPY_NODE_PARAMS::reserved
Must be zero
7.43. CUDA_MEMSET_NODE_PARAMS_v1
Struct Reference
Memset node parameters
CUdeviceptr CUDA_MEMSET_NODE_PARAMS_v1::dst
Destination device pointer
|
708
Data Structures
unsigned int
CUDA_MEMSET_NODE_PARAMS_v1::elementSize
Size of each element in bytes. Must be 1, 2, or 4.
size_t CUDA_MEMSET_NODE_PARAMS_v1::height
Number of rows
size_t CUDA_MEMSET_NODE_PARAMS_v1::pitch
Pitch of destination device pointer. Unused if height is 1
unsigned int
CUDA_MEMSET_NODE_PARAMS_v1::value
Value to be set
size_t CUDA_MEMSET_NODE_PARAMS_v1::width
Width of the row in elements
7.44. CUDA_MEMSET_NODE_PARAMS_v2
Struct Reference
Memset node parameters
CUcontext CUDA_MEMSET_NODE_PARAMS_v2::ctx
Context on which to run the node
CUdeviceptr CUDA_MEMSET_NODE_PARAMS_v2::dst
Destination device pointer
unsigned int
CUDA_MEMSET_NODE_PARAMS_v2::elementSize
Size of each element in bytes. Must be 1, 2, or 4.
|
709
Data Structures
size_t CUDA_MEMSET_NODE_PARAMS_v2::height
Number of rows
size_t CUDA_MEMSET_NODE_PARAMS_v2::pitch
Pitch of destination device pointer. Unused if height is 1
unsigned int
CUDA_MEMSET_NODE_PARAMS_v2::value
Value to be set
size_t CUDA_MEMSET_NODE_PARAMS_v2::width
Width of the row in elements
7.45. CUDA_POINTER_ATTRIBUTE_P2P_TOKENS
Struct Reference
GPU Direct v3 tokens
7.46. CUDA_RESOURCE_DESC_v1 Struct
Reference
CUDA Resource descriptor
CUdeviceptr CUDA_RESOURCE_DESC_v1::devPtr
Device pointer
unsigned int CUDA_RESOURCE_DESC_v1::flags
Flags (must be zero)
CUarray_format CUDA_RESOURCE_DESC_v1::format
Array format
|
710
Data Structures
CUarray CUDA_RESOURCE_DESC_v1::hArray
CUDA array
size_t CUDA_RESOURCE_DESC_v1::height
Height of the array in elements
CUmipmappedArray
CUDA_RESOURCE_DESC_v1::hMipmappedArray
CUDA mipmapped array
unsigned int
CUDA_RESOURCE_DESC_v1::numChannels
Channels per array element
size_t CUDA_RESOURCE_DESC_v1::pitchInBytes
Pitch between two rows in bytes
CUresourcetype CUDA_RESOURCE_DESC_v1::resType
Resource type
size_t CUDA_RESOURCE_DESC_v1::sizeInBytes
Size in bytes
size_t CUDA_RESOURCE_DESC_v1::width
Width of the array in elements
7.47. CUDA_RESOURCE_VIEW_DESC_v1
Struct Reference
Resource view descriptor
|
711

 

 

 

 

 

 

 

Content      ..     8      9      10      11     ..