From 18e6c529bc20047551c4cbc09216a4df8cbbef49 Mon Sep 17 00:00:00 2001 From: Joseph Greathouse Date: Tue, 17 Mar 2020 03:31:44 -0500 Subject: [PATCH] Fix detection of support for cooperative groups (#1932) Query ROCr to see if we have the proper lower-level support for cooperative groups -- GWS support through the firmware, driver, thunk, and ROCr. ROCr does these checks for us, and presents a query that allows us to see if GWS entries are available for use. If so, then we have all the lower-level technologies needed, and we should enable cooperative groups support for HIP. --- src/hip_hcc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hip_hcc.cpp b/src/hip_hcc.cpp index be08430bc3..3f7128e964 100644 --- a/src/hip_hcc.cpp +++ b/src/hip_hcc.cpp @@ -895,9 +895,11 @@ hipError_t ihipDevice_t::initProperties(hipDeviceProp_t* prop) { prop->integrated = 1; } - // Enable the cooperative group for gfx9+ - prop->cooperativeLaunch = (prop->gcnArch < 900) ? 0 : 1; - prop->cooperativeMultiDeviceLaunch = (prop->gcnArch < 900) ? 0 : 1; + // Enable the cooperative group for GPUs that support all the required features + err = hsa_agent_get_info(_hsaAgent, (hsa_agent_info_t)HSA_AMD_AGENT_INFO_COOPERATIVE_QUEUES, + &prop->cooperativeLaunch); + DeviceErrorCheck(err); + prop->cooperativeMultiDeviceLaunch = prop->cooperativeLaunch; prop->cooperativeMultiDeviceUnmatchedFunc = prop->cooperativeMultiDeviceLaunch; prop->cooperativeMultiDeviceUnmatchedGridDim = prop->cooperativeMultiDeviceLaunch;