Changeset 4ecf91a in sasview


Ignore:
Timestamp:
Mar 30, 2019 5:32:56 AM (5 years ago)
Author:
wojciech
Branches:
master
Children:
4688acf
Parents:
b9c432ac
Message:

Fixes for opencl info

File:
1 edited

Legend:

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

    r104613f r4ecf91a  
    2424import sasmodels.model_test 
    2525import sasmodels.sasview_model 
     26from sasmodels.generate import F32, F64 
    2627 
    2728from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
     
    257258        #The same block of code as for OK but it is needed if we want to have 
    258259        #active response to Test button 
    259         import numpy as np 
     260 
    260261        no_opencl_msg = False 
    261262        if self.sas_opencl: 
     
    270271        try: 
    271272            env = sasmodels.kernelcl.environment() 
    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) 
     273            ctx = env.context[F64].devices[0] 
     274            clinfo = ('64bit: ', ctx.platform.vendor, 
     275                      ctx.platform.version, 
     276                      ctx.vendor, 
     277                      ctx.name, 
     278                      ctx.version) 
     279            if F32 in env.context: 
     280                ctx32 = env.context[F32].devices[0] 
     281                if ctx32 != ctx: 
     282                    clinfo += ('32bit: ', ctx32.platform.vendor, 
     283                               ctx32.platform.version, 
     284                               ctx32.vendor, 
     285                               ctx32.name, 
     286                               ctx32.version) 
    283287        except Exception: 
    284288            clinfo = None 
Note: See TracChangeset for help on using the changeset viewer.