diff --git a/rocclr/runtime/device/device.hpp b/rocclr/runtime/device/device.hpp index 9e7aa6cbd0..4a5ed53157 100644 --- a/rocclr/runtime/device/device.hpp +++ b/rocclr/runtime/device/device.hpp @@ -537,7 +537,9 @@ class Settings : public amd::HeapObject { uint enableWave32Mode_ : 1; //!< Enable Wave32 mode for this device uint lcWavefrontSize64_ : 1; //!< Enable Wave64 mode for this device uint enableXNACK_ : 1; //!< Enable XNACK feature - uint reserved_ : 14; + uint enableCoopGroups_ : 1; //!< Enable cooperative groups feature + uint enableCoopMultiDeviceGroups_ : 1; //!< Enable cooperative groups multi device + uint reserved_ : 12; }; uint value_; }; diff --git a/rocclr/runtime/device/pal/paldevice.cpp b/rocclr/runtime/device/pal/paldevice.cpp index e566ffd049..01a3e1e9e0 100644 --- a/rocclr/runtime/device/pal/paldevice.cpp +++ b/rocclr/runtime/device/pal/paldevice.cpp @@ -660,8 +660,9 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp, info_.pcieRevisionId_ = palProp.revisionId; info_.maxThreadsPerCU_ = info_.wavefrontWidth_ * info_.simdPerCU_ * palProp.gfxipProperties.shaderCore.numWavefrontsPerSimd; - info_.cooperativeGroups_ = GPU_ENABLE_COOP_GROUPS; - info_.cooperativeMultiDeviceGroups_ = GPU_ENABLE_COOP_GROUPS; + + info_.cooperativeGroups_ = settings().enableCoopGroups_; + info_.cooperativeMultiDeviceGroups_ = settings().enableCoopMultiDeviceGroups_; } } diff --git a/rocclr/runtime/device/pal/palsettings.cpp b/rocclr/runtime/device/pal/palsettings.cpp index 23241de5c7..0ae8bfde0d 100644 --- a/rocclr/runtime/device/pal/palsettings.cpp +++ b/rocclr/runtime/device/pal/palsettings.cpp @@ -223,6 +223,8 @@ bool Settings::create(const Pal::DeviceProperties& palProp, case Pal::AsicRevision::Raven: case Pal::AsicRevision::Raven2: aiPlus_ = true; + enableCoopGroups_ = true; + enableCoopMultiDeviceGroups_ = true; // Fall through to VI ... case Pal::AsicRevision::Carrizo: case Pal::AsicRevision::Bristol: @@ -540,6 +542,11 @@ void Settings::override() { if (!flagIsDefault(GPU_MAX_COMMAND_BUFFERS)) { maxCmdBuffers_ = GPU_MAX_COMMAND_BUFFERS; } + + if (!flagIsDefault(GPU_ENABLE_COOP_GROUPS)) { + enableCoopGroups_ = GPU_ENABLE_COOP_GROUPS; + enableCoopMultiDeviceGroups_ = GPU_ENABLE_COOP_GROUPS; + } } } // namespace pal diff --git a/rocclr/runtime/device/rocm/rocdevice.cpp b/rocclr/runtime/device/rocm/rocdevice.cpp index 6609d3d5ba..6412397b17 100644 --- a/rocclr/runtime/device/rocm/rocdevice.cpp +++ b/rocclr/runtime/device/rocm/rocdevice.cpp @@ -1376,8 +1376,8 @@ bool Device::populateOCLDeviceConstants() { //TODO: set to true once thread trace support is available info_.threadTraceEnable_ = false; info_.pcieDeviceId_ = deviceInfo_.pciDeviceId_; - info_.cooperativeGroups_ = GPU_ENABLE_COOP_GROUPS; - info_.cooperativeMultiDeviceGroups_ = GPU_ENABLE_COOP_GROUPS; + info_.cooperativeGroups_ = settings().enableCoopGroups_; + info_.cooperativeMultiDeviceGroups_ = settings().enableCoopMultiDeviceGroups_; } info_.maxPipePacketSize_ = info_.maxMemAllocSize_; diff --git a/rocclr/runtime/device/rocm/rocsettings.cpp b/rocclr/runtime/device/rocm/rocsettings.cpp index 1b150c4997..0bf90d044c 100644 --- a/rocclr/runtime/device/rocm/rocsettings.cpp +++ b/rocclr/runtime/device/rocm/rocsettings.cpp @@ -117,6 +117,8 @@ bool Settings::create(bool fullProfile, int gfxipVersion) { // enable subnormals for gfx900 and later if (gfxipVersion >= 900) { singleFpDenorm_ = true; + enableCoopGroups_ = true; + enableCoopMultiDeviceGroups_ = true; } } else { // Also enable AMD double precision extension? @@ -180,8 +182,11 @@ void Settings::override() { break; } } + if (!flagIsDefault(GPU_ENABLE_COOP_GROUPS)) { + enableCoopGroups_ = GPU_ENABLE_COOP_GROUPS; + enableCoopMultiDeviceGroups_ = GPU_ENABLE_COOP_GROUPS; + } } - } // namespace roc #endif // WITHOUT_GPU_BACKEND