From b671e11afd75c251479daa734a51f1fb7e8a3b8b Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 17 Aug 2018 14:28:54 -0400
Subject: [PATCH] P4 to Git Change 1595124 by
skudchad@skudchad_test2_win_opencl on 2018/08/17 14:05:25
SWDEV-145570 - [HIP] Implement environment variables and subsequent changes for HIP. This gets hipEnvVar passing
ReviewBoardURL = http://ocltc.amd.com/reviews/r/15641/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_device.cpp#15 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#224 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#310 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#104 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#95 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#297 edit
[ROCm/clr commit: f61e9b7c1264a300774061f462cd20331587ca79]
---
projects/clr/hipamd/api/hip/hip_device.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/projects/clr/hipamd/api/hip/hip_device.cpp b/projects/clr/hipamd/api/hip/hip_device.cpp
index 30ad2f3af1..4da7e42f4c 100644
--- a/projects/clr/hipamd/api/hip/hip_device.cpp
+++ b/projects/clr/hipamd/api/hip/hip_device.cpp
@@ -96,8 +96,10 @@ hipError_t ihipDeviceGetCount(int* count) {
return hipErrorInvalidValue;
}
+ auto* deviceHandle = g_devices[0]->devices()[0];
+
// Get all available devices
- *count = g_devices.size();
+ *count = deviceHandle->isOrdinalValid() ? g_devices.size() : 0;
return hipSuccess;
}