summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhil Joshi <nikhilj@nvidia.com>2019-10-04 06:20:10 +0530
committerNikhil Joshi <nikhilj@nvidia.com>2019-10-04 06:51:34 +0530
commit53f2054575ba77816cfb2157a5452cbf109dd0e5 (patch)
tree7f12cc8c2054f07df96cf756823bba5cbdc159e8
parente8b332d24cf2daa906af84f3f01b3304c582e78c (diff)
downloadOpenCL-ICD-Loader-53f2054575ba77816cfb2157a5452cbf109dd0e5.tar.gz
OpenCL-ICD-Loader-53f2054575ba77816cfb2157a5452cbf109dd0e5.tar.bz2
OpenCL-ICD-Loader-53f2054575ba77816cfb2157a5452cbf109dd0e5.zip
Refactor ICD loader windows header files
Add icd_windows.h to include Windows specific types and functions. Keep icd_windows_hkr.h and icd_windows_dxgk.h limited to the HKR and DXGK specific information.
-rw-r--r--CMakeLists.txt1
-rw-r--r--loader/windows/icd_windows.c1
-rw-r--r--loader/windows/icd_windows.h27
-rw-r--r--loader/windows/icd_windows_dxgk.h1
-rw-r--r--loader/windows/icd_windows_hkr.h9
5 files changed, 31 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21da30d..4bafa86 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,6 +51,7 @@ set (OPENCL_ICD_LOADER_SOURCES
if (WIN32)
list (APPEND OPENCL_ICD_LOADER_SOURCES
loader/windows/icd_windows.c
+ loader/windows/icd_windows.h
loader/windows/icd_windows_dxgk.c
loader/windows/icd_windows_dxgk.h
loader/windows/icd_windows_envvars.c
diff --git a/loader/windows/icd_windows.c b/loader/windows/icd_windows.c
index 12c251a..c80615d 100644
--- a/loader/windows/icd_windows.c
+++ b/loader/windows/icd_windows.c
@@ -17,6 +17,7 @@
*/
#include "icd.h"
+#include "icd_windows.h"
#include "icd_windows_hkr.h"
#include "icd_windows_dxgk.h"
#include <stdio.h>
diff --git a/loader/windows/icd_windows.h b/loader/windows/icd_windows.h
new file mode 100644
index 0000000..48bbf13
--- /dev/null
+++ b/loader/windows/icd_windows.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017-2019 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * OpenCL is a trademark of Apple Inc. used under license by Khronos.
+ */
+
+#include <stdbool.h>
+#include <windows.h>
+
+extern const LUID ZeroLuid;
+
+BOOL adapterAdd(const char* szName, LUID luid);
+
+// Do not free the memory returned by this function.
+const char* getOpenCLRegKeyName(void);
diff --git a/loader/windows/icd_windows_dxgk.h b/loader/windows/icd_windows_dxgk.h
index f6cb65d..34bad64 100644
--- a/loader/windows/icd_windows_dxgk.h
+++ b/loader/windows/icd_windows_dxgk.h
@@ -17,5 +17,6 @@
*/
#include <stdbool.h>
+#include "icd_windows.h"
bool khrIcdOsVendorsEnumerateDXGK(void);
diff --git a/loader/windows/icd_windows_hkr.h b/loader/windows/icd_windows_hkr.h
index 039da05..e0db713 100644
--- a/loader/windows/icd_windows_hkr.h
+++ b/loader/windows/icd_windows_hkr.h
@@ -17,13 +17,6 @@
*/
#include <stdbool.h>
-#include <windows.h>
+#include "icd_windows.h"
bool khrIcdOsVendorsEnumerateHKR(void);
-
-extern const LUID ZeroLuid;
-
-BOOL adapterAdd(const char* szName, LUID luid);
-
-// Do not free the memory returned by this function.
-const char* getOpenCLRegKeyName(void);