Fix hipGetDeviceAttribute dtest for HIP/NVCC

[ROCm/hip commit: 0782c52271]
This commit is contained in:
Rahul Garg
2017-12-06 15:49:06 +05:30
parent 0835c6f2db
commit 89d9f8ae1c
2 changed files with 7 additions and 3 deletions
@@ -39,14 +39,14 @@ THE SOFTWARE.
exit(EXIT_FAILURE);\
}
hipError_t test_hipDeviceGetAttribute(int deviceId, hipDeviceAttribute_t attr, int expectedValue = 0)
hipError_t test_hipDeviceGetAttribute(int deviceId, hipDeviceAttribute_t attr, int expectedValue = -1)
{
int value = 0;
std::cout << "Test hipDeviceGetAttribute attribute " << attr;
if (expectedValue) { std::cout << " expected value " << expectedValue; }
if (expectedValue != -1) { std::cout << " expected value " << expectedValue; }
hipError_t e = hipDeviceGetAttribute(&value, attr, deviceId);
std::cout << " actual value " << value << std::endl;
if (expectedValue && value != expectedValue) {
if ((expectedValue != -1) && value != expectedValue) {
std::cout << "fail" << std::endl;
return hipErrorInvalidValue;
}