diff --git a/src/pyopencl_ext.h b/src/pyopencl_ext.h new file mode 100644 index 0000000000000000000000000000000000000000..a9792d8b07cb5be7a2def7d0b4a50941639442e1 --- /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 297186de66dcbc7793077bfdee4fac915f93fa00..9488a7155ca41a2d89c9cc4336c7e28f43b31d26 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