diff --git a/include/hip_runtime_api.h b/include/hip_runtime_api.h index 882103a1f4..d754862544 100644 --- a/include/hip_runtime_api.h +++ b/include/hip_runtime_api.h @@ -149,6 +149,7 @@ typedef enum hipDeviceAttribute_t { hipDeviceAttributeMaxThreadsPerMultiProcessor, ///< Maximum resident threads per multiprocessor. hipDeviceAttributeComputeCapabilityMajor, ///< Major compute capability version number. hipDeviceAttributeComputeCapabilityMinor, ///< Minor compute capability version number. + hipDevAttrConcurrentKernels, ///< Device can possibly execute multiple kernels concurrently. hipDeviceAttributePciBusId, ///< PCI Bus ID. hipDeviceAttributePciDeviceId, ///< PCI Device ID. hipDeviceAttributeMaxSharedMemoryPerMultiprocessor, ///< Maximum Shared Memory Per Multiprocessor. diff --git a/include/nvcc_detail/hip_runtime_api.h b/include/nvcc_detail/hip_runtime_api.h index f84de73872..83f2d59646 100644 --- a/include/nvcc_detail/hip_runtime_api.h +++ b/include/nvcc_detail/hip_runtime_api.h @@ -252,6 +252,8 @@ inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t att cdattr = cudaDevAttrMaxThreadsPerMultiProcessor; break; case hipDeviceAttributeComputeCapabilityMajor: cdattr = cudaDevAttrComputeCapabilityMajor; break; + case hipDevAttrConcurrentKernels: + cdattr = cudaDevAttrConcurrentKernels; break; case hipDeviceAttributePciBusId: cdattr = cudaDevAttrPciBusId; break; case hipDeviceAttributePciDeviceId: diff --git a/src/hip_hcc.cpp b/src/hip_hcc.cpp index bdfbdb230b..1ce3f4a5bb 100644 --- a/src/hip_hcc.cpp +++ b/src/hip_hcc.cpp @@ -852,6 +852,8 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) *pi = prop->minor; break; case hipDeviceAttributePciBusId: *pi = prop->pciBusID; break; + case hipDevAttrConcurrentKernels: + *pi = prop->concurrentKernels; break; case hipDeviceAttributePciDeviceId: *pi = prop->pciDeviceID; break; case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor: diff --git a/tests/src/hipGetDeviceAttribute.cpp b/tests/src/hipGetDeviceAttribute.cpp index 30fac8c1b4..7f37e816d2 100644 --- a/tests/src/hipGetDeviceAttribute.cpp +++ b/tests/src/hipGetDeviceAttribute.cpp @@ -73,6 +73,7 @@ int main(int argc, char *argv[]) CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMaxThreadsPerMultiProcessor, props.maxThreadsPerMultiProcessor)); CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeComputeCapabilityMajor, props.major)); CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeComputeCapabilityMinor, props.minor)); + CHECK(test_hipDeviceGetAttribute(deviceId, hipDevAttrConcurrentKernels, props.concurrentKernels)); CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributePciBusId, props.pciBusID)); CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributePciDeviceId, props.pciDeviceID)); CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMaxSharedMemoryPerMultiprocessor, props.maxSharedMemoryPerMultiProcessor));