From 72000beb84fef35348f81f1fb4105d6071eaedac Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 16 Sep 2019 17:58:06 -0400
Subject: [PATCH] P4 to Git Change 1998982 by cpaquot@cpaquot-ocl-lc-lnx on
2019/09/16 17:49:10
SWDEV-145570 - [HIP] Fix regression from new headers.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_device.cpp#23 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_device_runtime.cpp#18 edit
---
hipamd/api/hip/hip_device.cpp | 5 +++++
hipamd/api/hip/hip_device_runtime.cpp | 15 +++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/hipamd/api/hip/hip_device.cpp b/hipamd/api/hip/hip_device.cpp
index 010e46a33b..4dfb447404 100644
--- a/hipamd/api/hip/hip_device.cpp
+++ b/hipamd/api/hip/hip_device.cpp
@@ -208,6 +208,11 @@ hipError_t hipGetDeviceProperties ( hipDeviceProp_t* props, hipDevice_t device )
deviceProps.hdpMemFlushCntl = nullptr;
deviceProps.hdpRegFlushCntl = nullptr;
+ deviceProps.memPitch = info.maxMemAllocSize_;
+ deviceProps.textureAlignment = std::max(info.imageBaseAddressAlignment_, info.imagePitchAlignment_);
+ deviceProps.kernelExecTimeoutEnabled = 0;
+ deviceProps.ECCEnabled = info.errorCorrectionSupport_? 1:0;
+
*props = deviceProps;
HIP_RETURN(hipSuccess);
}
diff --git a/hipamd/api/hip/hip_device_runtime.cpp b/hipamd/api/hip/hip_device_runtime.cpp
index a039dced3e..6aa9eae29e 100644
--- a/hipamd/api/hip/hip_device_runtime.cpp
+++ b/hipamd/api/hip/hip_device_runtime.cpp
@@ -265,6 +265,21 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device)
case hipDeviceAttributeHdpRegFlushCntl:
*reinterpret_cast(pi) = prop.hdpRegFlushCntl;
break;
+ case hipDeviceAttributeMaxPitch:
+ *pi = prop.memPitch;
+ break;
+ case hipDeviceAttributeTextureAlignment:
+ *pi = prop.textureAlignment;
+ break;
+ case hipDeviceAttributeKernelExecTimeout:
+ *pi = prop.kernelExecTimeoutEnabled;
+ break;
+ case hipDeviceAttributeCanMapHostMemory:
+ *pi = prop.canMapHostMemory;
+ break;
+ case hipDeviceAttributeEccEnabled:
+ *pi = prop.ECCEnabled;
+ break;
default:
HIP_RETURN(hipErrorInvalidValue);
}