Added query of hipDeviceAttributeHdpMemFlushCntl and hipDeviceAttribu… (#1238)

* Added query of hipDeviceAttributeHdpMemFlushCntl and hipDeviceAttributeHdpRegFlushCntl

* Added NVCC blocker for the hip*FlushCntl test cases


[ROCm/hip commit: e7447d5809]
Этот коммит содержится в:
wkwchau
2019-08-01 12:03:35 -04:00
коммит произвёл Maneesh Gupta
родитель 87bc7183bf
Коммит c666fdaa08
4 изменённых файлов: 46 добавлений и 2 удалений
+20
Просмотреть файл
@@ -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();
};