From 5a28e9f798accb34b7376d91d63dc2fb87dbbb23 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 19 Apr 2017 19:41:26 -0400
Subject: [PATCH] P4 to Git Change 1400271 by weizhang@weizhang-lnx-opencl-lc
on 2017/04/19 17:55:28
SWDEV-112857 - OpenCL Work to Support Unified ROCm / Orca Builds
1. Rename OCL runtime to libvega10ocl[64][32] for supporting vega10 with OCL/ROCR
2. Pre-vega10 devices won't be reported on OCL/ROCR.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#151 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_icd.cpp#28 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#49 edit
... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#40 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#272 edit
[ROCm/clr commit: 7f4a5487de984ffcf6cf023112013a133893742b]
---
projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp b/projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp
index 167b48b95a..8c73752645 100644
--- a/projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp
+++ b/projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp
@@ -213,6 +213,12 @@ CL_API_ENTRY cl_int CL_API_CALL clIcdGetPlatformIDsKHR(cl_uint num_entries,
}
if (num_platforms != NULL && platforms == NULL) {
+ int numDevices = amd::Device::numDevices(CL_DEVICE_TYPE_CPU, false) +
+ amd::Device::numDevices(CL_DEVICE_TYPE_GPU, false);
+ if (numDevices == 0) {
+ *num_platforms = 0;
+ return CL_INVALID_PLATFORM;
+ }
*num_platforms = 1;
return CL_SUCCESS;
}