Changes in / [b26d4c8:025c82d] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelcl.py
rc094758 r4f9d3fd 75 75 76 76 77 # Pragmas for enable OpenCL features. Be sure to protect them so that they 78 # still compile even if OpenCL is not present. 79 _F16_PRAGMA = """\ 80 #if defined(__OPENCL_VERSION__) // && !defined(cl_khr_fp16) 81 # pragma OPENCL EXTENSION cl_khr_fp16: enable 82 #endif 83 """ 84 85 _F64_PRAGMA = """\ 86 #if defined(__OPENCL_VERSION__) // && !defined(cl_khr_fp64) 87 # pragma OPENCL EXTENSION cl_khr_fp64: enable 88 #endif 89 """ 90 91 77 92 ENV = None 78 93 def environment(): … … 142 157 raise RuntimeError("%s not supported for devices"%dtype) 143 158 144 source = generate.convert_type(source, dtype) 159 source_list = [generate.convert_type(source, dtype)] 160 161 if dtype == generate.F16: 162 source_list.insert(0, _F16_PRAGMA) 163 elif dtype == generate.F64: 164 source_list.insert(0, _F64_PRAGMA) 165 145 166 # Note: USE_SINCOS makes the intel cpu slower under opencl 146 167 if context.devices[0].type == cl.device_type.GPU: 147 source = "#define USE_SINCOS\n" + source168 source_list.insert(0, "#define USE_SINCOS\n") 148 169 options = (get_fast_inaccurate_build_options(context.devices[0]) 149 170 if fast else []) 171 source = "\n".join(source) 150 172 program = cl.Program(context, source).build(options=options) 151 173 return program
Note: See TracChangeset
for help on using the changeset viewer.