Added query of hipDeviceAttributeHdpMemFlushCntl and hipDeviceAttribu… (#1238)

* Added query of hipDeviceAttributeHdpMemFlushCntl and hipDeviceAttributeHdpRegFlushCntl

* Added NVCC blocker for the hip*FlushCntl test cases
This commit is contained in:
wkwchau
2019-08-01 12:03:35 -04:00
committed by Maneesh Gupta
parent adc95002c6
commit e7447d5809
4 changed files with 46 additions and 2 deletions
@@ -56,6 +56,22 @@ hipError_t test_hipDeviceGetAttribute(int deviceId, hipDeviceAttribute_t attr,
return hipSuccess;
}
hipError_t test_hipDeviceGetHdpAddress(int deviceId, hipDeviceAttribute_t attr,
uint32_t* expectedValue = (uint32_t*)0xdeadbeef) {
uint32_t* value = 0;
std::cout << "Test hipDeviceGetHdpAddress attribute " << attr;
if (expectedValue != (uint32_t*)0xdeadbeef) {
std::cout << " expected value " << expectedValue;
}
hipError_t e = hipDeviceGetAttribute((int*) &value, attr, deviceId);
std::cout << " actual value " << value << std::endl;
if ((expectedValue != (uint32_t*)0xdeadbeef) && value != expectedValue) {
std::cout << "fail" << std::endl;
return hipErrorInvalidValue;
}
return hipSuccess;
}
int main(int argc, char* argv[]) {
int deviceId;
CHECK(hipGetDevice(&deviceId));
@@ -116,5 +132,9 @@ int main(int argc, char* argv[]) {
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMaxTexture3DWidth, props.maxTexture3D[0]));
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMaxTexture3DHeight, props.maxTexture3D[1]));
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMaxTexture3DDepth, props.maxTexture3D[2]));
#ifndef __HIP_PLATFORM_NVCC__
CHECK(test_hipDeviceGetHdpAddress(deviceId, hipDeviceAttributeHdpMemFlushCntl, props.hdpMemFlushCntl));
CHECK(test_hipDeviceGetHdpAddress(deviceId, hipDeviceAttributeHdpRegFlushCntl, props.hdpRegFlushCntl));
#endif
passed();
};