From 2d5f1bc48db80b70147e3566dcbdb9e063370043 Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 13 Jun 2016 15:20:52 -0400 Subject: [PATCH] P4 to Git Change 1279182 by asalmanp@asalmanp-ocl-stg-pal on 2016/06/13 15:10:34 SWDEV-79278 - [OpenCL][PAL][GFXIP9 Bring up] OCL GFXIP9 general development.Adding support for ASIC detection based on gfxLevel on PAL. For GFXIP9+, the Asic revision on PAL is Unknown and gfxLevel should be used for ASIC detection. ReviewBoardURL = http://ocltc.amd.com/reviews/r/10616/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldefs.hpp#4 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#9 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#6 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#4 edit --- rocclr/runtime/device/pal/paldefs.hpp | 13 +++++++++++-- rocclr/runtime/device/pal/paldevice.cpp | 8 +++++++- rocclr/runtime/device/pal/palprogram.cpp | 7 +++---- rocclr/runtime/device/pal/palsettings.cpp | 13 +++++++++---- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/rocclr/runtime/device/pal/paldefs.hpp b/rocclr/runtime/device/pal/paldefs.hpp index 72054005f8..fbdec58fb3 100644 --- a/rocclr/runtime/device/pal/paldefs.hpp +++ b/rocclr/runtime/device/pal/paldefs.hpp @@ -141,8 +141,17 @@ static const AMDDeviceInfo DeviceInfo[] = { /* Iceland */ { "Iceland", "iceland", 4, 16, 1, 256, 64 * Ki, 32, 800 }, /* Tonga */ { "Tonga", "tonga", 4, 16, 1, 256, 64 * Ki, 32, 800 }, /* Fiji */ { "Fiji", "fiji", 4, 16, 1, 256, 64 * Ki, 32, 800 }, -/* Ellesmere */ { "Horse", "horse", 4, 16, 1, 256, 64 * Ki, 32, 800 }, -/* Buffin */ { "Goose", "goose", 4, 16, 1, 256, 64 * Ki, 32, 800 }, +/* Ellesmere */ { "Ellesmere", "ellesmere",4, 16, 1, 256, 64 * Ki, 32, 800 }, +/* Buffin */ { "Baffin", "baffin", 4, 16, 1, 256, 64 * Ki, 32, 800 }, +}; + +static const AMDDeviceInfo GfxIpDeviceInfo[] = { +/* Unknown */ { "", "unknown", 4, 16, 1, 256, 64 * Ki, 32, 000 }, +/* GFX6_0_0 */ { "GFX6_0_0", "gfx6_0_0", 4, 16, 1, 256, 64 * Ki, 32, 600 }, +/* GFX7_0_0 */ { "GFX7_0_0", "gfx7_0_0", 4, 16, 1, 256, 64 * Ki, 32, 700 }, +/* GFX8_0_0 */ { "GFX8_0_0", "gfx8_0_0", 4, 16, 1, 256, 64 * Ki, 32, 800 }, +/* GFX8_0_1 */ { "GFX8_0_1", "gfx8_0_1", 4, 16, 1, 256, 64 * Ki, 32, 801 }, +/* GFX9_0_0 */ { "", "", 4, 16, 1, 256, 64 * Ki, 32, 900 }, }; static const char* Gfx700 = "AMD:AMDGPU:7:0:0"; diff --git a/rocclr/runtime/device/pal/paldevice.cpp b/rocclr/runtime/device/pal/paldevice.cpp index 47a20ebbd9..30691785cf 100644 --- a/rocclr/runtime/device/pal/paldevice.cpp +++ b/rocclr/runtime/device/pal/paldevice.cpp @@ -637,7 +637,13 @@ Device::create(Pal::IDevice* device) ipLevel_ = properties().gfxLevel; // Update HW info for the device - hwInfo_ = &DeviceInfo[static_cast(properties().revision)]; + if (properties().revision == Pal::AsicRevision::Unknown) { + hwInfo_ = &GfxIpDeviceInfo[static_cast(properties().gfxLevel)]; + } + else { + hwInfo_ = &DeviceInfo[static_cast(properties().revision)]; + } + // Find the number of available engines numComputeEngines_ = diff --git a/rocclr/runtime/device/pal/palprogram.cpp b/rocclr/runtime/device/pal/palprogram.cpp index cc0fabd828..c985ae4e94 100644 --- a/rocclr/runtime/device/pal/palprogram.cpp +++ b/rocclr/runtime/device/pal/palprogram.cpp @@ -739,10 +739,9 @@ bool ORCAHSALoaderContext::IsaSupportedByAgent(hsa_agent_t agent, hsa_isa_t isa) return false; } case gfx900: - switch (program_->dev().properties().revision) { - case 0: -/* case Pal::AsicRevision::Greenland: - return isa.handle == gfx900 || isa.handle == gfx901;*/ + switch (program_->dev().properties().gfxLevel) { + case Pal::GfxIpLevel::GfxIp9: + return isa.handle == gfx900 || isa.handle == gfx901; default: assert(0); return false; diff --git a/rocclr/runtime/device/pal/palsettings.cpp b/rocclr/runtime/device/pal/palsettings.cpp index 86c5542fd4..e29b86741d 100644 --- a/rocclr/runtime/device/pal/palsettings.cpp +++ b/rocclr/runtime/device/pal/palsettings.cpp @@ -155,10 +155,15 @@ Settings::create( ModifyMaxWorkload modifyMaxWorkload = {0}; switch (palProp.revision) { -/* case Pal::AsicRevision::: - case CAL_TARGET_GREENLAND: - //TODO: specific codes for AI - aiPlus_ = true;*/ + case Pal::AsicRevision::Unknown: + switch (palProp.gfxLevel) { + case Pal::GfxIpLevel::GfxIp9: + aiPlus_ = true; + break; + default: + assert(0 && "Unknown GfxIP type!"); + return false; + } // Fall through to VI ... case Pal::AsicRevision::Carrizo: case Pal::AsicRevision::Stoney: