Changeset 5464d68 in sasmodels
- Timestamp:
- Mar 20, 2016 4:55:33 PM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 4f9d3fd
- Parents:
- cf52f9c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelcl.py
rc094758 r5464d68 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 166 145 167 # Note: USE_SINCOS makes the intel cpu slower under opencl 146 168 if context.devices[0].type == cl.device_type.GPU: 147 source = "#define USE_SINCOS\n" + source169 source_list.insert(0, "#define USE_SINCOS\n") 148 170 options = (get_fast_inaccurate_build_options(context.devices[0]) 149 171 if fast else []) 172 source = "\n".join(source) 150 173 program = cl.Program(context, source).build(options=options) 151 174 return program
Note: See TracChangeset
for help on using the changeset viewer.