Changeset 880a2ed in sasmodels for sasmodels/kernelcl.py


Ignore:
Timestamp:
Sep 5, 2016 5:15:21 AM (8 years ago)
Author:
wojciech
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
Message:

Handling for SAS_OPENCL enviromental variable added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    r14a15a3 r880a2ed  
    3737Once you have done that, it will show the available drivers which you 
    3838can select.  It will then tell you that you can use these drivers 
    39 automatically by setting the PYOPENCL_CTX environment variable. 
     39automatically by setting the SAS_OPENCL environment variable, which is 
     40PYOPENCL_CTX equivalent but not conflicting with other pyopnecl programs. 
    4041 
    4142Some graphics cards have multiple devices on the same card.  You cannot 
     
    227228 
    228229        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"] 
    230233            self._create_some_context() 
    231234 
     
    271274        """ 
    272275        Protected call to cl.create_some_context without interactivity.  Use 
    273         this if PYOPENCL_CTX is set in the environment.  Sets the *context* 
     276        this if SAS_OPENCL is set in the environment.  Sets the *context* 
    274277        attribute. 
    275278        """ 
     
    279282            warnings.warn(str(exc)) 
    280283            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") 
    282285 
    283286    def compile_program(self, name, source, dtype, fast, timestamp): 
Note: See TracChangeset for help on using the changeset viewer.