From 9f596e0aab96f935d203e47c8ece485ddc5dffad Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Tue, 9 Feb 2016 17:10:35 +0300 Subject: [PATCH] Device property concurrentKernels is added to hipDeviceProp_t struct. For HCC path concurrentKernels is set to true since all ROCR hardware supports this feature. For NVCC path concurrentKernels is obtained from CUDA's device property cudaDeviceProp::concurrentKernels. [ROCm/clr commit: 4d4ca3ef3f68a50f2ff9069e998feff61aec39b5] --- projects/clr/hipamd/include/hip_runtime_api.h | 1 + projects/clr/hipamd/include/nvcc_detail/hip_runtime_api.h | 1 + projects/clr/hipamd/src/hip_hcc.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/projects/clr/hipamd/include/hip_runtime_api.h b/projects/clr/hipamd/include/hip_runtime_api.h index 64f5a523d2..75f5807b6e 100644 --- a/projects/clr/hipamd/include/hip_runtime_api.h +++ b/projects/clr/hipamd/include/hip_runtime_api.h @@ -93,6 +93,7 @@ typedef struct hipDeviceProp_t { int clockInstructionRate ; ///< Frequency in khz of the timer used by the device-side "clock*" instructions. New for HIP. hipDeviceArch_t arch; ///< Architectural feature flags. New for HIP. + int concurrentKernels; ///< Device can possibly execute multiple kernels concurrently } hipDeviceProp_t; diff --git a/projects/clr/hipamd/include/nvcc_detail/hip_runtime_api.h b/projects/clr/hipamd/include/nvcc_detail/hip_runtime_api.h index 482b1259b0..4c9b35cab8 100644 --- a/projects/clr/hipamd/include/nvcc_detail/hip_runtime_api.h +++ b/projects/clr/hipamd/include/nvcc_detail/hip_runtime_api.h @@ -207,6 +207,7 @@ inline static hipError_t hipDeviceGetProperties(hipDeviceProp_t *p_prop, int dev p_prop->arch.has3dGrid = (ccVers >= 200); p_prop->arch.hasDynamicParallelism = (ccVers >= 350); + p_prop->concurrentKernels = cdprop.concurrentKernels; return hipCUDAErrorTohipError(cerror); } diff --git a/projects/clr/hipamd/src/hip_hcc.cpp b/projects/clr/hipamd/src/hip_hcc.cpp index 5cb021b7e7..4b7b53550d 100644 --- a/projects/clr/hipamd/src/hip_hcc.cpp +++ b/projects/clr/hipamd/src/hip_hcc.cpp @@ -383,6 +383,7 @@ hipError_t ihipDevice_t::getProperties(hipDeviceProp_t* prop) prop->arch.has3dGrid = 1; prop->arch.hasDynamicParallelism = 0; + prop->concurrentKernels = 1; // All ROCR hardware supports executing multiple kernels concurrently return e; }