From fc5094216fb9b290f36191c4bad61c7e09944c41 Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 3 Oct 2016 14:21:28 -0400 Subject: [PATCH] P4 to Git Change 1321838 by smekhano@stas-mwamba-rocm-hsa on 2016/10/03 14:09:41 SWDEV-104316 - set correct target for ROCm/HSA Reviewed by Laurent Morichetti Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#21 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdefs.hpp#7 edit [ROCm/clr commit: 9c5cfb05510df5c4fac55891a8da2047b695324d] --- .../runtime/device/rocm/roccompiler.cpp | 7 ++----- .../rocclr/runtime/device/rocm/rocdefs.hpp | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp b/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp index ce1a62261e..5b253b1b4b 100644 --- a/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp +++ b/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp @@ -252,11 +252,8 @@ HSAILProgram::compileImpl( acl_error errorCode; aclTargetInfo target; - //Defaulting to bonaire - //Todo (sramalin) : Query the device for asic type- - //Defaulting to Bonair for now. - target = g_complibApi._aclGetTargetInfo(LP64_SWITCH("hsail","hsail64"), "Bonaire", - &errorCode); + target = g_complibApi._aclGetTargetInfo(LP64_SWITCH("hsail","hsail64"), + dev().deviceInfo().complibTarget_, &errorCode); //end if asic info is ready // We dump the source code for each program (param: headers) diff --git a/projects/clr/rocclr/runtime/device/rocm/rocdefs.hpp b/projects/clr/rocclr/runtime/device/rocm/rocdefs.hpp index 0598f0c827..eb12a99c83 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocdefs.hpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocdefs.hpp @@ -10,6 +10,7 @@ struct AMDDeviceInfo { HsaDeviceId hsaDeviceId_; //!< Machine id const char* targetName_; //!< Target name for compilation const char* machineTarget_; //!< Machine target + const char* complibTarget_; //!< Compiler library target name uint simdPerCU_; //!< Number of SIMDs per CU uint simdWidth_; //!< Number of workitems processed per SIMD uint simdInstructionWidth_; //!< Number of instructions processed per SIMD @@ -34,15 +35,15 @@ const HsaDeviceId HSA_INVALID_DEVICE_ID = -1; static const AMDDeviceInfo DeviceInfo[] = { // targetName machineTarget - /* TARGET_KAVERI_SPECTRE */ {HSA_SPECTRE_ID, "", "kaveri", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, - /* TARGET_KAVERI_SPOOKY */ {HSA_SPOOKY_ID, "", "kaveri", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, - /* TARGET_TONGA */ {HSA_TONGA_ID, "", "tonga", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}, - /* TARGET_CARRIZO */ {HSA_CARRIZO_ID, "", "carrizo", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}, - /* TARGET_ICELAND */ {HSA_ICELAND_ID, "", "iceland", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}, - /* TARGET_FIJI */ {HSA_FIJI_ID, "", "fiji", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, - /* TARGET HAWAII */ {HSA_HAWAII_ID, "", "hawaii", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, - /* TARGET ELLESMERE */ {HSA_ELLESMERE_ID, "", "polaris10", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, - /* TARGET BAFFIN */ {HSA_BAFFIN_ID, "", "polaris11", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 } + /* TARGET_KAVERI_SPECTRE */ {HSA_SPECTRE_ID, "", "kaveri", "Spectre", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, + /* TARGET_KAVERI_SPOOKY */ {HSA_SPOOKY_ID, "", "kaveri", "Spooky", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, + /* TARGET_TONGA */ {HSA_TONGA_ID, "", "tonga", "Tonga", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}, + /* TARGET_CARRIZO */ {HSA_CARRIZO_ID, "", "carrizo", "Carrizo", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}, + /* TARGET_ICELAND */ {HSA_ICELAND_ID, "", "iceland", "Iceland", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}, + /* TARGET_FIJI */ {HSA_FIJI_ID, "", "fiji", "Fiji", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, + /* TARGET HAWAII */ {HSA_HAWAII_ID, "", "hawaii", "Hawaii", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, + /* TARGET ELLESMERE */ {HSA_ELLESMERE_ID, "", "polaris10", "Ellesmere", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 }, + /* TARGET BAFFIN */ {HSA_BAFFIN_ID, "", "polaris11", "Baffin", 4, 16, 1, 256, 64 * Ki, 32, 0, 0 } }; }