Changeset 104613f in sasview


Ignore:
Timestamp:
Mar 29, 2019 11:16:28 AM (5 years ago)
Author:
wojciech
Branches:
master
Children:
b9c432ac
Parents:
09d7021
Message:

fixing opencl driver issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/gpu_options.py

    r895703d r104613f  
    257257        #The same block of code as for OK but it is needed if we want to have 
    258258        #active response to Test button 
     259        import numpy as np 
    259260        no_opencl_msg = False 
    260261        if self.sas_opencl: 
     
    269270        try: 
    270271            env = sasmodels.kernelcl.environment() 
    271             clinfo = [(ctx.devices[0].platform.vendor, 
    272                        ctx.devices[0].platform.version, 
    273                        ctx.devices[0].vendor, 
    274                        ctx.devices[0].name, 
    275                        ctx.devices[0].version) 
    276                       for ctx in env.context] 
     272            dtype64 = np.dtype('float64') 
     273            dtype32 = np.dtype('float32') 
     274            if dtype64 in env.context: 
     275                ctx = env.context[dtype64].devices[0] 
     276            else: 
     277                ctx = env.context[dtype32].devices[0] 
     278            clinfo = (ctx.platform.vendor, 
     279                        ctx.platform.version, 
     280                        ctx.vendor, 
     281                        ctx.name, 
     282                        ctx.version) 
    277283        except Exception: 
    278284            clinfo = None 
Note: See TracChangeset for help on using the changeset viewer.