7.53. CUdevResource Struct Reference

[Green Contexts]

A tagged union describing different resources identified by the type field. This structure should not be directly modified outside of the API that created it.

‎ struct {
           CUdevResourceType type;
           union {
               CUdevSmResource sm;
                 CUdevWorkqueueConfigResource wqConfig;
                 CUdevWorkqueueResource wq;
           };
       };
  • If type is CU_DEV_RESOURCE_TYPE_INVALID, this resoure is not valid and cannot be further accessed.

  • If type is CU_DEV_RESOURCE_TYPE_SM, the CUdevSmResource structure sm is filled in. For example, sm.smCount will reflect the amount of streaming multiprocessors available in this resource.

  • If type is CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG, the CUdevWorkqueueConfigResource structure wqConfig is filled in.

  • If type is CU_DEV_RESOURCE_TYPE_WORKQUEUE, the CUdevWorkqueueResource structure wq is filled in.