Skip to content

Commit

Permalink
Re-fix fp64 warning avoidance
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Jun 29, 2014
1 parent d1d4f1e commit 3a4f4d8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
9 changes: 1 addition & 8 deletions pyopencl/_cluda.py
Expand Up @@ -20,9 +20,6 @@
THE SOFTWARE.
"""




CLUDA_PREAMBLE = """
#define local_barrier() barrier(CLK_LOCAL_MEM_FENCE);
Expand Down Expand Up @@ -50,12 +47,8 @@
#define GDIM_2 get_num_groups(2)
% if double_support:
#if __OPENCL_VERSION__ <= CL_VERSION_1_1
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
% endif
"""




2 changes: 1 addition & 1 deletion pyopencl/algorithm.py
Expand Up @@ -558,7 +558,7 @@ def __call__(self, *args, **kwargs):

_LIST_BUILDER_TEMPLATE = Template("""//CL//
% if double_support:
#if __OPENCL_VERSION__ <= CL_VERSION_1_1
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
#define PYOPENCL_DEFINE_CDOUBLE
Expand Down
2 changes: 1 addition & 1 deletion pyopencl/clrandom.py
Expand Up @@ -168,7 +168,7 @@ def generate_settings_defines(self, include_double_pragma=True):
lines = []
if include_double_pragma and self.support_double:
lines.append("""
#if __OPENCL_VERSION__ <= CL_VERSION_1_1
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
""")
Expand Down
6 changes: 3 additions & 3 deletions pyopencl/elementwise.py
Expand Up @@ -127,7 +127,7 @@ def get_elwise_kernel_and_types(context, arguments, operation,
if arg.dtype in [np.float64, np.complex128]:
if not have_double_pragma:
pragmas.append("""
#if __OPENCL_VERSION__ <= CL_VERSION_1_1
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
#define PYOPENCL_DEFINE_CDOUBLE
Expand Down Expand Up @@ -846,7 +846,7 @@ def get_float_binary_func_kernel(context, func_name, x_dtype, y_dtype,
if (np.array(0, x_dtype) * np.array(0, y_dtype)).itemsize > 4:
arg_type = 'double'
preamble = """
#if __OPENCL_VERSION__ <= CL_VERSION_1_1
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
#define PYOPENCL_DEFINE_CDOUBLE
Expand Down Expand Up @@ -920,7 +920,7 @@ def get_bessel_kernel(context, which_func, out_dtype=np.float64,
"z[i] = bessel_%sn(ord_n, x[i])" % which_func,
name="bessel_%sn_kernel" % which_func,
preamble="""
#if __OPENCL_VERSION__ <= CL_VERSION_1_1
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
#define PYOPENCL_DEFINE_CDOUBLE
Expand Down
2 changes: 1 addition & 1 deletion pyopencl/reduction.py
Expand Up @@ -47,7 +47,7 @@
#define REDUCE(a, b) (${reduce_expr})
% if double_support:
#if __OPENCL_VERSION__ <= CL_VERSION_1_1
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
#define PYOPENCL_DEFINE_CDOUBLE
Expand Down
2 changes: 1 addition & 1 deletion pyopencl/tools.py
Expand Up @@ -506,7 +506,7 @@ def get_declarations(self):
if self.saw_double:
result = (
"""
#if __OPENCL_VERSION__ <= CL_VERSION_1_1
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
#define PYOPENCL_DEFINE_CDOUBLE
Expand Down

0 comments on commit 3a4f4d8

Please sign in to comment.