From c1c5af0932aaaaa33fd0bf3e2c1cfb97c2b6db57 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 10 Aug 2018 14:24:27 -0500 Subject: [PATCH] [pybind] Bring back custom ext header --- src/pyopencl_ext.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++ src/wrap_cl.hpp | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/pyopencl_ext.h diff --git a/src/pyopencl_ext.h b/src/pyopencl_ext.h new file mode 100644 index 00000000..a9792d8b --- /dev/null +++ b/src/pyopencl_ext.h @@ -0,0 +1,58 @@ +#ifndef _PYOPENCL_EXT_H +#define _PYOPENCL_EXT_H + +#ifdef PYOPENCL_USE_SHIPPED_EXT + +#include "clinfo_ext.h" + +#else + +#if (defined(__APPLE__) && !defined(PYOPENCL_APPLE_USE_CL_H)) + +#include + +#else + +#include +#include + +#endif + +#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 + +/* {{{ these NV defines are often missing from the system headers */ + +#ifndef CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV +#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005 +#endif +#ifndef CL_DEVICE_INTEGRATED_MEMORY_NV +#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006 +#endif + +#ifndef CL_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT_NV +#define CL_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT_NV 0x4007 +#endif + +#ifndef CL_DEVICE_PCI_BUS_ID_NV +#define CL_DEVICE_PCI_BUS_ID_NV 0x4008 +#endif + +#ifndef CL_DEVICE_PCI_SLOT_ID_NV +#define CL_DEVICE_PCI_SLOT_ID_NV 0x4009 +#endif + +/* }}} */ + +#endif + +#endif + +/* vim: foldmethod=marker */ diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp index 297186de..9488a715 100644 --- a/src/wrap_cl.hpp +++ b/src/wrap_cl.hpp @@ -28,7 +28,7 @@ #define CL_TARGET_OPENCL_VERSION 220 #include -#include +#include "pyopencl_ext.h" #if defined(_WIN32) #define NOMINMAX -- GitLab