From 21b471a76d62bf79d4765872a2209de406ed46b1 Mon Sep 17 00:00:00 2001
From: Shane-J-Latham <shane.latham@anu.edu.au>
Date: Tue, 14 Jun 2016 09:30:37 +1000
Subject: [PATCH] Build error fix for when CL_USE_SHIPPED_EXT=False and
 CL/cl_ext.h doesn't define cl_device_topology_amd struct.

---
 src/c_wrapper/pyopencl_ext.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/c_wrapper/pyopencl_ext.h b/src/c_wrapper/pyopencl_ext.h
index 48e9444c..4b5e7871 100644
--- a/src/c_wrapper/pyopencl_ext.h
+++ b/src/c_wrapper/pyopencl_ext.h
@@ -16,6 +16,16 @@
 #include <CL/cl.h>
 #include <CL/cl_ext.h>
 
+#ifndef CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD
+#define CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD        1
+
+typedef union
+{
+    struct { cl_uint type; cl_uint data[5]; } raw;
+    struct { cl_uint type; cl_char unused[17]; cl_char bus; cl_char device; cl_char function; } pcie;
+} cl_device_topology_amd;
+#endif
+
 #endif
 
 #endif
-- 
GitLab