CUDA Runtime API. API Reference Manual (vRelease Version, January 2024) - page 7

 

  Index      Manuals     CUDA Runtime API. API Reference Manual (vRelease Version, January 2024)

 

Search            copyright infringement  

 

   

 

   

 

Content      ..     5      6      7      8     ..

 

 

 

CUDA Runtime API. API Reference Manual (vRelease Version, January 2024) - page 7

 

 

Modules
cudaChannelFormatKindUnsignedNormalized16X4,
cudaChannelFormatKindUnsignedNormalized1010102 or cudaChannelFormatKindNV12.
The format is specified by the template specialization.
The template function specializes for the following scalar types: char, signed char, unsigned char, short,
unsigned short, int, unsigned int, long, unsigned long, and float. The template function specializes
for the following vector types: char{1|2|4}, uchar{1|2|4}, short{1|2|4}, ushort{1|2|4}, int{1|2|4},
uint{1|2|4}, long{1|2|4}, ulong{1|2|4}, float{1|2|4}. The template function specializes for following
cudaChannelFormatKind enum values: cudaChannelFormatKind{Uns|S}ignedNormalized{8|16}X{1|2|
4}, cudaChannelFormatKindUnsignedNormalized1010102 and cudaChannelFormatKindNV12.
Invoking the function on a type without a specialization defaults to creating a channel format of kind
cudaChannelFormatKindNone
See also:
cudaCreateChannelDesc ( Low level), cudaGetChannelDesc,
__host__cudaError_t cudaEventCreate (cudaEvent_t
*event, unsigned int flags)
[C++ API] Creates an event object with the specified flags
Parameters
event
- Newly created event
flags
- Flags for new event
Returns
cudaSuccess, cudaErrorInvalidValue, cudaErrorLaunchFailure, cudaErrorMemoryAllocation
Description
Creates an event object with the specified flags. Valid flags include:
cudaEventDefault: Default event creation flag.
cudaEventBlockingSync: Specifies that event should use blocking synchronization. A host thread
that uses cudaEventSynchronize() to wait on an event created with this flag will block until the
event actually completes.
cudaEventDisableTiming: Specifies that the created event does not need to record timing data.
Events created with this flag specified and the cudaEventBlockingSync flag not specified will
provide the best performance when used with cudaStreamWaitEvent() and cudaEventQuery().
|
418
Modules
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaEventCreate ( C API), cudaEventCreateWithFlags, cudaEventRecord, cudaEventQuery,
cudaEventSynchronize, cudaEventDestroy, cudaEventElapsedTime, cudaStreamWaitEvent
template < class T > __host__cudaError_t
cudaFuncGetAttributes (cudaFuncAttributes *attr, T
*entry)
[C++ API] Find out attributes for a given function
Parameters
attr
- Return pointer to function's attributes
entry
- Function to get attributes of
Returns
cudaSuccess, cudaErrorInvalidDeviceFunction
Description
This function obtains the attributes of a function specified via entry. The parameter entry must be a
pointer to a function that executes on the device. The parameter specified by entry must be declared
as a __global__ function. The fetched attributes are placed in attr. If the specified function does
not exist, then cudaErrorInvalidDeviceFunction is returned.
Note that some function attributes such as maxThreadsPerBlock may vary based on the device that is
currently being used.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
|
419
Modules
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
cudaLaunchKernel ( C++ API), cudaFuncSetCacheConfig ( C++ API), cudaFuncGetAttributes ( C
API), cudaSetDoubleForDevice, cudaSetDoubleForHost
template < class T > __host__cudaError_t
cudaFuncGetName (const char **name, T *func)
Returns the function name for a device entry function pointer.
Parameters
name
- The returned name of the function
func
- The function pointer to retrieve name for
Returns
cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidDeviceFunction
Description
Returns in **name the function name associated with the symbol func . The function name is
returned as a null-terminated string. This API may return a mangled name if the function is not
declared as having C linkage. If **name is NULL, cudaErrorInvalidValue is returned. If func is not
a device entry function, cudaErrorInvalidDeviceFunction is returned.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
|
420
Modules
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
cudaFuncGetName ( C API)
template < class T > __host__cudaError_t
cudaFuncSetAttribute (T *func, cudaFuncAttribute attr, int
value)
[C++ API] Set attributes for a given function
Parameters
func
attr
- Attribute to set
value
- Value to set
Returns
cudaSuccess, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue
Description
This function sets the attributes of a function specified via entry. The parameter entry must
be a pointer to a function that executes on the device. The parameter specified by entry must be
declared as a __global__ function. The enumeration defined by attr is set to the value defined
by value. If the specified function does not exist, then cudaErrorInvalidDeviceFunction is returned.
If the specified attribute cannot be written, or if the value is incorrect, then cudaErrorInvalidValue is
returned.
Valid values for attr are:
cudaFuncAttributeMaxDynamicSharedMemorySize - The requested maximum
size in bytes of dynamically-allocated shared memory. The sum of this value
and the function attribute sharedSizeBytes cannot exceed the device attribute
cudaDevAttrMaxSharedMemoryPerBlockOptin. The maximal size of requestable dynamic shared
memory may differ by GPU architecture.
cudaFuncAttributePreferredSharedMemoryCarveout - On devices where the L1 cache and shared
memory use the same hardware resources, this sets the shared memory carveout preference, in
|
421
Modules
percent of the total shared memory. See cudaDevAttrMaxSharedMemoryPerMultiprocessor. This
is only a hint, and the driver can choose a different ratio if required to execute the function.
cudaFuncAttributeRequiredClusterWidth: The required cluster width in blocks. The width, height,
and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is
checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it
at runtime will return cudaErrorNotPermitted.
cudaFuncAttributeRequiredClusterHeight: The required cluster height in blocks. The width, height,
and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is
checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it
at runtime will return cudaErrorNotPermitted.
cudaFuncAttributeRequiredClusterDepth: The required cluster depth in blocks. The width, height,
and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is
checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it
at runtime will return cudaErrorNotPermitted.
cudaFuncAttributeNonPortableClusterSizeAllowed: Indicates whether the function can be
launched with non-portable cluster size. 1 is allowed, 0 is disallowed.
cudaFuncAttributeClusterSchedulingPolicyPreference: The block scheduling policy of a function.
The value type is cudaClusterSchedulingPolicy.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
cudaLaunchKernel ( C++ API), cudaFuncSetCacheConfig ( C++ API), cudaFuncGetAttributes ( C
API), cudaSetDoubleForDevice, cudaSetDoubleForHost
|
422
Modules
template < class T > __host__cudaError_t
cudaFuncSetCacheConfig (T *func, cudaFuncCache
cacheConfig)
[C++ API] Sets the preferred cache configuration for a device function
Parameters
func
- device function pointer
cacheConfig
- Requested cache configuration
Returns
cudaSuccess, cudaErrorInvalidDeviceFunction
Description
On devices where the L1 cache and shared memory use the same hardware resources, this sets through
cacheConfig the preferred cache configuration for the function specified via func. This is only
a preference. The runtime will use the requested configuration if possible, but it is free to choose a
different configuration if required to execute func.
func must be a pointer to a function that executes on the device. The parameter specified by
func must be declared as a __global__ function. If the specified function does not exist, then
cudaErrorInvalidDeviceFunction is returned.
This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
Launching a kernel with a different preference than the most recent preference setting may insert a
device-side synchronization point.
The supported cache configurations are:
cudaFuncCachePreferNone: no preference for shared memory or L1 (default)
cudaFuncCachePreferShared: prefer larger shared memory and smaller L1 cache
cudaFuncCachePreferL1: prefer larger L1 cache and smaller shared memory
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
|
423
Modules
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
cudaLaunchKernel ( C++ API), cudaFuncSetCacheConfig ( C API), cudaFuncGetAttributes
( C++ API), cudaSetDoubleForDevice, cudaSetDoubleForHost, cudaThreadGetCacheConfig,
cudaThreadSetCacheConfig
template < class T > __host__cudaError_t cudaGetKernel
(cudaKernel_t *kernelPtr, T *func)
Get pointer to device kernel that matches entry function entryFuncAddr.
Parameters
kernelPtr
- Returns the device kernel
func
Returns
cudaSuccess
Description
Returns in kernelPtr the device kernel corresponding to the entry function entryFuncAddr.
See also:
cudaGetKernel ( C API)
template < class T > __host__cudaError_t
cudaGetSymbolAddress (void **devPtr, const T symbol)
[C++ API] Finds the address associated with a CUDA symbol
Parameters
devPtr
- Return device pointer associated with symbol
symbol
- Device symbol reference
Returns
cudaSuccess, cudaErrorInvalidSymbol, cudaErrorNoKernelImageForDevice
|
424
Modules
Description
Returns in *devPtr the address of symbol symbol on the device. symbol can either be a
variable that resides in global or constant memory space. If symbol cannot be found, or if symbol
is not declared in the global or constant memory space, *devPtr is unchanged and the error
cudaErrorInvalidSymbol is returned.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaGetSymbolAddress ( C API), cudaGetSymbolSize ( C++ API)
template < class T > __host__cudaError_t
cudaGetSymbolSize (size_t *size, const T symbol)
[C++ API] Finds the size of the object associated with a CUDA symbol
Parameters
size
- Size of object associated with symbol
symbol
- Device symbol reference
Returns
cudaSuccess, cudaErrorInvalidSymbol, cudaErrorNoKernelImageForDevice
Description
Returns in *size the size of symbol symbol. symbol must be a variable that resides in global
or constant memory space. If symbol cannot be found, or if symbol is not declared in global or
constant memory space, *size is unchanged and the error cudaErrorInvalidSymbol is returned.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
|
425
Modules
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaGetSymbolAddress ( C++ API), cudaGetSymbolSize ( C API)
template < class T > __host__cudaError_t
cudaGraphAddMemcpyNodeFromSymbol
(cudaGraphNode_t *pGraphNode, cudaGraph_t graph,
const cudaGraphNode_t *pDependencies, size_t
numDependencies, void *dst, const T symbol, size_t count,
size_t offset, cudaMemcpyKind kind)
Creates a memcpy node to copy from a symbol on the device and adds it to a graph.
Parameters
pGraphNode
- Returns newly created node
graph
- Graph to which to add the node
pDependencies
- Dependencies of the node
numDependencies
- Number of dependencies
dst
- Destination memory address
symbol
- Device symbol address
count
- Size in bytes to copy
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
Returns
cudaSuccess, cudaErrorInvalidValue
|
426
Modules
Description
Creates a new memcpy node to copy from symbol and adds it to graph with numDependencies
dependencies specified via pDependencies. It is possible for numDependencies to be 0, in
which case the node will be placed at the root of the graph. pDependencies may not have any
duplicate entries. A handle to the new node will be returned in pGraphNode.
When the graph is launched, the node will copy count bytes from the memory area pointed to by
offset bytes from the start of symbol symbol to the memory area pointed to by dst. The memory
areas may not overlap. symbol is a variable that resides in global or constant memory space. kind
can be either cudaMemcpyDeviceToHost, cudaMemcpyDeviceToDevice, or cudaMemcpyDefault.
Passing cudaMemcpyDefault is recommended, in which case the type of transfer is inferred from the
pointer values. However, cudaMemcpyDefault is only allowed on systems that support unified virtual
addressing.
Memcpy nodes have some additional restrictions with regards to managed memory, if
the system contains at least one device which has a zero value for the device attribute
cudaDevAttrConcurrentManagedAccess.
Note:
Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaMemcpyFromSymbol, cudaGraphAddMemcpyNode, cudaGraphAddMemcpyNodeToSymbol,
cudaGraphMemcpyNodeGetParams, cudaGraphMemcpyNodeSetParams,
cudaGraphMemcpyNodeSetParamsFromSymbol, cudaGraphMemcpyNodeSetParamsToSymbol,
cudaGraphCreate, cudaGraphDestroyNode, cudaGraphAddChildGraphNode,
cudaGraphAddEmptyNode, cudaGraphAddKernelNode, cudaGraphAddHostNode,
cudaGraphAddMemsetNode
|
427
Modules
template < class T > __host__cudaError_t
cudaGraphAddMemcpyNodeToSymbol (cudaGraphNode_t
*pGraphNode, cudaGraph_t graph, const cudaGraphNode_t
*pDependencies, size_t numDependencies, const T
symbol, const void *src, size_t count, size_t offset,
cudaMemcpyKind kind)
Creates a memcpy node to copy to a symbol on the device and adds it to a graph.
Parameters
pGraphNode
- Returns newly created node
graph
- Graph to which to add the node
pDependencies
- Dependencies of the node
numDependencies
- Number of dependencies
symbol
- Device symbol address
src
- Source memory address
count
- Size in bytes to copy
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
Returns
cudaSuccess, cudaErrorInvalidValue
Description
Creates a new memcpy node to copy to symbol and adds it to graph with numDependencies
dependencies specified via pDependencies. It is possible for numDependencies to be 0, in
which case the node will be placed at the root of the graph. pDependencies may not have any
duplicate entries. A handle to the new node will be returned in pGraphNode.
When the graph is launched, the node will copy count bytes from the memory area pointed to by
src to the memory area pointed to by offset bytes from the start of symbol symbol. The memory
|
428
Modules
areas may not overlap. symbol is a variable that resides in global or constant memory space. kind
can be either cudaMemcpyHostToDevice, cudaMemcpyDeviceToDevice, or cudaMemcpyDefault.
Passing cudaMemcpyDefault is recommended, in which case the type of transfer is inferred from the
pointer values. However, cudaMemcpyDefault is only allowed on systems that support unified virtual
addressing.
Memcpy nodes have some additional restrictions with regards to managed memory, if
the system contains at least one device which has a zero value for the device attribute
cudaDevAttrConcurrentManagedAccess.
Note:
Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaMemcpyToSymbol, cudaGraphAddMemcpyNode, cudaGraphAddMemcpyNodeFromSymbol,
cudaGraphMemcpyNodeGetParams, cudaGraphMemcpyNodeSetParams,
cudaGraphMemcpyNodeSetParamsToSymbol, cudaGraphMemcpyNodeSetParamsFromSymbol,
cudaGraphCreate, cudaGraphDestroyNode, cudaGraphAddChildGraphNode,
cudaGraphAddEmptyNode, cudaGraphAddKernelNode, cudaGraphAddHostNode,
cudaGraphAddMemsetNode
template < class T > __host__cudaError_t
cudaGraphExecMemcpyNodeSetParamsFromSymbol
(cudaGraphExec_t hGraphExec, cudaGraphNode_t node,
void *dst, const T symbol, size_t count, size_t offset,
cudaMemcpyKind kind)
Sets the parameters for a memcpy node in the given graphExec to copy from a symbol on the device.
Parameters
hGraphExec
- The executable graph in which to set the specified node
node
- Memcpy node from the graph which was used to instantiate graphExec
|
429
Modules
dst
- Destination memory address
symbol
- Device symbol address
count
- Size in bytes to copy
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
Returns
cudaSuccess, cudaErrorInvalidValue
Description
Updates the work represented by node in hGraphExec as though node had contained the given
params at instantiation. node must remain in the graph which was used to instantiate hGraphExec.
Changed edges to and from node are ignored.
symbol and dst must be allocated from the same contexts as the original source and destination
memory. The instantiation-time memory operands must be 1-dimensional. Zero-length operations are
not supported.
The modifications only affect future launches of hGraphExec. Already enqueued or running
launches of hGraphExec are not affected by this call. node is also not modified by this call.
Returns cudaErrorInvalidValue if the memory operands' mappings changed or the original memory
operands are multidimensional.
Note:
Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaGraphAddMemcpyNode, cudaGraphAddMemcpyNodeFromSymbol,
cudaGraphMemcpyNodeSetParams, cudaGraphMemcpyNodeSetParamsFromSymbol,
cudaGraphInstantiate, cudaGraphExecMemcpyNodeSetParams,
|
430
Modules
cudaGraphExecMemcpyNodeSetParamsToSymbol, cudaGraphExecKernelNodeSetParams,
cudaGraphExecMemsetNodeSetParams, cudaGraphExecHostNodeSetParams
template < class T > __host__cudaError_t
cudaGraphExecMemcpyNodeSetParamsToSymbol
(cudaGraphExec_t hGraphExec, cudaGraphNode_t node,
const T symbol, const void *src, size_t count, size_t offset,
cudaMemcpyKind kind)
Sets the parameters for a memcpy node in the given graphExec to copy to a symbol on the device.
Parameters
hGraphExec
- The executable graph in which to set the specified node
node
- Memcpy node from the graph which was used to instantiate graphExec
symbol
- Device symbol address
src
- Source memory address
count
- Size in bytes to copy
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
Returns
cudaSuccess, cudaErrorInvalidValue
Description
Updates the work represented by node in hGraphExec as though node had contained the given
params at instantiation. node must remain in the graph which was used to instantiate hGraphExec.
Changed edges to and from node are ignored.
src and symbol must be allocated from the same contexts as the original source and destination
memory. The instantiation-time memory operands must be 1-dimensional. Zero-length operations are
not supported.
The modifications only affect future launches of hGraphExec. Already enqueued or running
launches of hGraphExec are not affected by this call. node is also not modified by this call.
|
431
Modules
Returns cudaErrorInvalidValue if the memory operands' mappings changed or the original memory
operands are multidimensional.
Note:
Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaGraphAddMemcpyNode, cudaGraphAddMemcpyNodeToSymbol,
cudaGraphMemcpyNodeSetParams, cudaGraphMemcpyNodeSetParamsToSymbol,
cudaGraphInstantiate, cudaGraphExecMemcpyNodeSetParams,
cudaGraphExecMemcpyNodeSetParamsFromSymbol, cudaGraphExecKernelNodeSetParams,
cudaGraphExecMemsetNodeSetParams, cudaGraphExecHostNodeSetParams
__host__cudaError_t cudaGraphInstantiate
(cudaGraphExec_t *pGraphExec, cudaGraph_t graph,
cudaGraphNode_t *pErrorNode, char *pLogBuffer, size_t
bufferSize)
Creates an executable graph from a graph.
Parameters
pGraphExec
- Returns instantiated graph
graph
- Graph to instantiate
pErrorNode
- In case of an instantiation error, this may be modified to indicate a node contributing to the error
pLogBuffer
- A character buffer to store diagnostic messages
bufferSize
- Size of the log buffer in bytes
Returns
cudaSuccess, cudaErrorInvalidValue
|
432
Modules
Description
Instantiates graph as an executable graph. The graph is validated for any structural constraints or
intra-node constraints which were not previously validated. If instantiation is successful, a handle to the
instantiated graph is returned in pGraphExec.
If there are any errors, diagnostic information may be returned in pErrorNode and pLogBuffer.
This is the primary way to inspect instantiation errors. The output will be null terminated unless the
diagnostics overflow the buffer. In this case, they will be truncated, and the last byte can be inspected
to determine if truncation occurred.
Note:
Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaGraphInstantiateWithFlags, cudaGraphCreate, cudaGraphUpload, cudaGraphLaunch,
cudaGraphExecDestroy
template < class T > __host__cudaError_t
cudaGraphMemcpyNodeSetParamsFromSymbol
(cudaGraphNode_t node, void *dst, const T symbol, size_t
count, size_t offset, cudaMemcpyKind kind)
Sets a memcpy node's parameters to copy from a symbol on the device.
Parameters
node
- Node to set the parameters for
dst
- Destination memory address
symbol
- Device symbol address
count
- Size in bytes to copy
|
433
Modules
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
Returns
cudaSuccess, cudaErrorInvalidValue
Description
Sets the parameters of memcpy node node to the copy described by the provided parameters.
When the graph is launched, the node will copy count bytes from the memory area pointed to by
offset bytes from the start of symbol symbol to the memory area pointed to by dst. The memory
areas may not overlap. symbol is a variable that resides in global or constant memory space. kind
can be either cudaMemcpyDeviceToHost, cudaMemcpyDeviceToDevice, or cudaMemcpyDefault.
Passing cudaMemcpyDefault is recommended, in which case the type of transfer is inferred from the
pointer values. However, cudaMemcpyDefault is only allowed on systems that support unified virtual
addressing.
Note:
Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaMemcpyFromSymbol, cudaGraphMemcpyNodeSetParams,
cudaGraphMemcpyNodeSetParamsToSymbol, cudaGraphAddMemcpyNode,
cudaGraphMemcpyNodeGetParams
|
434
Modules
template < class T > __host__cudaError_t
cudaGraphMemcpyNodeSetParamsToSymbol
(cudaGraphNode_t node, const T symbol, const void *src,
size_t count, size_t offset, cudaMemcpyKind kind)
Sets a memcpy node's parameters to copy to a symbol on the device.
Parameters
node
- Node to set the parameters for
symbol
- Device symbol address
src
- Source memory address
count
- Size in bytes to copy
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
Returns
cudaSuccess, cudaErrorInvalidValue
Description
Sets the parameters of memcpy node node to the copy described by the provided parameters.
When the graph is launched, the node will copy count bytes from the memory area pointed to by
src to the memory area pointed to by offset bytes from the start of symbol symbol. The memory
areas may not overlap. symbol is a variable that resides in global or constant memory space. kind
can be either cudaMemcpyHostToDevice, cudaMemcpyDeviceToDevice, or cudaMemcpyDefault.
Passing cudaMemcpyDefault is recommended, in which case the type of transfer is inferred from the
pointer values. However, cudaMemcpyDefault is only allowed on systems that support unified virtual
addressing.
Note:
Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
|
435
Modules
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaMemcpyToSymbol, cudaGraphMemcpyNodeSetParams,
cudaGraphMemcpyNodeSetParamsFromSymbol, cudaGraphAddMemcpyNode,
cudaGraphMemcpyNodeGetParams
template < class T > __host__cudaError_t
cudaLaunchCooperativeKernel (T *func, dim3 gridDim,
dim3 blockDim, void **args, size_t sharedMem,
cudaStream_t stream)
Launches a device function.
Parameters
func
- Device function symbol
gridDim
- Grid dimentions
blockDim
- Block dimentions
args
- Arguments
sharedMem
- Shared memory (defaults to 0)
stream
- Stream identifier (defaults to NULL)
Returns
cudaSuccess, cudaErrorInvalidDeviceFunction, cudaErrorInvalidConfiguration,
cudaErrorLaunchFailure, cudaErrorLaunchTimeout, cudaErrorLaunchOutOfResources,
cudaErrorSharedObjectInitFailed
Description
The function invokes kernel func on gridDim (gridDim.x gridDim.y gridDim.z) grid of
blocks. Each block contains blockDim (blockDim.x blockDim.y blockDim.z) threads.
|
436
Modules
The device on which this kernel is invoked must have a non-zero value for the device attribute
cudaDevAttrCooperativeLaunch.
The total number of blocks launched cannot exceed the maximum number of blocks per
multiprocessor as returned by cudaOccupancyMaxActiveBlocksPerMultiprocessor (or
cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags) times the number of multiprocessors as
specified by the device attribute cudaDevAttrMultiProcessorCount.
The kernel cannot make use of CUDA dynamic parallelism.
If the kernel has N parameters the args should point to array of N pointers. Each pointer, from
args[0] to args[N - 1], point to the region of memory from which the actual parameter will be
copied.
sharedMem sets the amount of dynamic shared memory that will be available to each thread block.
stream specifies a stream the invocation is associated to.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
This function exhibits asynchronous behavior for most use cases.
This function uses standard default stream semantics.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
cudaLaunchCooperativeKernel ( C API)
|
437
Modules
template < class T > __host__cudaError_t
cudaLaunchKernel (T *func, dim3 gridDim, dim3
blockDim, void **args, size_t sharedMem, cudaStream_t
stream)
Launches a device function.
Parameters
func
- Device function symbol
gridDim
- Grid dimentions
blockDim
- Block dimentions
args
- Arguments
sharedMem
- Shared memory (defaults to 0)
stream
- Stream identifier (defaults to NULL)
Returns
cudaSuccess, cudaErrorInvalidDeviceFunction, cudaErrorInvalidConfiguration,
cudaErrorLaunchFailure, cudaErrorLaunchTimeout, cudaErrorLaunchOutOfResources,
cudaErrorSharedObjectInitFailed, cudaErrorInvalidPtx, cudaErrorUnsupportedPtxVersion,
cudaErrorNoKernelImageForDevice, cudaErrorJitCompilerNotFound,
cudaErrorJitCompilationDisabled
Description
The function invokes kernel func on gridDim (gridDim.x gridDim.y gridDim.z) grid of
blocks. Each block contains blockDim (blockDim.x blockDim.y blockDim.z) threads.
If the kernel has N parameters the args should point to array of N pointers. Each pointer, from
args[0] to args[N - 1], point to the region of memory from which the actual parameter will be
copied.
sharedMem sets the amount of dynamic shared memory that will be available to each thread block.
stream specifies a stream the invocation is associated to.
Note:
|
438
Modules
Note that this function may also return error codes from previous, asynchronous launches.
This function exhibits asynchronous behavior for most use cases.
This function uses standard default stream semantics.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
cudaLaunchKernel ( C API)
template < typename... ActTypes > __host__cudaError_t
cudaLaunchKernelEx (const cudaLaunchConfig_t *config,
const cudaKernel_t kernel, ActTypes &&... args)
Launches a CUDA function with launch-time configuration.
Parameters
config
- Launch configuration
kernel
args
- Parameter pack of kernel parameters
Returns
cudaSuccess, cudaErrorInvalidDeviceFunction, cudaErrorInvalidConfiguration,
cudaErrorLaunchFailure, cudaErrorLaunchTimeout, cudaErrorLaunchOutOfResources,
cudaErrorSharedObjectInitFailed, cudaErrorInvalidPtx, cudaErrorUnsupportedPtxVersion,
cudaErrorNoKernelImageForDevice, cudaErrorJitCompilerNotFound,
cudaErrorJitCompilationDisabled
Description
Invokes the kernel kernel on config->gridDim (config->gridDim.x config-
>gridDim.y config->gridDim.z) grid of blocks. Each block contains config->blockDim
(config->blockDim.x config->blockDim.y config->blockDim.z) threads.
|
439
Modules
config->dynamicSmemBytes sets the amount of dynamic shared memory that will be available
to each thread block.
config->stream specifies a stream the invocation is associated to.
Configuration beyond grid and block dimensions, dynamic shared memory size, and stream can be
provided with the following two fields of config:
config->attrs is an array of config->numAttrs contiguous cudaLaunchAttribute elements.
The value of this pointer is not considered if config->numAttrs is zero. However, in that case,
it is recommended to set the pointer to NULL. config->numAttrs is the number of attributes
populating the first config->numAttrs positions of the config->attrs array.
The kernel arguments should be passed as arguments to this function via the args parameter pack.
The C API version of this function, cudaLaunchKernelExC, is also available for pre-C++11
compilers and for use cases where the ability to pass kernel parameters via void* array is preferable.
Note:
This function uses standard default stream semantics.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaLaunchKernelEx ( C API), cuLaunchKernelEx
template < typename... ExpTypes, typename... ActTypes
> __host__cudaError_t cudaLaunchKernelEx (const
cudaLaunchConfig_t *config, void(*)(ExpTypes...) kernel,
ActTypes &&... args)
Launches a CUDA function with launch-time configuration.
Parameters
config
- Launch configuration
kernel
- Kernel to launch
|
440
Modules
args
- Parameter pack of kernel parameters
Returns
cudaSuccess, cudaErrorInvalidDeviceFunction, cudaErrorInvalidConfiguration,
cudaErrorLaunchFailure, cudaErrorLaunchTimeout, cudaErrorLaunchOutOfResources,
cudaErrorSharedObjectInitFailed, cudaErrorInvalidPtx, cudaErrorUnsupportedPtxVersion,
cudaErrorNoKernelImageForDevice, cudaErrorJitCompilerNotFound,
cudaErrorJitCompilationDisabled
Description
Invokes the kernel kernel on config->gridDim (config->gridDim.x config-
>gridDim.y config->gridDim.z) grid of blocks. Each block contains config->blockDim
(config->blockDim.x config->blockDim.y config->blockDim.z) threads.
config->dynamicSmemBytes sets the amount of dynamic shared memory that will be available
to each thread block.
config->stream specifies a stream the invocation is associated to.
Configuration beyond grid and block dimensions, dynamic shared memory size, and stream can be
provided with the following two fields of config:
config->attrs is an array of config->numAttrs contiguous cudaLaunchAttribute elements.
The value of this pointer is not considered if config->numAttrs is zero. However, in that case,
it is recommended to set the pointer to NULL. config->numAttrs is the number of attributes
populating the first config->numAttrs positions of the config->attrs array.
The kernel arguments should be passed as arguments to this function via the args parameter pack.
The C API version of this function, cudaLaunchKernelExC, is also available for pre-C++11
compilers and for use cases where the ability to pass kernel parameters via void* array is preferable.
Note:
This function uses standard default stream semantics.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
|
441
Modules
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
See also:
cudaLaunchKernelEx ( C API), cuLaunchKernelEx
template < class T > __host__cudaError_t
cudaLibraryGetGlobal (T **dptr, size_t *bytes,
cudaLibrary_t library, const char *name)
Returns a global device pointer.
Parameters
dptr
- Returned global device pointer for the requested library
bytes
- Returned global size in bytes
library
- Library to retrieve global from
name
- Name of global to retrieve
Returns
cudaSuccess, cudaErrorCudartUnloading, cudaErrorInitializationError, cudaErrorInvalidValue,
cudaErrorInvalidResourceHandle, cudaErrorSymbolNotFound cudaErrorDeviceUninitialized,
cudaErrorContextIsDestroyed
Description
Returns in *dptr and *bytes the base pointer and size of the global with name name for the
requested library library and the current device. If no global for the requested name name exists,
the call returns cudaErrorSymbolNotFound. One of the parameters dptr or bytes (not both) can be
NULL in which case it is ignored.
See also:
cudaLibraryLoadData, cudaLibraryLoadFromFile, cudaLibraryUnload, cudaLibraryGetManaged
|
442
Modules
template < class T > __host__cudaError_t
cudaLibraryGetManaged (T **dptr, size_t *bytes,
cudaLibrary_t library, const char *name)
Returns a pointer to managed memory.
Parameters
dptr
- Returned pointer to the managed memory
bytes
- Returned memory size in bytes
library
- Library to retrieve managed memory from
name
- Name of managed memory to retrieve
Returns
cudaSuccess, cudaErrorCudartUnloading, cudaErrorInitializationError, cudaErrorInvalidValue,
cudaErrorInvalidResourceHandle, cudaErrorSymbolNotFound
Description
Returns in *dptr and *bytes the base pointer and size of the managed memory with name name for
the requested library library. If no managed memory with the requested name name exists, the call
returns cudaErrorSymbolNotFound. One of the parameters dptr or bytes (not both) can be NULL in
which case it is ignored. Note that managed memory for library library is shared across devices and
is registered when the library is loaded.
See also:
cudaLibraryLoadData, cudaLibraryLoadFromFile, cudaLibraryUnload, cudaLibraryGetGlobal
template < class T > __host__cudaError_t
cudaLibraryGetUnifiedFunction (T **fptr, cudaLibrary_t
library, const char *symbol)
Returns a pointer to a unified function.
Parameters
fptr
- Returned pointer to a unified function
|
443
Modules
library
- Library to retrieve function pointer memory from
symbol
- Name of function pointer to retrieve
Returns
cudaSuccess, cudaErrorCudartUnloading, cudaErrorInitializationError, cudaErrorInvalidValue,
cudaErrorInvalidResourceHandle, cudaErrorSymbolNotFound
Description
Returns in *fptr the function pointer to a unified function denoted by symbol. If no unified
function with name symbol exists, the call returns cudaErrorSymbolNotFound. If there is no device
with attribute cudaDeviceProp::unifiedFunctionPointers present in the system, the call may return
cudaErrorSymbolNotFound.
See also:
cudaLibraryLoadData, cudaLibraryLoadFromFile, cudaLibraryUnload
__host__cudaError_t cudaMallocAsync (void **ptr, size_t
size, cudaMemPool_t memPool, cudaStream_t stream)
Allocate from a pool.
Description
This is an alternate spelling for cudaMallocFromPoolAsync made available through function
overloading.
See also:
cudaMallocFromPoolAsync, cudaMallocAsync ( C API)
__host__cudaError_t cudaMallocHost (void **ptr, size_t
size, unsigned int flags)
[C++ API] Allocates page-locked memory on the host
Parameters
ptr
- Device pointer to allocated memory
size
- Requested allocation size in bytes
|
444
Modules
flags
- Requested properties of allocated memory
Returns
cudaSuccess, cudaErrorMemoryAllocation
Description
Allocates size bytes of host memory that is page-locked and accessible to the device. The driver
tracks the virtual memory ranges allocated with this function and automatically accelerates calls to
functions such as cudaMemcpy(). Since the memory can be accessed directly by the device, it can be
read or written with much higher bandwidth than pageable memory obtained with functions such as
malloc(). Allocating excessive amounts of pinned memory may degrade system performance, since it
reduces the amount of memory available to the system for paging. As a result, this function is best used
sparingly to allocate staging areas for data exchange between host and device.
The flags parameter enables different options to be specified that affect the allocation, as follows.
cudaHostAllocDefault: This flag's value is defined to be 0.
cudaHostAllocPortable: The memory returned by this call will be considered as pinned memory by
all CUDA contexts, not just the one that performed the allocation.
cudaHostAllocMapped: Maps the allocation into the CUDA address space. The device pointer to
the memory may be obtained by calling cudaHostGetDevicePointer().
cudaHostAllocWriteCombined: Allocates the memory as write-combined (WC). WC memory can
be transferred across the PCI Express bus more quickly on some system configurations, but cannot
be read efficiently by most CPUs. WC memory is a good option for buffers that will be written by
the CPU and read by the device via mapped pinned memory or host->device transfers.
All of these flags are orthogonal to one another: a developer may allocate memory that is portable,
mapped and/or write-combined with no restrictions.
cudaSetDeviceFlags() must have been called with the cudaDeviceMapHost flag in order for the
cudaHostAllocMapped flag to have any effect.
The cudaHostAllocMapped flag may be specified on CUDA contexts for devices that do not support
mapped pinned memory. The failure is deferred to cudaHostGetDevicePointer() because the memory
may be mapped into other CUDA contexts via the cudaHostAllocPortable flag.
Memory allocated by this function must be freed with cudaFreeHost().
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
|
445
Modules
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaSetDeviceFlags, cudaMallocHost ( C API), cudaFreeHost, cudaHostAlloc
template < class T > __host__cudaError_t
cudaMallocManaged (T **devPtr, size_t size, unsigned int
flags)
Allocates memory that will be automatically managed by the Unified Memory system.
Parameters
devPtr
- Pointer to allocated device memory
size
- Requested allocation size in bytes
flags
- Must be either cudaMemAttachGlobal or cudaMemAttachHost (defaults to
cudaMemAttachGlobal)
Returns
cudaSuccess, cudaErrorMemoryAllocation, cudaErrorNotSupported, cudaErrorInvalidValue
Description
Allocates size bytes of managed memory on the device and returns in *devPtr a
pointer to the allocated memory. If the device doesn't support allocating managed memory,
cudaErrorNotSupported is returned. Support for managed memory can be queried using the
device attribute cudaDevAttrManagedMemory. The allocated memory is suitably aligned for
any kind of variable. The memory is not cleared. If size is 0, cudaMallocManaged returns
cudaErrorInvalidValue. The pointer is valid on the CPU and on all GPUs in the system that support
managed memory. All accesses to this pointer must obey the Unified Memory programming model.
flags specifies the default stream association for this allocation. flags must be
one of cudaMemAttachGlobal or cudaMemAttachHost. The default value for flags
is cudaMemAttachGlobal. If cudaMemAttachGlobal is specified, then this memory is
accessible from any stream on any device. If cudaMemAttachHost is specified, then the
allocation should not be accessed from devices that have a zero value for the device attribute
cudaDevAttrConcurrentManagedAccess; an explicit call to cudaStreamAttachMemAsync will be
required to enable access on such devices.
|
446
Modules
If the association is later changed via cudaStreamAttachMemAsync to a single stream, the default
association, as specifed during cudaMallocManaged, is restored when that stream is destroyed. For
__managed__ variables, the default association is always cudaMemAttachGlobal. Note that destroying
a stream is an asynchronous operation, and as a result, the change to default association won't happen
until all work in the stream has completed.
Memory allocated with cudaMallocManaged should be released with cudaFree.
Device memory oversubscription is possible for GPUs that have a non-zero value for the device
attribute cudaDevAttrConcurrentManagedAccess. Managed memory on such GPUs may be evicted
from device memory to host memory at any time by the Unified Memory driver in order to make room
for other allocations.
In a multi-GPU system where all GPUs have a non-zero value for the device attribute
cudaDevAttrConcurrentManagedAccess, managed memory may not be populated when this API
returns and instead may be populated on access. In such systems, managed memory can migrate to any
processor's memory at any time. The Unified Memory driver will employ heuristics to maintain data
locality and prevent excessive page faults to the extent possible. The application can also guide the
driver about memory usage patterns via cudaMemAdvise. The application can also explicitly migrate
memory to a desired processor's memory via cudaMemPrefetchAsync.
In a multi-GPU system where all of the GPUs have a zero value for the device attribute
cudaDevAttrConcurrentManagedAccess and all the GPUs have peer-to-peer support with each
other, the physical storage for managed memory is created on the GPU which is active at the time
cudaMallocManaged is called. All other GPUs will reference the data at reduced bandwidth via peer
mappings over the PCIe bus. The Unified Memory driver does not migrate memory among such GPUs.
In a multi-GPU system where not all GPUs have peer-to-peer support with each other and where the
value of the device attribute cudaDevAttrConcurrentManagedAccess is zero for at least one of those
GPUs, the location chosen for physical storage of managed memory is system-dependent.
On Linux, the location chosen will be device memory as long as the current set of active contexts
are on devices that either have peer-to-peer support with each other or have a non-zero value for
the device attribute cudaDevAttrConcurrentManagedAccess. If there is an active context on a
GPU that does not have a non-zero value for that device attribute and it does not have peer-to-peer
support with the other devices that have active contexts on them, then the location for physical
storage will be 'zero-copy' or host memory. Note that this means that managed memory that is
located in device memory is migrated to host memory if a new context is created on a GPU that
doesn't have a non-zero value for the device attribute and does not support peer-to-peer with at
least one of the other devices that has an active context. This in turn implies that context creation
may fail if there is insufficient host memory to migrate all managed allocations.
On Windows, the physical storage is always created in 'zero-copy' or host memory. All GPUs
will reference the data at reduced bandwidth over the PCIe bus. In these circumstances, use
of the environment variable CUDA_VISIBLE_DEVICES is recommended to restrict CUDA
to only use those GPUs that have peer-to-peer support. Alternatively, users can also set
CUDA_MANAGED_FORCE_DEVICE_ALLOC to a non-zero value to force the driver to
always use device memory for physical storage. When this environment variable is set to a non-
|
447
Modules
zero value, all devices used in that process that support managed memory have to be peer-to-
peer compatible with each other. The error cudaErrorInvalidDevice will be returned if a device
that supports managed memory is used and it is not peer-to-peer compatible with any of the
other managed memory supporting devices that were previously used in that process, even if
cudaDeviceReset has been called on those devices. These environment variables are described in
the CUDA programming guide under the "CUDA environment variables" section.
On ARM, managed memory is not available on discrete gpu with Drive PX-2.
Note:
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaMallocPitch, cudaFree, cudaMallocArray, cudaFreeArray, cudaMalloc3D, cudaMalloc3DArray,
cudaMallocHost ( C API), cudaFreeHost, cudaHostAlloc, cudaDeviceGetAttribute,
cudaStreamAttachMemAsync
template < class T > cudaError_t cudaMemAdvise
(T *devPtr, size_t count, cudaMemoryAdvise advice,
cudaMemLocation location)
Advise about the usage of a given memory range.
Description
This is an alternate spelling for cudaMemAdvise made available through function overloading.
See also:
cudaMemAdvise, cudaMemAdvise (C API)
|
448
Modules
template < typename T, typename U >
__host__cudaError_t cudaMemcpyBatchAsync
(T **dsts, U **srcs, size_t *sizes, size_t count,
cudaMemcpyAttributes attr, size_t *failIdx, cudaStream_t
hStream)
Performs a batch of memory copies asynchronously.
Description
This is an alternate spelling for cudaMemcpyBatchAsync made available through function overloading.
The cudaMemcpyAttributes specified by attr are applicable for all the copies specified in the batch.
See also:
cudaMemcpyBatchAsync
template < typename T, typename U >
__host__cudaError_t cudaMemcpyBatchAsync
(T **dsts, U **srcs, size_t *sizes, size_t count,
cudaMemcpyAttributes *attrs, size_t *attrsIdxs, size_t
numAttrs, size_t *failIdx, cudaStream_t hStream)
Performs a batch of memory copies asynchronously.
Description
This is an alternate spelling for cudaMemcpyBatchAsync made available through function overloading.
See also:
cudaMemcpyBatchAsync
|
449
Modules
template < class T > __host__cudaError_t
cudaMemcpyFromSymbol (void *dst, const T symbol,
size_t count, size_t offset, cudaMemcpyKind kind)
[C++ API] Copies data from the given symbol on the device
Parameters
dst
- Destination memory address
symbol
- Device symbol reference
count
- Size in bytes to copy
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
Returns
cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidSymbol, cudaErrorInvalidMemcpyDirection,
cudaErrorNoKernelImageForDevice
Description
Copies count bytes from the memory area offset bytes from the start of symbol symbol to
the memory area pointed to by dst. The memory areas may not overlap. symbol is a variable
that resides in global or constant memory space. kind can be either cudaMemcpyDeviceToHost or
cudaMemcpyDeviceToDevice.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
This function exhibits synchronous behavior for most use cases.
Use of a string naming a variable as the symbol parameter was deprecated in CUDA 4.1 and
removed in CUDA 5.0.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
|
450
Modules
cudaMemcpy, cudaMemcpy2D, cudaMemcpy2DToArray, cudaMemcpy2DFromArray,
cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol, cudaMemcpyAsync, cudaMemcpy2DAsync,
cudaMemcpy2DToArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync,
cudaMemcpyFromSymbolAsync
template < class T > __host__cudaError_t
cudaMemcpyFromSymbolAsync (void *dst, const T
symbol, size_t count, size_t offset, cudaMemcpyKind kind,
cudaStream_t stream)
[C++ API] Copies data from the given symbol on the device
Parameters
dst
- Destination memory address
symbol
- Device symbol reference
count
- Size in bytes to copy
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
stream
- Stream identifier
Returns
cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidSymbol, cudaErrorInvalidMemcpyDirection,
cudaErrorNoKernelImageForDevice
Description
Copies count bytes from the memory area offset bytes from the start of symbol symbol to
the memory area pointed to by dst. The memory areas may not overlap. symbol is a variable
that resides in global or constant memory space. kind can be either cudaMemcpyDeviceToHost or
cudaMemcpyDeviceToDevice.
cudaMemcpyFromSymbolAsync() is asynchronous with respect to the host, so the call may return
before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero
stream argument. If kind is cudaMemcpyDeviceToHost and stream is non-zero, the copy may
overlap with operations in other streams.
|
451
Modules
Note:
Note that this function may also return error codes from previous, asynchronous launches.
This function exhibits asynchronous behavior for most use cases.
Use of a string naming a variable as the symbol parameter was deprecated in CUDA 4.1 and
removed in CUDA 5.0.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaMemcpy, cudaMemcpy2D, cudaMemcpy2DToArray, cudaMemcpy2DFromArray,
cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol, cudaMemcpyFromSymbol,
cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpy2DToArrayAsync,
cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync
template < class T > __host__cudaError_t
cudaMemcpyToSymbol (const T symbol, const void *src,
size_t count, size_t offset, cudaMemcpyKind kind)
[C++ API] Copies data to the given symbol on the device
Parameters
symbol
- Device symbol reference
src
- Source memory address
count
- Size in bytes to copy
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
Returns
cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidSymbol, cudaErrorInvalidMemcpyDirection,
cudaErrorNoKernelImageForDevice
|
452
Modules
Description
Copies count bytes from the memory area pointed to by src to the memory area offset bytes
from the start of symbol symbol. The memory areas may not overlap. symbol is a variable that
resides in global or constant memory space. kind can be either cudaMemcpyHostToDevice or
cudaMemcpyDeviceToDevice.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
This function exhibits synchronous behavior for most use cases.
Use of a string naming a variable as the symbol parameter was deprecated in CUDA 4.1 and
removed in CUDA 5.0.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaMemcpy, cudaMemcpy2D, cudaMemcpy2DToArray, cudaMemcpy2DFromArray,
cudaMemcpy2DArrayToArray, cudaMemcpyFromSymbol, cudaMemcpyAsync,
cudaMemcpy2DAsync, cudaMemcpy2DToArrayAsync, cudaMemcpy2DFromArrayAsync,
cudaMemcpyToSymbolAsync, cudaMemcpyFromSymbolAsync
template < class T > __host__cudaError_t
cudaMemcpyToSymbolAsync (const T symbol, const void
*src, size_t count, size_t offset, cudaMemcpyKind kind,
cudaStream_t stream)
[C++ API] Copies data to the given symbol on the device
Parameters
symbol
- Device symbol reference
src
- Source memory address
count
- Size in bytes to copy
|
453
Modules
offset
- Offset from start of symbol in bytes
kind
- Type of transfer
stream
- Stream identifier
Returns
cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidSymbol, cudaErrorInvalidMemcpyDirection,
cudaErrorNoKernelImageForDevice
Description
Copies count bytes from the memory area pointed to by src to the memory area offset bytes
from the start of symbol symbol. The memory areas may not overlap. symbol is a variable that
resides in global or constant memory space. kind can be either cudaMemcpyHostToDevice or
cudaMemcpyDeviceToDevice.
cudaMemcpyToSymbolAsync() is asynchronous with respect to the host, so the call may return before
the copy is complete. The copy can optionally be associated to a stream by passing a non-zero stream
argument. If kind is cudaMemcpyHostToDevice and stream is non-zero, the copy may overlap with
operations in other streams.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
This function exhibits asynchronous behavior for most use cases.
Use of a string naming a variable as the symbol parameter was deprecated in CUDA 4.1 and
removed in CUDA 5.0.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaMemcpy, cudaMemcpy2D, cudaMemcpy2DToArray, cudaMemcpy2DFromArray,
cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol, cudaMemcpyFromSymbol,
cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpy2DToArrayAsync,
cudaMemcpy2DFromArrayAsync, cudaMemcpyFromSymbolAsync
|
454
Modules
template < class T > __host__cudaError_t
cudaOccupancyAvailableDynamicSMemPerBlock
(size_t *dynamicSmemSize, T *func, int numBlocks, int
blockSize)
Returns dynamic shared memory available per block when launching numBlocks blocks on SM.
Parameters
dynamicSmemSize
- Returned maximum dynamic shared memory
func
- Kernel function for which occupancy is calculated
numBlocks
- Number of blocks to fit on SM
blockSize
- Size of the block
Returns
cudaSuccess, cudaErrorInvalidDevice, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue,
cudaErrorUnknown,
Description
Returns in *dynamicSmemSize the maximum size of dynamic shared memory to allow
numBlocks blocks per SM.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
|
455
Modules
See also:
cudaOccupancyMaxPotentialBlockSize
cudaOccupancyMaxPotentialBlockSizeWithFlags
cudaOccupancyMaxActiveBlocksPerMultiprocessor
cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
cudaOccupancyMaxPotentialBlockSizeVariableSMem
cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags
template < class T > __host__cudaError_t
cudaOccupancyMaxActiveBlocksPerMultiprocessor
(int *numBlocks, T func, int blockSize, size_t
dynamicSMemSize)
Returns occupancy for a device function.
Parameters
numBlocks
- Returned occupancy
func
- Kernel function for which occupancy is calulated
blockSize
- Block size the kernel is intended to be launched with
dynamicSMemSize
- Per-block dynamic shared memory usage intended, in bytes
Returns
cudaSuccess, cudaErrorInvalidDevice, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue,
cudaErrorUnknown,
Description
Returns in *numBlocks the maximum number of active blocks per streaming multiprocessor for the
device function.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
|
456
Modules
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
See also:
cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
cudaOccupancyMaxPotentialBlockSize
cudaOccupancyMaxPotentialBlockSizeWithFlags
cudaOccupancyMaxPotentialBlockSizeVariableSMem
cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags
cudaOccupancyAvailableDynamicSMemPerBlock
template < class T > __host__cudaError_t
cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
(int *numBlocks, T func, int blockSize, size_t
dynamicSMemSize, unsigned int flags)
Returns occupancy for a device function with the specified flags.
Parameters
numBlocks
- Returned occupancy
func
- Kernel function for which occupancy is calulated
blockSize
- Block size the kernel is intended to be launched with
dynamicSMemSize
- Per-block dynamic shared memory usage intended, in bytes
flags
- Requested behavior for the occupancy calculator
Returns
cudaSuccess, cudaErrorInvalidDevice, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue,
cudaErrorUnknown,
|
457
Modules
Description
Returns in *numBlocks the maximum number of active blocks per streaming multiprocessor for the
device function.
The flags parameter controls how special cases are handled. Valid flags include:
cudaOccupancyDefault: keeps the default behavior as
cudaOccupancyMaxActiveBlocksPerMultiprocessor
cudaOccupancyDisableCachingOverride: suppresses the default behavior on platform where global
caching affects occupancy. On such platforms, if caching is enabled, but per-block SM resource
usage would result in zero occupancy, the occupancy calculator will calculate the occupancy as
if caching is disabled. Setting this flag makes the occupancy calculator to return 0 in such cases.
More information can be found about this feature in the "Unified L1/Texture Cache" section of the
Maxwell tuning guide.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
See also:
cudaOccupancyMaxActiveBlocksPerMultiprocessor
cudaOccupancyMaxPotentialBlockSize
cudaOccupancyMaxPotentialBlockSizeWithFlags
cudaOccupancyMaxPotentialBlockSizeVariableSMem
cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags
cudaOccupancyAvailableDynamicSMemPerBlock
|
458
Modules
template < class T > __host__cudaError_t
cudaOccupancyMaxActiveClusters (int *numClusters, T
*func, const cudaLaunchConfig_t *config)
Given the kernel function (func) and launch configuration (config), return the maximum number of
clusters that could co-exist on the target device in *numClusters.
Parameters
numClusters
- Returned maximum number of clusters that could co-exist on the target device
func
- Kernel function for which maximum number of clusters are calculated
config
- Launch configuration for the given kernel function
Returns
cudaSuccess, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue, cudaErrorInvalidClusterSize,
cudaErrorUnknown,
Description
If the function has required cluster size already set (see cudaFuncGetAttributes), the cluster size from
config must either be unspecified or match the required size. Without required sizes, the cluster size
must be specified in config, else the function will return an error.
Note that various attributes of the kernel function may affect occupancy calculation. Runtime
environment may affect how the hardware schedules the clusters, so the calculated occupancy is not
guaranteed to be achievable.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
|
459
Modules
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
See also:
cudaFuncGetAttributes
template < class T > __host__cudaError_t
cudaOccupancyMaxPotentialBlockSize (int *minGridSize,
int *blockSize, T func, size_t dynamicSMemSize, int
blockSizeLimit)
Returns grid and block size that achieves maximum potential occupancy for a device function.
Parameters
minGridSize
- Returned minimum grid size needed to achieve the best potential occupancy
blockSize
- Returned block size
func
- Device function symbol
dynamicSMemSize
- Per-block dynamic shared memory usage intended, in bytes
blockSizeLimit
- The maximum block size func is designed to work with. 0 means no limit.
Returns
cudaSuccess, cudaErrorInvalidDevice, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue,
cudaErrorUnknown,
Description
Returns in *minGridSize and *blocksize a suggested grid / block size pair that achieves the
best potential occupancy (i.e. the maximum number of active warps with the smallest number of
blocks).
Use
See also:
cudaOccupancyMaxPotentialBlockSizeVariableSMem if the amount of per-block dynamic shared
memory changes with different block sizes.
|
460
Modules
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaOccupancyMaxPotentialBlockSizeWithFlags
cudaOccupancyMaxActiveBlocksPerMultiprocessor
cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
cudaOccupancyMaxPotentialBlockSizeVariableSMem
cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags
cudaOccupancyAvailableDynamicSMemPerBlock
template < typename UnaryFunction, class T >
__host__cudaError_t
cudaOccupancyMaxPotentialBlockSizeVariableSMem
(int *minGridSize, int *blockSize, T func, UnaryFunction
blockSizeToDynamicSMemSize, int blockSizeLimit)
Returns grid and block size that achieves maximum potential occupancy for a device function.
Parameters
minGridSize
- Returned minimum grid size needed to achieve the best potential occupancy
blockSize
- Returned block size
func
- Device function symbol
blockSizeToDynamicSMemSize
- A unary function / functor that takes block size, and returns the size, in bytes, of dynamic shared
memory needed for a block
blockSizeLimit
- The maximum block size func is designed to work with. 0 means no limit.
|
461
Modules
Returns
cudaSuccess, cudaErrorInvalidDevice, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue,
cudaErrorUnknown,
Description
Returns in *minGridSize and *blocksize a suggested grid / block size pair that achieves the
best potential occupancy (i.e. the maximum number of active warps with the smallest number of
blocks).
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags
cudaOccupancyMaxActiveBlocksPerMultiprocessor
cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
cudaOccupancyMaxPotentialBlockSize
cudaOccupancyMaxPotentialBlockSizeWithFlags
cudaOccupancyAvailableDynamicSMemPerBlock
|
462
Modules
template < typename UnaryFunction, class T >
__host__cudaError_t
cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags
(int *minGridSize, int *blockSize, T func, UnaryFunction
blockSizeToDynamicSMemSize, int blockSizeLimit,
unsigned int flags)
Returns grid and block size that achieves maximum potential occupancy for a device function.
Parameters
minGridSize
- Returned minimum grid size needed to achieve the best potential occupancy
blockSize
- Returned block size
func
- Device function symbol
blockSizeToDynamicSMemSize
- A unary function / functor that takes block size, and returns the size, in bytes, of dynamic shared
memory needed for a block
blockSizeLimit
- The maximum block size func is designed to work with. 0 means no limit.
flags
- Requested behavior for the occupancy calculator
Returns
cudaSuccess, cudaErrorInvalidDevice, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue,
cudaErrorUnknown,
Description
Returns in *minGridSize and *blocksize a suggested grid / block size pair that achieves the
best potential occupancy (i.e. the maximum number of active warps with the smallest number of
blocks).
The flags parameter controls how special cases are handled. Valid flags include:
cudaOccupancyDefault: keeps the default behavior as
cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags
cudaOccupancyDisableCachingOverride: This flag suppresses the default behavior on platform
where global caching affects occupancy. On such platforms, if caching is enabled, but per-block
SM resource usage would result in zero occupancy, the occupancy calculator will calculate the
|
463
Modules
occupancy as if caching is disabled. Setting this flag makes the occupancy calculator to return 0 in
such cases. More information can be found about this feature in the "Unified L1/Texture Cache"
section of the Maxwell tuning guide.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaOccupancyMaxPotentialBlockSizeVariableSMem
cudaOccupancyMaxActiveBlocksPerMultiprocessor
cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
cudaOccupancyMaxPotentialBlockSize
cudaOccupancyMaxPotentialBlockSizeWithFlags
cudaOccupancyAvailableDynamicSMemPerBlock
template < class T > __host__cudaError_t
cudaOccupancyMaxPotentialBlockSizeWithFlags
(int *minGridSize, int *blockSize, T func, size_t
dynamicSMemSize, int blockSizeLimit, unsigned int flags)
Returns grid and block size that achived maximum potential occupancy for a device function with the
specified flags.
Parameters
minGridSize
- Returned minimum grid size needed to achieve the best potential occupancy
blockSize
- Returned block size
func
- Device function symbol
dynamicSMemSize
- Per-block dynamic shared memory usage intended, in bytes
|
464
Modules
blockSizeLimit
- The maximum block size func is designed to work with. 0 means no limit.
flags
- Requested behavior for the occupancy calculator
Returns
cudaSuccess, cudaErrorInvalidDevice, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue,
cudaErrorUnknown,
Description
Returns in *minGridSize and *blocksize a suggested grid / block size pair that achieves the
best potential occupancy (i.e. the maximum number of active warps with the smallest number of
blocks).
The flags parameter controls how special cases are handle. Valid flags include:
cudaOccupancyDefault: keeps the default behavior as cudaOccupancyMaxPotentialBlockSize
cudaOccupancyDisableCachingOverride: This flag suppresses the default behavior on platform
where global caching affects occupancy. On such platforms, if caching is enabled, but per-block
SM resource usage would result in zero occupancy, the occupancy calculator will calculate the
occupancy as if caching is disabled. Setting this flag makes the occupancy calculator to return 0 in
such cases. More information can be found about this feature in the "Unified L1/Texture Cache"
section of the Maxwell tuning guide.
Use
See also:
cudaOccupancyMaxPotentialBlockSizeVariableSMem if the amount of per-block dynamic shared
memory changes with different block sizes.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaOccupancyMaxPotentialBlockSize
cudaOccupancyMaxActiveBlocksPerMultiprocessor
cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
|
465
Modules
cudaOccupancyMaxPotentialBlockSizeVariableSMem
cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags
cudaOccupancyAvailableDynamicSMemPerBlock
template < class T > __host__cudaError_t
cudaOccupancyMaxPotentialClusterSize (int *clusterSize,
T *func, const cudaLaunchConfig_t *config)
Given the kernel function (func) and launch configuration (config), return the maximum cluster
size in *clusterSize.
Parameters
clusterSize
- Returned maximum cluster size that can be launched for the given kernel function and launch
configuration
func
- Kernel function for which maximum cluster size is calculated
config
- Launch configuration for the given kernel function
Returns
cudaSuccess, cudaErrorInvalidDeviceFunction, cudaErrorInvalidValue, cudaErrorUnknown,
Description
The cluster dimensions in config are ignored. If func has a required cluster size set (see
cudaFuncGetAttributes),*clusterSize will reflect the required cluster size.
By default this function will always return a value that's portable on future hardware. A higher value
may be returned if the kernel function allows non-portable cluster sizes.
This function will respect the compile time launch bounds.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
The API can also be used with a kernel cudaKernel_t by querying the handle using
cudaLibraryGetKernel() or cudaGetKernel and then passing it to the API by casting to void*. The
|
466
Modules
symbol entryFuncAddr passed to cudaGetKernel should be a symbol that is registered with the
same CUDA Runtime instance.
Passing a symbol that belongs that belongs to a different runtime instance will result in undefined
behavior. The only type that can be reliably passed to a different runtime instance is cudaKernel_t
See also:
cudaFuncGetAttributes
template < class T > __host__cudaError_t
cudaStreamAttachMemAsync (cudaStream_t stream, T
*devPtr, size_t length, unsigned int flags)
Attach memory to a stream asynchronously.
Parameters
stream
- Stream in which to enqueue the attach operation
devPtr
- Pointer to memory (must be a pointer to managed memory or to a valid host-accessible region of
system-allocated memory)
length
- Length of memory (defaults to zero)
flags
- Must be one of cudaMemAttachGlobal, cudaMemAttachHost or cudaMemAttachSingle (defaults
to cudaMemAttachSingle)
Returns
cudaSuccess, cudaErrorNotReady, cudaErrorInvalidValue, cudaErrorInvalidResourceHandle
Description
Enqueues an operation in stream to specify stream association of length bytes of memory starting
from devPtr. This function is a stream-ordered operation, meaning that it is dependent on, and
will only take effect when, previous work in stream has completed. Any previous association is
automatically replaced.
devPtr must point to an one of the following types of memories:
managed memory declared using the __managed__ keyword or allocated with
cudaMallocManaged.
a valid host-accessible region of system-allocated pageable memory. This type of memory may
only be specified if the device associated with the stream reports a non-zero value for the device
attribute cudaDevAttrPageableMemoryAccess.
|
467
Modules
For managed allocations, length must be either zero or the entire allocation's size. Both indicate that
the entire allocation's stream association is being changed. Currently, it is not possible to change stream
association for a portion of a managed allocation.
For pageable allocations, length must be non-zero.
The stream association is specified using flags which must be one of cudaMemAttachGlobal,
cudaMemAttachHost or cudaMemAttachSingle. The default value for flags is
cudaMemAttachSingle If the cudaMemAttachGlobal flag is specified, the memory can be accessed
by any stream on any device. If the cudaMemAttachHost flag is specified, the program makes a
guarantee that it won't access the memory on the device from any stream on a device that has a zero
value for the device attribute cudaDevAttrConcurrentManagedAccess. If the cudaMemAttachSingle
flag is specified and stream is associated with a device that has a zero value for the device attribute
cudaDevAttrConcurrentManagedAccess, the program makes a guarantee that it will only access the
memory on the device from stream. It is illegal to attach singly to the NULL stream, because the
NULL stream is a virtual global stream and not a specific stream. An error will be returned in this case.
When memory is associated with a single stream, the Unified Memory system will allow CPU access
to this memory region so long as all operations in stream have completed, regardless of whether
other streams are active. In effect, this constrains exclusive ownership of the managed memory region
by an active GPU to per-stream activity instead of whole-GPU activity.
Accessing memory on the device from streams that are not associated with it will produce undefined
results. No error checking is performed by the Unified Memory system to ensure that kernels launched
into other streams do not access this region.
It is a program's responsibility to order calls to cudaStreamAttachMemAsync via events,
synchronization or other means to ensure legal access to memory at all times. Data visibility and
coherency will be changed appropriately for all kernels which follow a stream-association change.
If stream is destroyed while data is associated with it, the association is removed and the association
reverts to the default visibility of the allocation as specified at cudaMallocManaged. For __managed__
variables, the default association is always cudaMemAttachGlobal. Note that destroying a stream is an
asynchronous operation, and as a result, the change to default association won't happen until all work in
the stream has completed.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaErrorInitializationError, cudaErrorInsufficientDriver or
cudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback.
cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
|
468
Modules
cudaStreamCreate, cudaStreamCreateWithFlags, cudaStreamWaitEvent, cudaStreamSynchronize,
cudaStreamAddCallback, cudaStreamDestroy, cudaMallocManaged
6.34. Interactions with the CUDA Driver API
This section describes the interactions between the CUDA Driver API and the CUDA Runtime API
Primary Contexts
There exists a one to one relationship between CUDA devices in the CUDA Runtime API and
CUcontext s in the CUDA Driver API within a process. The specific context which the CUDA
Runtime API uses for a device is called the device's primary context. From the perspective of the
CUDA Runtime API, a device and its primary context are synonymous.
Initialization and Tear-Down
CUDA Runtime API calls operate on the CUDA Driver API CUcontext which is current to to the
calling host thread.
The function cudaInitDevice() ensures that the primary context is initialized for the requested device
but does not make it current to the calling thread.
The function cudaSetDevice() initializes the primary context for the specified device and makes it
current to the calling thread by calling cuCtxSetCurrent().
The CUDA Runtime API will automatically initialize the primary context for a device at the first
CUDA Runtime API call which requires an active context. If no CUcontext is current to the calling
thread when a CUDA Runtime API call which requires an active context is made, then the primary
context for a device will be selected, made current to the calling thread, and initialized.
The context which the CUDA Runtime API initializes will be initialized using the
parameters specified by the CUDA Runtime API functions cudaSetDeviceFlags(),
cudaD3D9SetDirect3DDevice(), cudaD3D10SetDirect3DDevice(), cudaD3D11SetDirect3DDevice(),
cudaGLSetGLDevice(), and cudaVDPAUSetVDPAUDevice(). Note that these functions will fail with
cudaErrorSetOnActiveProcess if they are called when the primary context for the specified device has
already been initialized, except for cudaSetDeviceFlags() which will simply overwrite the previous
settings.
Primary contexts will remain active until they are explicitly deinitialized using cudaDeviceReset().
The function cudaDeviceReset() will deinitialize the primary context for the calling thread's current
device immediately. The context will remain current to all of the threads that it was current to. The next
CUDA Runtime API call on any thread which requires an active context will trigger the reinitialization
of that device's primary context.
Note that primary contexts are shared resources. It is recommended that the primary context not be
reset except just before exit or to recover from an unspecified launch failure.
Context Interoperability
|
469
Modules
Note that the use of multiple CUcontext s per device within a single process will substantially degrade
performance and is strongly discouraged. Instead, it is highly recommended that the implicit one-to-one
device-to-context mapping for the process provided by the CUDA Runtime API be used.
If a non-primary CUcontext created by the CUDA Driver API is current to a thread then the CUDA
Runtime API calls to that thread will operate on that CUcontext, with some exceptions listed below.
Interoperability between data types is discussed in the following sections.
The function cudaPointerGetAttributes() will return the error cudaErrorIncompatibleDriverContext
if the pointer being queried was allocated by a non-primary context. The function
cudaDeviceEnablePeerAccess() and the rest of the peer access API may not be called when a non-
primary CUcontext is current. To use the pointer query and peer access APIs with a context created
using the CUDA Driver API, it is necessary that the CUDA Driver API be used to access these
features.
All CUDA Runtime API state (e.g, global variables' addresses and values) travels with its underlying
CUcontext. In particular, if a CUcontext is moved from one thread to another then all CUDA Runtime
API state will move to that thread as well.
Please note that attaching to legacy contexts (those with a version of 3010 as
returned by cuCtxGetApiVersion()) is not possible. The CUDA Runtime will return
cudaErrorIncompatibleDriverContext in such cases.
Interactions between CUstream and cudaStream_t
The types CUstream and cudaStream_t are identical and may be used interchangeably.
Interactions between CUevent and cudaEvent_t
The types CUevent and cudaEvent_t are identical and may be used interchangeably.
Interactions between CUarray and cudaArray_t
The types CUarray and struct cudaArray * represent the same data type and may be used
interchangeably by casting the two types between each other.
In order to use a CUarray in a CUDA Runtime API function which takes a struct cudaArray *, it is
necessary to explicitly cast the CUarray to a struct cudaArray *.
In order to use a struct cudaArray * in a CUDA Driver API function which takes a CUarray, it is
necessary to explicitly cast the struct cudaArray * to a CUarray .
Interactions between CUgraphicsResource and cudaGraphicsResource_t
The types CUgraphicsResource and cudaGraphicsResource_t represent the same data type and may be
used interchangeably by casting the two types between each other.
In order to use a CUgraphicsResource in a CUDA Runtime API function which takes a
cudaGraphicsResource_t, it is necessary to explicitly cast the CUgraphicsResource to a
cudaGraphicsResource_t.
|
470
Modules
In order to use a cudaGraphicsResource_t in a CUDA Driver API function which takes a
CUgraphicsResource, it is necessary to explicitly cast the cudaGraphicsResource_t to a
CUgraphicsResource.
Interactions between CUtexObject and cudaTextureObject_t
The types CUtexObject and cudaTextureObject_t represent the same data type and may be used
interchangeably by casting the two types between each other.
In order to use a CUtexObject in a CUDA Runtime API function which takes a cudaTextureObject_t, it
is necessary to explicitly cast the CUtexObject to a cudaTextureObject_t.
In order to use a cudaTextureObject_t in a CUDA Driver API function which takes a CUtexObject, it is
necessary to explicitly cast the cudaTextureObject_t to a CUtexObject.
Interactions between CUsurfObject and cudaSurfaceObject_t
The types CUsurfObject and cudaSurfaceObject_t represent the same data type and may be used
interchangeably by casting the two types between each other.
In order to use a CUsurfObject in a CUDA Runtime API function which takes a cudaSurfaceObject_t,
it is necessary to explicitly cast the CUsurfObject to a cudaSurfaceObject_t.
In order to use a cudaSurfaceObject_t in a CUDA Driver API function which takes a CUsurfObject, it
is necessary to explicitly cast the cudaSurfaceObject_t to a CUsurfObject.
Interactions between CUfunction and cudaFunction_t
The types CUfunction and cudaFunction_t represent the same data type and may be used
interchangeably by casting the two types between each other.
In order to use a cudaFunction_t in a CUDA Driver API function which takes a CUfunction, it is
necessary to explicitly cast the cudaFunction_t to a CUfunction.
Interactions between CUkernel and cudaKernel_t
The types CUkernel and cudaKernel_t represent the same data type and may be used interchangeably
by casting the two types between each other.
In order to use a cudaKernel_t in a CUDA Driver API function which takes a CUkernel, it is necessary
to explicitly cast the cudaKernel_t to a CUkernel.
__host__cudaError_t cudaGetFuncBySymbol
(cudaFunction_t *functionPtr, const void *symbolPtr)
Get pointer to device entry function that matches entry function symbolPtr.
Parameters
functionPtr
- Returns the device entry function
symbolPtr
- Pointer to device entry function to search for
|
471
Modules
Returns
cudaSuccess
Description
Returns in functionPtr the device entry function corresponding to the symbol symbolPtr.
__host__cudaError_t cudaGetKernel (cudaKernel_t
*kernelPtr, const void *entryFuncAddr)
Get pointer to device kernel that matches entry function entryFuncAddr.
Parameters
kernelPtr
- Returns the device kernel
entryFuncAddr
- Address of device entry function to search kernel for
Returns
cudaSuccess
Description
Returns in kernelPtr the device kernel corresponding to the entry function entryFuncAddr.
Note that it is possible that there are multiple symbols belonging to different translation units with the
same entryFuncAddr registered with this CUDA Runtime and so the order which the translation
units are loaded and registered with the CUDA Runtime can lead to differing return pointers in
kernelPtr . Suggested methods of ensuring uniqueness are to limit visibility of __global__ device
functions by using static or hidden visibility attribute in the respective translation units.
See also:
cudaGetKernel (C++ API)
6.35. Profiler Control
This section describes the profiler control functions of the CUDA runtime application programming
interface.
|
472
Modules
__host__cudaError_t cudaProfilerStart (void)
Enable profiling.
Returns
cudaSuccess
Description
Enables profile collection by the active profiling tool for the current context. If profiling is already
enabled, then cudaProfilerStart() has no effect.
cudaProfilerStart and cudaProfilerStop APIs are used to programmatically control the profiling
granularity by allowing profiling to be done only on selective pieces of code.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cudaProfilerStop, cuProfilerStart
__host__cudaError_t cudaProfilerStop (void)
Disable profiling.
Returns
cudaSuccess
Description
Disables profile collection by the active profiling tool for the current context. If profiling is already
disabled, then cudaProfilerStop() has no effect.
cudaProfilerStart and cudaProfilerStop APIs are used to programmatically control the profiling
granularity by allowing profiling to be done only on selective pieces of code.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cudaProfilerStart, cuProfilerStop
|
473
Modules
6.36. Data types used by CUDA Runtime
|
474
Modules
struct cudaAccessPolicyWindow
struct cudaArrayMemoryRequirements
struct cudaArraySparseProperties
struct cudaAsyncNotificationInfo_t
struct cudaChannelFormatDesc
struct cudaChildGraphNodeParams
struct cudaConditionalNodeParams
struct cudaDeviceProp
struct cudaEglFrame
struct cudaEglPlaneDesc
struct cudaEventRecordNodeParams
struct cudaEventWaitNodeParams
struct cudaExtent
struct cudaExternalMemoryBufferDesc
struct cudaExternalMemoryHandleDesc
struct cudaExternalMemoryMipmappedArrayDesc
struct cudaExternalSemaphoreHandleDesc
|
475
Modules
struct cudaExternalSemaphoreSignalNodeParams
struct cudaExternalSemaphoreSignalNodeParamsV2
struct cudaExternalSemaphoreSignalParams
struct cudaExternalSemaphoreSignalParams_v1
struct cudaExternalSemaphoreWaitNodeParams
struct cudaExternalSemaphoreWaitNodeParamsV2
struct cudaExternalSemaphoreWaitParams
struct cudaExternalSemaphoreWaitParams_v1
struct cudaFuncAttributes
struct cudaGraphEdgeData
struct cudaGraphExecUpdateResultInfo
struct cudaGraphInstantiateParams
struct cudaGraphKernelNodeUpdate
struct cudaGraphNodeParams
struct cudaHostNodeParams
struct cudaHostNodeParamsV2
struct cudaIpcEventHandle_t
|
476
Modules
struct cudaIpcMemHandle_t
struct cudaKernelNodeParams
struct cudaKernelNodeParamsV2
struct cudaLaunchAttribute
union cudaLaunchAttributeValue
struct cudaLaunchConfig_t
struct cudaLaunchMemSyncDomainMap
struct cudaLaunchParams
struct cudaMemAccessDesc
struct cudaMemAllocNodeParams
struct cudaMemAllocNodeParamsV2
struct cudaMemcpy3DOperand
struct cudaMemcpy3DParms
struct cudaMemcpy3DPeerParms
struct cudaMemcpyAttributes
struct cudaMemcpyNodeParams
struct cudaMemFreeNodeParams
|
477
Modules
struct cudaMemLocation
struct cudaMemPoolProps
struct cudaMemPoolPtrExportData
struct cudaMemsetParams
struct cudaMemsetParamsV2
struct cudaOffset3D
struct cudaPitchedPtr
struct cudaPointerAttributes
struct cudaPos
struct cudaResourceDesc
struct cudaResourceViewDesc
struct cudaTextureDesc
struct CUuuid_st
enum cudaAccessProperty
Specifies performance hint with cudaAccessPolicyWindow for hitProp and missProp members.
Values
cudaAccessPropertyNormal = 0
Normal cache persistence.
cudaAccessPropertyStreaming = 1
Streaming access is less likely to persit from cache.
cudaAccessPropertyPersisting = 2
|
478
Modules
Persisting access is more likely to persist in cache.
enum cudaAsyncNotificationType
Types of async notification that can occur
Values
cudaAsyncNotificationTypeOverBudget = 0x1
Sent when the process has exceeded its device memory budget
enum cudaCGScope
CUDA cooperative group scope
Values
cudaCGScopeInvalid = 0
Invalid cooperative group scope
cudaCGScopeGrid = 1
Scope represented by a grid_group
cudaCGScopeMultiGrid = 2
Scope represented by a multi_grid_group
enum cudaChannelFormatKind
Channel format kind
Values
cudaChannelFormatKindSigned = 0
Signed channel format
cudaChannelFormatKindUnsigned = 1
Unsigned channel format
cudaChannelFormatKindFloat = 2
Float channel format
cudaChannelFormatKindNone = 3
No channel format
cudaChannelFormatKindNV12 = 4
Unsigned 8-bit integers, planar 4:2:0 YUV format
cudaChannelFormatKindUnsignedNormalized8X1 = 5
1 channel unsigned 8-bit normalized integer
cudaChannelFormatKindUnsignedNormalized8X2 = 6
2 channel unsigned 8-bit normalized integer
cudaChannelFormatKindUnsignedNormalized8X4 = 7
4 channel unsigned 8-bit normalized integer
|
479
Modules
cudaChannelFormatKindUnsignedNormalized16X1 = 8
1 channel unsigned 16-bit normalized integer
cudaChannelFormatKindUnsignedNormalized16X2 = 9
2 channel unsigned 16-bit normalized integer
cudaChannelFormatKindUnsignedNormalized16X4 = 10
4 channel unsigned 16-bit normalized integer
cudaChannelFormatKindSignedNormalized8X1 = 11
1 channel signed 8-bit normalized integer
cudaChannelFormatKindSignedNormalized8X2 = 12
2 channel signed 8-bit normalized integer
cudaChannelFormatKindSignedNormalized8X4 = 13
4 channel signed 8-bit normalized integer
cudaChannelFormatKindSignedNormalized16X1 = 14
1 channel signed 16-bit normalized integer
cudaChannelFormatKindSignedNormalized16X2 = 15
2 channel signed 16-bit normalized integer
cudaChannelFormatKindSignedNormalized16X4 = 16
4 channel signed 16-bit normalized integer
cudaChannelFormatKindUnsignedBlockCompressed1 = 17
4 channel unsigned normalized block-compressed (BC1 compression) format
cudaChannelFormatKindUnsignedBlockCompressed1SRGB = 18
4 channel unsigned normalized block-compressed (BC1 compression) format with sRGB encoding
cudaChannelFormatKindUnsignedBlockCompressed2 = 19
4 channel unsigned normalized block-compressed (BC2 compression) format
cudaChannelFormatKindUnsignedBlockCompressed2SRGB = 20
4 channel unsigned normalized block-compressed (BC2 compression) format with sRGB encoding
cudaChannelFormatKindUnsignedBlockCompressed3 = 21
4 channel unsigned normalized block-compressed (BC3 compression) format
cudaChannelFormatKindUnsignedBlockCompressed3SRGB = 22
4 channel unsigned normalized block-compressed (BC3 compression) format with sRGB encoding
cudaChannelFormatKindUnsignedBlockCompressed4 = 23
1 channel unsigned normalized block-compressed (BC4 compression) format
cudaChannelFormatKindSignedBlockCompressed4 = 24
1 channel signed normalized block-compressed (BC4 compression) format
cudaChannelFormatKindUnsignedBlockCompressed5 = 25
2 channel unsigned normalized block-compressed (BC5 compression) format
cudaChannelFormatKindSignedBlockCompressed5 = 26
2 channel signed normalized block-compressed (BC5 compression) format
cudaChannelFormatKindUnsignedBlockCompressed6H = 27
3 channel unsigned half-float block-compressed (BC6H compression) format
cudaChannelFormatKindSignedBlockCompressed6H = 28
3 channel signed half-float block-compressed (BC6H compression) format
cudaChannelFormatKindUnsignedBlockCompressed7 = 29
|
480
Modules
4 channel unsigned normalized block-compressed (BC7 compression) format
cudaChannelFormatKindUnsignedBlockCompressed7SRGB = 30
4 channel unsigned normalized block-compressed (BC7 compression) format with sRGB encoding
cudaChannelFormatKindUnsignedNormalized1010102 = 31
4 channel unsigned normalized (10-bit, 10-bit, 10-bit, 2-bit) format
enum cudaClusterSchedulingPolicy
Cluster scheduling policies. These may be passed to cudaFuncSetAttribute
Values
cudaClusterSchedulingPolicyDefault = 0
the default policy
cudaClusterSchedulingPolicySpread = 1
spread the blocks within a cluster to the SMs
cudaClusterSchedulingPolicyLoadBalancing = 2
allow the hardware to load-balance the blocks in a cluster to the SMs
enum cudaComputeMode
CUDA device compute modes
Values
cudaComputeModeDefault = 0
Default compute mode (Multiple threads can use cudaSetDevice() with this device)
cudaComputeModeExclusive = 1
Compute-exclusive-thread mode (Only one thread in one process will be able to use
cudaSetDevice() with this device)
cudaComputeModeProhibited = 2
Compute-prohibited mode (No threads can use cudaSetDevice() with this device)
cudaComputeModeExclusiveProcess = 3
Compute-exclusive-process mode (Many threads in one process will be able to use cudaSetDevice()
with this device)
enum cudaDeviceAttr
CUDA device attributes
Values
cudaDevAttrMaxThreadsPerBlock = 1
Maximum number of threads per block
cudaDevAttrMaxBlockDimX = 2
Maximum block dimension X
|
481
Modules
cudaDevAttrMaxBlockDimY = 3
Maximum block dimension Y
cudaDevAttrMaxBlockDimZ = 4
Maximum block dimension Z
cudaDevAttrMaxGridDimX = 5
Maximum grid dimension X
cudaDevAttrMaxGridDimY = 6
Maximum grid dimension Y
cudaDevAttrMaxGridDimZ = 7
Maximum grid dimension Z
cudaDevAttrMaxSharedMemoryPerBlock = 8
Maximum shared memory available per block in bytes
cudaDevAttrTotalConstantMemory = 9
Memory available on device for __constant__ variables in a CUDA C kernel in bytes
cudaDevAttrWarpSize = 10
Warp size in threads
cudaDevAttrMaxPitch = 11
Maximum pitch in bytes allowed by memory copies
cudaDevAttrMaxRegistersPerBlock = 12
Maximum number of 32-bit registers available per block
cudaDevAttrClockRate = 13
Peak clock frequency in kilohertz
cudaDevAttrTextureAlignment = 14
Alignment requirement for textures
cudaDevAttrGpuOverlap = 15
Device can possibly copy memory and execute a kernel concurrently
cudaDevAttrMultiProcessorCount = 16
Number of multiprocessors on device
cudaDevAttrKernelExecTimeout = 17
Specifies whether there is a run time limit on kernels
cudaDevAttrIntegrated = 18
Device is integrated with host memory
cudaDevAttrCanMapHostMemory = 19
Device can map host memory into CUDA address space
cudaDevAttrComputeMode = 20
Compute mode (See cudaComputeMode for details)
cudaDevAttrMaxTexture1DWidth = 21
Maximum 1D texture width
cudaDevAttrMaxTexture2DWidth = 22
Maximum 2D texture width
cudaDevAttrMaxTexture2DHeight = 23
Maximum 2D texture height
cudaDevAttrMaxTexture3DWidth = 24
|
482
Modules
Maximum 3D texture width
cudaDevAttrMaxTexture3DHeight = 25
Maximum 3D texture height
cudaDevAttrMaxTexture3DDepth = 26
Maximum 3D texture depth
cudaDevAttrMaxTexture2DLayeredWidth = 27
Maximum 2D layered texture width
cudaDevAttrMaxTexture2DLayeredHeight = 28
Maximum 2D layered texture height
cudaDevAttrMaxTexture2DLayeredLayers = 29
Maximum layers in a 2D layered texture
cudaDevAttrSurfaceAlignment = 30
Alignment requirement for surfaces
cudaDevAttrConcurrentKernels = 31
Device can possibly execute multiple kernels concurrently
cudaDevAttrEccEnabled = 32
Device has ECC support enabled
cudaDevAttrPciBusId = 33
PCI bus ID of the device
cudaDevAttrPciDeviceId = 34
PCI device ID of the device
cudaDevAttrTccDriver = 35
Device is using TCC driver model
cudaDevAttrMemoryClockRate = 36
Peak memory clock frequency in kilohertz
cudaDevAttrGlobalMemoryBusWidth = 37
Global memory bus width in bits
cudaDevAttrL2CacheSize = 38
Size of L2 cache in bytes
cudaDevAttrMaxThreadsPerMultiProcessor = 39
Maximum resident threads per multiprocessor
cudaDevAttrAsyncEngineCount = 40
Number of asynchronous engines
cudaDevAttrUnifiedAddressing = 41
Device shares a unified address space with the host
cudaDevAttrMaxTexture1DLayeredWidth = 42
Maximum 1D layered texture width
cudaDevAttrMaxTexture1DLayeredLayers = 43
Maximum layers in a 1D layered texture
cudaDevAttrMaxTexture2DGatherWidth = 45
Maximum 2D texture width if cudaArrayTextureGather is set
cudaDevAttrMaxTexture2DGatherHeight = 46
Maximum 2D texture height if cudaArrayTextureGather is set
|
483
Modules
cudaDevAttrMaxTexture3DWidthAlt = 47
Alternate maximum 3D texture width
cudaDevAttrMaxTexture3DHeightAlt = 48
Alternate maximum 3D texture height
cudaDevAttrMaxTexture3DDepthAlt = 49
Alternate maximum 3D texture depth
cudaDevAttrPciDomainId = 50
PCI domain ID of the device
cudaDevAttrTexturePitchAlignment = 51
Pitch alignment requirement for textures
cudaDevAttrMaxTextureCubemapWidth = 52
Maximum cubemap texture width/height
cudaDevAttrMaxTextureCubemapLayeredWidth = 53
Maximum cubemap layered texture width/height
cudaDevAttrMaxTextureCubemapLayeredLayers = 54
Maximum layers in a cubemap layered texture
cudaDevAttrMaxSurface1DWidth = 55
Maximum 1D surface width
cudaDevAttrMaxSurface2DWidth = 56
Maximum 2D surface width
cudaDevAttrMaxSurface2DHeight = 57
Maximum 2D surface height
cudaDevAttrMaxSurface3DWidth = 58
Maximum 3D surface width
cudaDevAttrMaxSurface3DHeight = 59
Maximum 3D surface height
cudaDevAttrMaxSurface3DDepth = 60
Maximum 3D surface depth
cudaDevAttrMaxSurface1DLayeredWidth = 61
Maximum 1D layered surface width
cudaDevAttrMaxSurface1DLayeredLayers = 62
Maximum layers in a 1D layered surface
cudaDevAttrMaxSurface2DLayeredWidth = 63
Maximum 2D layered surface width
cudaDevAttrMaxSurface2DLayeredHeight = 64
Maximum 2D layered surface height
cudaDevAttrMaxSurface2DLayeredLayers = 65
Maximum layers in a 2D layered surface
cudaDevAttrMaxSurfaceCubemapWidth = 66
Maximum cubemap surface width
cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67
Maximum cubemap layered surface width
cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68
|
484
Modules
Maximum layers in a cubemap layered surface
cudaDevAttrMaxTexture1DLinearWidth = 69
Maximum 1D linear texture width
cudaDevAttrMaxTexture2DLinearWidth = 70
Maximum 2D linear texture width
cudaDevAttrMaxTexture2DLinearHeight = 71
Maximum 2D linear texture height
cudaDevAttrMaxTexture2DLinearPitch = 72
Maximum 2D linear texture pitch in bytes
cudaDevAttrMaxTexture2DMipmappedWidth = 73
Maximum mipmapped 2D texture width
cudaDevAttrMaxTexture2DMipmappedHeight = 74
Maximum mipmapped 2D texture height
cudaDevAttrComputeCapabilityMajor = 75
Major compute capability version number
cudaDevAttrComputeCapabilityMinor = 76
Minor compute capability version number
cudaDevAttrMaxTexture1DMipmappedWidth = 77
Maximum mipmapped 1D texture width
cudaDevAttrStreamPrioritiesSupported = 78
Device supports stream priorities
cudaDevAttrGlobalL1CacheSupported = 79
Device supports caching globals in L1
cudaDevAttrLocalL1CacheSupported = 80
Device supports caching locals in L1
cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81
Maximum shared memory available per multiprocessor in bytes
cudaDevAttrMaxRegistersPerMultiprocessor = 82
Maximum number of 32-bit registers available per multiprocessor
cudaDevAttrManagedMemory = 83
Device can allocate managed memory on this system
cudaDevAttrIsMultiGpuBoard = 84
Device is on a multi-GPU board
cudaDevAttrMultiGpuBoardGroupID = 85
Unique identifier for a group of devices on the same multi-GPU board
cudaDevAttrHostNativeAtomicSupported = 86
Link between the device and the host supports native atomic operations
cudaDevAttrSingleToDoublePrecisionPerfRatio = 87
Ratio of single precision performance (in floating-point operations per second) to double precision
performance
cudaDevAttrPageableMemoryAccess = 88
Device supports coherently accessing pageable memory without calling cudaHostRegister on it
cudaDevAttrConcurrentManagedAccess = 89
|
485
Modules
Device can coherently access managed memory concurrently with the CPU
cudaDevAttrComputePreemptionSupported = 90
Device supports Compute Preemption
cudaDevAttrCanUseHostPointerForRegisteredMem = 91
Device can access host registered memory at the same virtual address as the CPU
cudaDevAttrReserved92 = 92
cudaDevAttrReserved93 = 93
cudaDevAttrReserved94 = 94
cudaDevAttrCooperativeLaunch = 95
Device supports launching cooperative kernels via cudaLaunchCooperativeKernel
cudaDevAttrCooperativeMultiDeviceLaunch = 96
Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated.
cudaDevAttrMaxSharedMemoryPerBlockOptin = 97
The maximum optin shared memory per block. This value may vary by chip. See
cudaFuncSetAttribute
cudaDevAttrCanFlushRemoteWrites = 98
Device supports flushing of outstanding remote writes.
cudaDevAttrHostRegisterSupported = 99
Device supports host memory registration via cudaHostRegister.
cudaDevAttrPageableMemoryAccessUsesHostPageTables = 100
Device accesses pageable memory via the host's page tables.
cudaDevAttrDirectManagedMemAccessFromHost = 101
Host can directly access managed memory on the device without migration.
cudaDevAttrMaxBlocksPerMultiprocessor = 106
Maximum number of blocks per multiprocessor
cudaDevAttrMaxPersistingL2CacheSize = 108
Maximum L2 persisting lines capacity setting in bytes.
cudaDevAttrMaxAccessPolicyWindowSize = 109
Maximum value of cudaAccessPolicyWindow::num_bytes.
cudaDevAttrReservedSharedMemoryPerBlock = 111
Shared memory reserved by CUDA driver per block in bytes
cudaDevAttrSparseCudaArraySupported = 112
Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays
cudaDevAttrHostRegisterReadOnlySupported = 113
Device supports using the cudaHostRegister flag cudaHostRegisterReadOnly to register memory
that must be mapped as read-only to the GPU
cudaDevAttrTimelineSemaphoreInteropSupported = 114
External timeline semaphore interop is supported on the device
cudaDevAttrMaxTimelineSemaphoreInteropSupported = 114
Deprecated, External timeline semaphore interop is supported on the device
cudaDevAttrMemoryPoolsSupported = 115
Device supports using the cudaMallocAsync and cudaMemPool family of APIs
cudaDevAttrGPUDirectRDMASupported = 116
|
486
Modules
Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see https://docs.nvidia.com/
cuda/gpudirect-rdma for more information)
cudaDevAttrGPUDirectRDMAFlushWritesOptions = 117
The returned attribute shall be interpreted as a bitmask, where the individual bits are listed in the
cudaFlushGPUDirectRDMAWritesOptions enum
cudaDevAttrGPUDirectRDMAWritesOrdering = 118
GPUDirect RDMA writes to the device do not need to be flushed for consumers within the scope
indicated by the returned attribute. See cudaGPUDirectRDMAWritesOrdering for the numerical
values returned here.
cudaDevAttrMemoryPoolSupportedHandleTypes = 119
Handle types supported with mempool based IPC
cudaDevAttrClusterLaunch = 120
Indicates device supports cluster launch
cudaDevAttrDeferredMappingCudaArraySupported = 121
Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays
cudaDevAttrReserved122 = 122
cudaDevAttrReserved123 = 123
cudaDevAttrReserved124 = 124
cudaDevAttrIpcEventSupport = 125
Device supports IPC Events.
cudaDevAttrMemSyncDomainCount = 126
Number of memory synchronization domains the device supports.
cudaDevAttrReserved127 = 127
cudaDevAttrReserved128 = 128
cudaDevAttrReserved129 = 129
cudaDevAttrNumaConfig = 130
NUMA configuration of a device: value is of type cudaDeviceNumaConfig enum
cudaDevAttrNumaId = 131
NUMA node ID of the GPU memory
cudaDevAttrReserved132 = 132
cudaDevAttrMpsEnabled = 133
Contexts created on this device will be shared via MPS
cudaDevAttrHostNumaId = 134
NUMA ID of the host node closest to the device or -1 when system does not support NUMA
cudaDevAttrD3D12CigSupported = 135
Device supports CIG with D3D12.
cudaDevAttrVulkanCigSupported = 138
Device supports CIG with Vulkan.
cudaDevAttrGpuPciDeviceId = 139
The combined 16-bit PCI device ID and 16-bit PCI vendor ID.
cudaDevAttrGpuPciSubsystemId = 140
The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID.
cudaDevAttrReserved141 = 141
|
487
Modules
cudaDevAttrHostNumaMemoryPoolsSupported = 142
Device supports HOST_NUMA location with the cudaMallocAsync and cudaMemPool family of
APIs
cudaDevAttrHostNumaMultinodeIpcSupported = 143
Device supports HostNuma location IPC between nodes in a multi-node system.
cudaDevAttrMax
enum cudaDeviceNumaConfig
CUDA device NUMA config
Values
cudaDeviceNumaConfigNone = 0
The GPU is not a NUMA node
cudaDeviceNumaConfigNumaNode
The GPU is a NUMA node, cudaDevAttrNumaId contains its NUMA ID
enum cudaDeviceP2PAttr
CUDA device P2P attributes
Values
cudaDevP2PAttrPerformanceRank = 1
A relative value indicating the performance of the link between two devices
cudaDevP2PAttrAccessSupported = 2
Peer access is enabled
cudaDevP2PAttrNativeAtomicSupported = 3
Native atomic operation over the link supported
cudaDevP2PAttrCudaArrayAccessSupported = 4
Accessing CUDA arrays over the link supported
enum cudaDriverEntryPointQueryResult
Enum for status from obtaining driver entry points, used with cudaApiGetDriverEntryPoint
Values
cudaDriverEntryPointSuccess = 0
Search for symbol found a match
cudaDriverEntryPointSymbolNotFound = 1
Search for symbol was not found
cudaDriverEntryPointVersionNotSufficent = 2
Search for symbol was found but version wasn't great enough
|
488
Modules
enum cudaEglColorFormat
CUDA EGL Color Format - The different planar and multiplanar formats currently supported for
CUDA_EGL interops.
Values
cudaEglColorFormatYUV420Planar = 0
Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y
height.
cudaEglColorFormatYUV420SemiPlanar = 1
Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as
YUV420Planar.
cudaEglColorFormatYUV422Planar = 2
Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height.
cudaEglColorFormatYUV422SemiPlanar = 3
Y, UV in two surfaces with VU byte ordering, width, height ratio same as YUV422Planar.
cudaEglColorFormatARGB = 6
R/G/B/A four channels in one surface with BGRA byte ordering.
cudaEglColorFormatRGBA = 7
R/G/B/A four channels in one surface with ABGR byte ordering.
cudaEglColorFormatL = 8
single luminance channel in one surface.
cudaEglColorFormatR = 9
single color channel in one surface.
cudaEglColorFormatYUV444Planar = 10
Y, U, V in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height.
cudaEglColorFormatYUV444SemiPlanar = 11
Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as
YUV444Planar.
cudaEglColorFormatYUYV422 = 12
Y, U, V in one surface, interleaved as UYVY in one channel.
cudaEglColorFormatUYVY422 = 13
Y, U, V in one surface, interleaved as YUYV in one channel.
cudaEglColorFormatABGR = 14
R/G/B/A four channels in one surface with RGBA byte ordering.
cudaEglColorFormatBGRA = 15
R/G/B/A four channels in one surface with ARGB byte ordering.
cudaEglColorFormatA = 16
Alpha color format - one channel in one surface.
cudaEglColorFormatRG = 17
R/G color format - two channels in one surface with GR byte ordering
cudaEglColorFormatAYUV = 18
|
489
Modules
Y, U, V, A four channels in one surface, interleaved as VUYA.
cudaEglColorFormatYVU444SemiPlanar = 19
Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V
height = Y height.
cudaEglColorFormatYVU422SemiPlanar = 20
Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V
height = Y height.
cudaEglColorFormatYVU420SemiPlanar = 21
Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V
height = 1/2 Y height.
cudaEglColorFormatY10V10U10_444SemiPlanar = 22
Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/
V height = Y height.
cudaEglColorFormatY10V10U10_420SemiPlanar = 23
Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y
width, U/V height = 1/2 Y height.
cudaEglColorFormatY12V12U12_444SemiPlanar = 24
Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/
V height = Y height.
cudaEglColorFormatY12V12U12_420SemiPlanar = 25
Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y
width, U/V height = 1/2 Y height.
cudaEglColorFormatVYUY_ER = 26
Extended Range Y, U, V in one surface, interleaved as YVYU in one channel.
cudaEglColorFormatUYVY_ER = 27
Extended Range Y, U, V in one surface, interleaved as YUYV in one channel.
cudaEglColorFormatYUYV_ER = 28
Extended Range Y, U, V in one surface, interleaved as UYVY in one channel.
cudaEglColorFormatYVYU_ER = 29
Extended Range Y, U, V in one surface, interleaved as VYUY in one channel.
cudaEglColorFormatYUVA_ER = 31
Extended Range Y, U, V, A four channels in one surface, interleaved as AVUY.
cudaEglColorFormatAYUV_ER = 32
Extended Range Y, U, V, A four channels in one surface, interleaved as VUYA.
cudaEglColorFormatYUV444Planar_ER = 33
Extended Range Y, U, V in three surfaces, U/V width = Y width, U/V height = Y height.
cudaEglColorFormatYUV422Planar_ER = 34
Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = Y height.
cudaEglColorFormatYUV420Planar_ER = 35
Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height.
cudaEglColorFormatYUV444SemiPlanar_ER = 36
Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = Y
width, U/V height = Y height.
|
490
Modules
cudaEglColorFormatYUV422SemiPlanar_ER = 37
Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width =
1/2 Y width, U/V height = Y height.
cudaEglColorFormatYUV420SemiPlanar_ER = 38
Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width =
1/2 Y width, U/V height = 1/2 Y height.
cudaEglColorFormatYVU444Planar_ER = 39
Extended Range Y, V, U in three surfaces, U/V width = Y width, U/V height = Y height.
cudaEglColorFormatYVU422Planar_ER = 40
Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = Y height.
cudaEglColorFormatYVU420Planar_ER = 41
Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height.
cudaEglColorFormatYVU444SemiPlanar_ER = 42
Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y
width, U/V height = Y height.
cudaEglColorFormatYVU422SemiPlanar_ER = 43
Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width =
1/2 Y width, U/V height = Y height.
cudaEglColorFormatYVU420SemiPlanar_ER = 44
Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width =
1/2 Y width, U/V height = 1/2 Y height.
cudaEglColorFormatBayerRGGB = 45
Bayer format - one channel in one surface with interleaved RGGB ordering.
cudaEglColorFormatBayerBGGR = 46
Bayer format - one channel in one surface with interleaved BGGR ordering.
cudaEglColorFormatBayerGRBG = 47
Bayer format - one channel in one surface with interleaved GRBG ordering.
cudaEglColorFormatBayerGBRG = 48
Bayer format - one channel in one surface with interleaved GBRG ordering.
cudaEglColorFormatBayer10RGGB = 49
Bayer10 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 10
bits used 6 bits No-op.
cudaEglColorFormatBayer10BGGR = 50
Bayer10 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 10
bits used 6 bits No-op.
cudaEglColorFormatBayer10GRBG = 51
Bayer10 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 10
bits used 6 bits No-op.
cudaEglColorFormatBayer10GBRG = 52
Bayer10 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 10
bits used 6 bits No-op.
cudaEglColorFormatBayer12RGGB = 53
|
491
Modules
Bayer12 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 12
bits used 4 bits No-op.
cudaEglColorFormatBayer12BGGR = 54
Bayer12 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 12
bits used 4 bits No-op.
cudaEglColorFormatBayer12GRBG = 55
Bayer12 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 12
bits used 4 bits No-op.
cudaEglColorFormatBayer12GBRG = 56
Bayer12 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 12
bits used 4 bits No-op.
cudaEglColorFormatBayer14RGGB = 57
Bayer14 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 14
bits used 2 bits No-op.
cudaEglColorFormatBayer14BGGR = 58
Bayer14 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 14
bits used 2 bits No-op.
cudaEglColorFormatBayer14GRBG = 59
Bayer14 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 14
bits used 2 bits No-op.
cudaEglColorFormatBayer14GBRG = 60
Bayer14 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 14
bits used 2 bits No-op.
cudaEglColorFormatBayer20RGGB = 61
Bayer20 format - one channel in one surface with interleaved RGGB ordering. Out of 32 bits, 20
bits used 12 bits No-op.
cudaEglColorFormatBayer20BGGR = 62
Bayer20 format - one channel in one surface with interleaved BGGR ordering. Out of 32 bits, 20
bits used 12 bits No-op.
cudaEglColorFormatBayer20GRBG = 63
Bayer20 format - one channel in one surface with interleaved GRBG ordering. Out of 32 bits, 20
bits used 12 bits No-op.
cudaEglColorFormatBayer20GBRG = 64
Bayer20 format - one channel in one surface with interleaved GBRG ordering. Out of 32 bits, 20
bits used 12 bits No-op.
cudaEglColorFormatYVU444Planar = 65
Y, V, U in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height.
cudaEglColorFormatYVU422Planar = 66
Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = Y
height.
cudaEglColorFormatYVU420Planar = 67
Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y
height.
|
492

 

 

 

 

 

 

 

Content      ..     5      6      7      8     ..