Changeset 880a2ed in sasmodels
- Timestamp:
- Sep 5, 2016 7:15:21 AM (8 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:
- 27fc92f
- Parents:
- fe77343
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/core.py
rfe77343 r880a2ed 21 21 from . import kernelpy 22 22 from . import kerneldll 23 try: 24 from . import kernelcl 25 HAVE_OPENCL = True 26 except Exception: 23 24 if "SAS_OPENCL" not in os.environ: 27 25 HAVE_OPENCL = False 26 else: 27 try: 28 from . import kernelcl 29 HAVE_OPENCL = True 30 except Exception: 31 HAVE_OPENCL = False 28 32 29 33 try: … … 219 223 # Assign default platform, overriding ocl with dll if OpenCL is unavailable 220 224 # If opencl=False OpenCL is switched off 221 # Finally one can force OpenCL calculation even if HAVE_OPENCL=False222 223 if "SAS_OPENCL" in os.environ:224 sasopencl = os.environ["SAS_OPENCL"]225 225 226 226 if platform is None: … … 228 228 if platform == "ocl" and not HAVE_OPENCL or not model_info.opencl: 229 229 platform = "dll" 230 #if model_info.opencl and not HAVE_OPENCL:231 # platform = "ocl"232 230 233 231 # Check if type indicates dll regardless of which platform is given -
sasmodels/kernelcl.py
r14a15a3 r880a2ed 37 37 Once you have done that, it will show the available drivers which you 38 38 can select. It will then tell you that you can use these drivers 39 automatically by setting the PYOPENCL_CTX environment variable. 39 automatically by setting the SAS_OPENCL environment variable, which is 40 PYOPENCL_CTX equivalent but not conflicting with other pyopnecl programs. 40 41 41 42 Some graphics cards have multiple devices on the same card. You cannot … … 227 228 228 229 self.context = None 229 if 'PYOPENCL_CTX' in os.environ: 230 if 'SAS_OPENCL' in os.environ: 231 #Setting PYOPENCL_CTX as a SAS_OPENCL to create cl context 232 os.environ["PYOPENCL_CTX"] = os.environ["SAS_OPENCL"] 230 233 self._create_some_context() 231 234 … … 271 274 """ 272 275 Protected call to cl.create_some_context without interactivity. Use 273 this if PYOPENCL_CTXis set in the environment. Sets the *context*276 this if SAS_OPENCL is set in the environment. Sets the *context* 274 277 attribute. 275 278 """ … … 279 282 warnings.warn(str(exc)) 280 283 warnings.warn("pyopencl.create_some_context() failed") 281 warnings.warn("the environment variable ' PYOPENCL_CTX' might not be set correctly")284 warnings.warn("the environment variable 'SAS_OPENCL' might not be set correctly") 282 285 283 286 def compile_program(self, name, source, dtype, fast, timestamp):
Note: See TracChangeset
for help on using the changeset viewer.