Merge pull request #286 from gargrahul/fix_hipDeviceGetAttribute_nvcc

Fix hipGetDeviceAttribute dtest for HIP/NVCC

[ROCm/clr commit: 574797cdff]
This commit is contained in:
Maneesh Gupta
2017-12-12 12:49:23 +05:30
کامیت شده توسط GitHub
کامیت f1cf09174c
2فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
@@ -597,6 +597,10 @@ inline static hipError_t hipGetDeviceProperties(hipDeviceProp_t *p_prop, int dev
p_prop->arch.hasDynamicParallelism = (ccVers >= 350);
p_prop->concurrentKernels = cdprop.concurrentKernels;
p_prop->pciBusID = cdprop.pciBusID;
p_prop->pciDeviceID = cdprop.pciDeviceID;
p_prop->maxSharedMemoryPerMultiProcessor = cdprop.sharedMemPerMultiprocessor;
p_prop->isMultiGpuBoard = cdprop.isMultiGpuBoard;
return hipCUDAErrorTohipError(cerror);
}
@@ -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;
}