From 3120fb1242f5a4c055d92dd30ebb56da86e84f09 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 27 May 2016 19:13:26 -0400
Subject: [PATCH] P4 to Git Change 1274105 by gandryey@gera-w8 on 2016/05/27
19:02:25
SWDEV-95095 - Bristol Ridge parts report their OpenCL device ID name as "Carrizo"
- Detect the ASIC revision for the name swap with Bristo Ridgel instead of Carrizo
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpucompiler.cpp#154 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#548 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#168 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/backend.h#13 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#2 edit
[ROCm/clr commit: 9cbc946a1da36750a9ea4c194c7bb2379557690a]
---
projects/clr/rocclr/runtime/device/gpu/gpucompiler.cpp | 2 +-
projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp | 10 +++++++++-
.../runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp | 1 +
.../rocclr/runtime/device/gpu/gslbe/src/rt/backend.h | 1 +
projects/clr/rocclr/runtime/device/pal/palcompiler.cpp | 2 +-
5 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpucompiler.cpp b/projects/clr/rocclr/runtime/device/gpu/gpucompiler.cpp
index f51cad05cc..a541dbbb5c 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpucompiler.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpucompiler.cpp
@@ -349,7 +349,7 @@ HSAILProgram::compileImpl(
arch += "64";
}
target = aclGetTargetInfo(arch.c_str(),
- dev().info().name_, &errorCode);
+ dev().hwInfo()->targetName_, &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/gpu/gpudevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
index 2a6daa1dcf..aeef022c3e 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
@@ -17,6 +17,7 @@
#include "device/gpu/gpubinary.hpp"
#include "device/gpu/gpusettings.hpp"
#include "device/gpu/gpublit.hpp"
+#include "cz_id.h"
#include "acl.h"
@@ -455,7 +456,14 @@ NullDevice::fillDeviceInfo(
info_.platform_ = AMD_PLATFORM;
- ::strcpy(info_.name_, hwInfo()->targetName_);
+ if ((calTarget() == CAL_TARGET_CARRIZO) &&
+ ASICREV_IS_CARRIZO_BRISTOL(calAttr.asicRevision)) {
+ const static char* bristol = "Bristol Ridge";
+ ::strcpy(info_.name_, bristol);
+ }
+ else {
+ ::strcpy(info_.name_, hwInfo()->targetName_);
+ }
::strcpy(info_.vendor_, "Advanced Micro Devices, Inc.");
::snprintf(info_.driverVersion_, sizeof(info_.driverVersion_) - 1,
AMD_BUILD_STRING "%s", " (VM)");
diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
index f4617d10ea..40c6d1a4a7 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
@@ -120,6 +120,7 @@ CALGSLDevice::getAttribs_int(gsl::gsCtx* cs)
m_attribs.isSVMFineGrainSystem = m_adp->pAsicInfo->svmFineGrainSystem;
m_attribs.isWDDM2Enabled = m_adp->pAsicInfo->vaAvailable && m_adp->pAsicInfo->bNoVATranslation;
m_attribs.maxRTCUs = cs->getMaxRTCUs();
+ m_attribs.asicRevision = cs->getChipRev();
}
bool
diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/backend.h b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/backend.h
index f94332bcf8..84c9cfe3ca 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/backend.h
+++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/backend.h
@@ -85,6 +85,7 @@ typedef struct CALdeviceattribsRec {
bool isSVMFineGrainSystem; /**< check if SVM finegrainsystem */
bool isWDDM2Enabled; /**< check if WDDM2 is enabled */
CALuint maxRTCUs; /**< The maximum number of RT CUs for RT queues */
+ CALuint asicRevision; /**< The ASIC revision ID */
} CALdeviceattribs;
diff --git a/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp b/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp
index c7320ed45e..24b1b27750 100644
--- a/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp
@@ -34,7 +34,7 @@ HSAILProgram::compileImpl(
arch += "64";
}
target = aclGetTargetInfo(arch.c_str(),
- dev().info().name_, &errorCode);
+ dev().hwInfo()->targetName_, &errorCode);
// end if asic info is ready
// We dump the source code for each program (param: headers)