pub unsafe extern "C" fn cudaDevResourceGenerateDesc(
phDesc: *mut cudaDevResourceDesc_t,
resources: *mut cudaDevResource,
nbResources: c_uint,
) -> cudaError_tExpand description
Generate a resource descriptor.
Generates a single resource descriptor with the set of resources specified in resources. The generated resource descriptor is necessary for the creation of green contexts via the cudaGreenCtxCreate API. Resources of the same type can be passed in, provided they meet the requirements as noted below.
A successful API call must have:
- A valid output pointer for the
phDescdescriptor as well as a valid array ofresourcespointers, with the array size passed innbResources. If multiple resources are provided inresources, the device they came from must be the same, otherwisecudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATIONis returned. If multiple resources are provided inresourcesand they are of typecudaDevResourceType::cudaDevResourceTypeSm, they must be outputs (whetherresultorremaining) from the same split API instance and have the same smCoscheduledAlignment values, otherwisecudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATIONis returned.
Note: The API is not supported on 32-bit platforms.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.
§Parameters
phDesc: Output descriptor.resources: Array of resources to be included in the descriptor.nbResources: Number of resources passed inresources.
§Return value
cudaError_t::CUDA_SUCCESScudaError_t::CUDA_ERROR_INVALID_VALUEcudaError_t::CUDA_ERROR_NOT_PERMITTEDcudaError_t::CUDA_ERROR_INVALID_RESOURCE_TYPEcudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATIONcudaError_t::CUDA_ERROR_DEINITIALIZEDcudaError_t::CUDA_ERROR_NOT_INITIALIZED
See also: cuDevResourceGenerateDesc, cudaDeviceGetDevResource, cudaExecutionCtxGetDevResource, cudaDevSmResourceSplit, cudaGreenCtxCreate.