P4 to Git Change 1601516 by asalmanp@asalmanp-ocl-stg on 2018/09/04 16:37:05

SWDEV-132899 - [OCL][GFX10.1] Adding gfx1010 support and use  Pal::GfxIpLevel::GfxIp10_1/Pal::AsicRevision::Navi10 for gfx1010 and Pal::GfxIpLevel::GfxIp10/Pal::AsicRevision::Navi10Lite for Ariel (gfx1000)

	ReviewRequestURL = http://ocltc.amd.com/reviews/r/15740/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudefs.hpp#152 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#240 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcounters.cpp#17 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldefs.hpp#38 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#108 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#54 edit


[ROCm/clr commit: 42f5788b2e]
This commit is contained in:
foreman
2018-09-04 16:57:45 -04:00
bovenliggende dd5aa956a1
commit 29c39ade39
6 gewijzigde bestanden met toevoegingen van 27 en 17 verwijderingen
@@ -163,8 +163,8 @@ static const AMDDeviceInfo DeviceInfo[] = {
IF(IS_BRAHMA, "", "gfx904"), 4, 16, 1, 256, 64 * Ki, 32, 900 },
/* CAL_TARGET_VEGA20 */{ ED_ATI_CAL_MACHINE_VEGA20_ISA, IF(IS_BRAHMA, "", "gfx906"),
IF(IS_BRAHMA, "", "gfx906"), 4, 16, 1, 256, 64 * Ki, 32, 900 },
/* CAL_TARGET_NAVI10 */{ ED_ATI_CAL_MACHINE_NAVI10_ISA, IF(IS_BRAHMA, "", "gfx1000"),
IF(IS_BRAHMA, "", "gfx1000"), 4, 16, 1, 256, 64 * Ki, 32, 1000 },
/* CAL_TARGET_NAVI10 */{ ED_ATI_CAL_MACHINE_NAVI10_ISA, IF(IS_BRAHMA, "", "gfx1010"),
IF(IS_BRAHMA, "", "gfx1010"), 4, 16, 1, 256, 64 * Ki, 32, 1010 },
};
@@ -184,8 +184,7 @@ enum gfx_handle {
gfx905 = 905,
gfx906 = 906,
gfx907 = 907,
gfx1000 = 1000,
gfx1001 = 1001
gfx1010 = 1010
};
static const char* Gfx700 = "AMD:AMDGPU:7:0:0";
@@ -202,8 +201,7 @@ static const char* Gfx904 = "AMD:AMDGPU:9:0:4";
static const char* Gfx905 = "AMD:AMDGPU:9:0:5";
static const char* Gfx906 = "AMD:AMDGPU:9:0:6";
static const char* Gfx907 = "AMD:AMDGPU:9:0:7";
static const char* Gfx1000 = "AMD:AMDGPU:10:0:0";
static const char* Gfx1001 = "AMD:AMDGPU:10:0:1";
static const char* Gfx1010 = "AMD:AMDGPU:10:1:0";
// Supported OpenCL versions
enum OclVersion { OpenCL10, OpenCL11, OpenCL12, OpenCL20, OpenCL21 };
@@ -2226,12 +2226,8 @@ hsa_isa_t ORCAHSALoaderContext::IsaFromName(const char* name) {
isa.handle = gfx907;
return isa;
}
if (!strcmp(Gfx1000, name)) {
isa.handle = gfx1000;
return isa;
}
if (!strcmp(Gfx1001, name)) {
isa.handle = gfx1001;
if (!strcmp(Gfx1010, name)) {
isa.handle = gfx1010;
return isa;
}
@@ -2290,11 +2286,10 @@ bool ORCAHSALoaderContext::IsaSupportedByAgent(hsa_agent_t agent, hsa_isa_t isa)
assert(0);
return false;
}
case gfx1000:
case gfx1001:
case gfx1010:
switch (program_->dev().hwInfo()->machine_) {
case ED_ATI_CAL_MACHINE_NAVI10_ISA:
return isa.handle == gfx1000 || isa.handle == gfx1001;
return isa.handle == gfx1010;
default:
assert(0);
return false;
@@ -650,6 +650,7 @@ void PerfCounter::convertInfo() {
}
break;
case Pal::GfxIpLevel::GfxIp10:
case Pal::GfxIpLevel::GfxIp10_1:
if (info_.blockIndex_ < gfx10BlockIdPal.size()) {
auto p = gfx10BlockIdPal[info_.blockIndex_];
info_.blockIndex_ = std::get<0>(p);
@@ -173,8 +173,11 @@ static const AMDDeviceInfo Gfx9PlusSubDeviceInfo[] = {
/* Raven2 */{"gfx902", "gfx902", 4, 16, 1, 256, 64 * Ki, 32, 902, false},
/* Raven2 XNACK */{ LIGHTNING_SWITCH("gfx902","gfx903"), LIGHTNING_SWITCH("gfx902","gfx903"),
4, 16, 1, 256, 64 * Ki, 32, LIGHTNING_SWITCH(902, 903), true},
/* Navi10 */{ "", "", 4, 16, 1, 256, 64 * Ki, 32, 1000, false},
/* Navi10 XNACK */{ "", "", 4, 16, 1, 256, 64 * Ki, 32, 1000, true},
/* Navi10 */{ "", "", 4, 16, 1, 256, 64 * Ki, 32, 1010, false},
/* Navi10 XNACK */{ "", "", 4, 16, 1, 256, 64 * Ki, 32, 1010, true},
/* Navi10Lite */{ "", "", 4, 16, 1, 256, 64 * Ki, 32, 1000, false},
/* Navi10Lite XNACK */{ "", "", 4, 16, 1, 256, 64 * Ki, 32, 1000, true},
};
// Supported OpenCL versions
@@ -162,13 +162,20 @@ bool NullDevice::init() {
Pal::GfxIpLevel ipLevel = Pal::GfxIpLevel::_None;
uint ipLevelMajor = round(pal::Gfx9PlusSubDeviceInfo[id].gfxipVersion_ / 100);
uint ipLevelMinor = round(pal::Gfx9PlusSubDeviceInfo[id].gfxipVersion_ / 10 % 10);
switch (ipLevelMajor) {
case 9:
ipLevel = Pal::GfxIpLevel::GfxIp9;
break;
case 10:
switch (ipLevelMinor) {
case 0:
ipLevel = Pal::GfxIpLevel::GfxIp10;
break;
case 1:
ipLevel = Pal::GfxIpLevel::GfxIp10_1;
break;
}
}
Pal::AsicRevision revision = Pal::AsicRevision::Unknown;
@@ -192,6 +199,9 @@ bool NullDevice::init() {
revision = Pal::AsicRevision::Vega20;
break;
case 1000:
revision = Pal::AsicRevision::Navi10Lite;
break;
case 1010:
revision = Pal::AsicRevision::Navi10;
break;
}
@@ -175,6 +175,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
switch (palProp.revision) {
case Pal::AsicRevision::Unknown:
switch (palProp.gfxLevel) {
case Pal::GfxIpLevel::GfxIp10_1:
case Pal::GfxIpLevel::GfxIp10:
gfx10Plus_ = true;
case Pal::GfxIpLevel::GfxIp9:
@@ -185,6 +186,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
return false;
}
case Pal::AsicRevision::Navi10:
case Pal::AsicRevision::Navi10Lite:
gfx10Plus_ = true;
// Fall through to AI (gfx9) ...
case Pal::AsicRevision::Vega20:
@@ -445,6 +447,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
#if defined(WITH_LIGHTNING_COMPILER)
switch (palProp.gfxLevel) {
case Pal::GfxIpLevel::GfxIp10_1:
case Pal::GfxIpLevel::GfxIp10:
case Pal::GfxIpLevel::GfxIp9:
singleFpDenorm_ = true;