cuda.bindings._v2.driver.dev_resource_generate_desc#

cuda.bindings._v2.driver.dev_resource_generate_desc(
resources,
unsigned int nb_resources,
) → intptr_t#

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 cuGreenCtxCreate 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 ph_desc descriptor as well as a valid array of resources pointers, with the array size passed in nb_resources. If multiple resources are provided in resources, the device they came from must be the same, otherwise CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. If multiple resources are provided in resources and they are of type CU_DEV_RESOURCE_TYPE_SM, they must be outputs (whether result or remaining) from the same split API instance and have the same smCoscheduledAlignment and localityDomainId values, otherwise CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned.

The output descriptor ph_desc will remain valid for the lifetime of the process. Note: The API is not supported on 32-bit platforms.

Parameters:
  • resources (intptr_t) – Array of resources to be included in the descriptor.

  • nb_resources (unsigned int) – Number of resources passed in resources.

Returns:

Output descriptor.

Return type:

intptr_t

See also

cuDevResourceGenerateDesc