Ignore:
Timestamp:
Mar 30, 2019 12:31:38 AM (5 years ago)
Author:
wojciech
Branches:
master
Children:
4ecf91a
Parents:
104613f (diff), 332c10d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://github.com/SasView/sasview into ticket-1267

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.