From c6de2979130d2b3294b7102488e5ec7ec5411017 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 22 Apr 2011 18:58:42 -0400 Subject: [PATCH] Add constants for cl_khr_fp{16,64}. --- doc/make_constants.py | 5 +++++ src/wrapper/wrap_cl.hpp | 6 ++++++ src/wrapper/wrap_constants.cpp | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/doc/make_constants.py b/doc/make_constants.py index 3e92d05e..d50da9a3 100644 --- a/doc/make_constants.py +++ b/doc/make_constants.py @@ -57,6 +57,11 @@ const_ext_lookup = { ("cl_nv_device_attribute_query", "0.92"), getattr(devi, "INTEGRATED_MEMORY_NV", None): ("cl_nv_device_attribute_query", "0.92"), + + getattr(devi, "DOUBLE_FP_CONFIG", None): + ("cl_khr_fp64", "2011.1"), + getattr(devi, "HALF_FP_CONFIG", None): + ("cl_khr_fp16", "2011.1"), }, ctxp: { diff --git a/src/wrapper/wrap_cl.hpp b/src/wrapper/wrap_cl.hpp index a0c840be..1b1580a8 100644 --- a/src/wrapper/wrap_cl.hpp +++ b/src/wrapper/wrap_cl.hpp @@ -500,6 +500,12 @@ namespace pyopencl case CL_DEVICE_MEM_BASE_ADDR_ALIGN: DEV_GET_INT_INF(cl_uint); case CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE: DEV_GET_INT_INF(cl_uint); case CL_DEVICE_SINGLE_FP_CONFIG: DEV_GET_INT_INF(cl_device_fp_config); +#ifdef CL_DEVICE_DOUBLE_FP_CONFIG + case CL_DEVICE_DOUBLE_FP_CONFIG: DEV_GET_INT_INF(cl_device_fp_config); +#endif +#ifdef CL_DEVICE_HALF_FP_CONFIG + case CL_DEVICE_HALF_FP_CONFIG: DEV_GET_INT_INF(cl_device_fp_config); +#endif case CL_DEVICE_GLOBAL_MEM_CACHE_TYPE: DEV_GET_INT_INF(cl_device_mem_cache_type); case CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE: DEV_GET_INT_INF(cl_uint); diff --git a/src/wrapper/wrap_constants.cpp b/src/wrapper/wrap_constants.cpp index ab2468f7..39cdec38 100644 --- a/src/wrapper/wrap_constants.cpp +++ b/src/wrapper/wrap_constants.cpp @@ -150,6 +150,12 @@ void pyopencl_expose_constants() ADD_ATTR(DEVICE_, MEM_BASE_ADDR_ALIGN); ADD_ATTR(DEVICE_, MIN_DATA_TYPE_ALIGN_SIZE); ADD_ATTR(DEVICE_, SINGLE_FP_CONFIG); +#ifdef CL_DEVICE_DOUBLE_FP_CONFIG + ADD_ATTR(DEVICE_, DOUBLE_FP_CONFIG); +#endif +#ifdef CL_DEVICE_HALF_FP_CONFIG + ADD_ATTR(DEVICE_, HALF_FP_CONFIG); +#endif ADD_ATTR(DEVICE_, GLOBAL_MEM_CACHE_TYPE); ADD_ATTR(DEVICE_, GLOBAL_MEM_CACHELINE_SIZE); ADD_ATTR(DEVICE_, GLOBAL_MEM_CACHE_SIZE); -- GitLab