From 3993dd799fdf0e7469eff38b19d5fec454c2e902 Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 12 Dec 2017 13:14:35 -0500 Subject: [PATCH] P4 to Git Change 1493313 by wchau@wchau_OCL_boltzmann on 2017/12/12 13:03:51 SWDEV-140733 - OpenCL Runtime Support for Raven BU in ROCm - add device info entry for Raven - modified Makefile.library to use Raven's bitcode library Affected files ... ... //depot/stg/opencl/drivers/opencl/library/build/Makefile.library#61 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdefs.hpp#13 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#78 edit [ROCm/clr commit: e0e70c043bf23267cb13e7b068b75117f59e8636] --- projects/clr/rocclr/runtime/device/rocm/rocdefs.hpp | 4 +++- projects/clr/rocclr/runtime/device/rocm/rocdevice.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/rocm/rocdefs.hpp b/projects/clr/rocclr/runtime/device/rocm/rocdefs.hpp index 954b42977e..7ce92a9f57 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocdefs.hpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocdefs.hpp @@ -36,6 +36,7 @@ const HsaDeviceId HSA_ELLESMERE_ID = 7; const HsaDeviceId HSA_BAFFIN_ID = 8; const HsaDeviceId HSA_VEGA10_ID = 9; const HsaDeviceId HSA_VEGA10_HBCC_ID = 10; +const HsaDeviceId HSA_RAVEN_ID = 11; const HsaDeviceId HSA_INVALID_DEVICE_ID = -1; static const AMDDeviceInfo DeviceInfo[] = { @@ -56,7 +57,8 @@ static const AMDDeviceInfo DeviceInfo[] = { /* TARGET BAFFIN */ {HSA_BAFFIN_ID, "", "polaris11", "Baffin", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}, /* TARGET VEGA10 */ {HSA_VEGA10_ID, "", "gfx900", "gfx900", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}, - /* TARGET VEGA10_HBCC */ {HSA_VEGA10_HBCC_ID, "", "gfx901", "gfx901", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}}; + /* TARGET VEGA10_HBCC */ {HSA_VEGA10_HBCC_ID, "", "gfx901", "gfx901", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}, + /* TARGET RAVEN */ {HSA_RAVEN_ID, "", "gfx902", "gfx902", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}}; } const uint kMaxAsyncQueues = 8; // set to match the number of pipes, which is 8 diff --git a/projects/clr/rocclr/runtime/device/rocm/rocdevice.cpp b/projects/clr/rocclr/runtime/device/rocm/rocdevice.cpp index 1926f5323f..f1e5b50c65 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocdevice.cpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocdevice.cpp @@ -88,6 +88,8 @@ static HsaDeviceId getHsaDeviceId(hsa_agent_t device, uint32_t& pci_id) { return HSA_VEGA10_ID; case 901: return HSA_VEGA10_HBCC_ID; + case 902: + return HSA_RAVEN_ID; default: return HSA_INVALID_DEVICE_ID; } @@ -810,7 +812,11 @@ bool Device::populateOCLDeviceConstants() { &info_.maxClockFrequency_)) { return false; } - assert(info_.maxClockFrequency_ > 0); + + //TODO: add the assert statement for Raven + if (deviceInfo_.gfxipVersion_ != 902) { + assert(info_.maxClockFrequency_ > 0); + } if (HSA_STATUS_SUCCESS != hsa_amd_agent_iterate_memory_pools(cpu_agent_, Device::iterateCpuMemoryPoolCallback, this)) {