Add major/minor/stepping to device layer

Change-Id: If82ea55a46b166b243a98089a6e9c40ccfdb479f
This commit is contained in:
Jason Tang
2020-05-17 12:57:34 -04:00
parent 90c975224f
commit cd2a713d63
4 changed files with 16 additions and 5 deletions
+4
View File
@@ -460,6 +460,10 @@ struct Info : public amd::EmbeddedObject {
uint32_t localMemBanks_;
//! The core engine GFXIP version
uint32_t gfxipVersion_;
//! The core engine major/minor/stepping
uint32_t gfxipMajor_;
uint32_t gfxipMinor_;
uint32_t gfxipStepping_;
//! Number of available async queues
uint32_t numAsyncQueues_;
//! Number of available real time queues
+4
View File
@@ -666,6 +666,10 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp,
info_.gfxipVersion_ =
settings().useLightning_ ? hwInfo()->gfxipVersionLC_ : hwInfo()->gfxipVersion_;
info_.gfxipMajor_ = info_.gfxipVersion_ / 100;
info_.gfxipMinor_ = info_.gfxipVersion_ / 10 % 10;
info_.gfxipStepping_ = info_.gfxipVersion_ % 10;
info_.timeStampFrequency_ = 1000000;
info_.numAsyncQueues_ = numComputeRings;
+5 -5
View File
@@ -957,7 +957,7 @@ bool KernelBlitManager::copyBufferToImageKernel(device::Memory& srcMemory,
amd::Image* srcImage = static_cast<amd::Image*>(srcMemory.owner());
amd::Image::Format newFormat(dstImage->getImageFormat());
bool swapLayer =
(dstImage->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipVersion_ >= 1000);
(dstImage->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipMajor_ >= 10);
// Find unsupported formats
for (uint i = 0; i < RejectedFormatDataTotal; ++i) {
@@ -1149,7 +1149,7 @@ bool KernelBlitManager::copyImageToBufferKernel(device::Memory& srcMemory,
amd::Image* srcImage = static_cast<amd::Image*>(srcMemory.owner());
amd::Image::Format newFormat(srcImage->getImageFormat());
bool swapLayer =
(srcImage->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipVersion_ >= 1000);
(srcImage->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipMajor_ >= 10);
// Find unsupported formats
for (uint i = 0; i < RejectedFormatDataTotal; ++i) {
@@ -1387,14 +1387,14 @@ bool KernelBlitManager::copyImage(device::Memory& srcMemory, device::Memory& dst
// Program source origin
int32_t srcOrg[4] = {(int32_t)srcOrigin[0], (int32_t)srcOrigin[1], (int32_t)srcOrigin[2], 0};
if ((srcImage->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipVersion_ >= 1000)) {
if ((srcImage->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipMajor_ >= 10)) {
srcOrg[3] = 1;
}
setArgument(kernels_[blitType], 2, sizeof(srcOrg), srcOrg);
// Program destinaiton origin
int32_t dstOrg[4] = {(int32_t)dstOrigin[0], (int32_t)dstOrigin[1], (int32_t)dstOrigin[2], 0};
if ((dstImage->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipVersion_ >= 1000)) {
if ((dstImage->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipMajor_ >= 10)) {
dstOrg[3] = 1;
}
setArgument(kernels_[blitType], 3, sizeof(dstOrg), dstOrg);
@@ -2041,7 +2041,7 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern,
amd::Image* image = static_cast<amd::Image*>(memory.owner());
amd::Image::Format newFormat(image->getImageFormat());
bool swapLayer =
(image->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipVersion_ >= 1000);
(image->getType() == CL_MEM_OBJECT_IMAGE1D_ARRAY) && (dev().info().gfxipMajor_ >= 10);
// Program the kernels workload depending on the fill dimensions
fillType = FillImage;
+3
View File
@@ -1439,6 +1439,9 @@ bool Device::populateOCLDeviceConstants() {
info_.localMemSizePerCU_ = deviceInfo_.localMemSizePerCU_;
info_.localMemBanks_ = deviceInfo_.localMemBanks_;
info_.gfxipVersion_ = deviceInfo_.gfxipMajor_ * 100 + deviceInfo_.gfxipMinor_ * 10 + deviceInfo_.gfxipStepping_;
info_.gfxipMajor_ = deviceInfo_.gfxipMajor_;
info_.gfxipMinor_ = deviceInfo_.gfxipMinor_;
info_.gfxipStepping_ = deviceInfo_.gfxipStepping_;
info_.numAsyncQueues_ = kMaxAsyncQueues;
info_.numRTQueues_ = info_.numAsyncQueues_;
info_.numRTCUs_ = info_.maxComputeUnits_;