Changeset 7feb69d in sasview


Ignore:
Timestamp:
Dec 5, 2016 9:35:48 AM (7 years ago)
Author:
wojciech
Children:
4139147
Parents:
71ac835
Message:

Added handling for platform names

File:
1 edited

Legend:

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

    r71ac835 r7feb69d  
    6464        accept_btn = wx.Button(self, wx.ID_OK) 
    6565        accept_btn.SetToolTipString("Accept new OpenCL settings. This will" 
    66                                     "overwrite SAS_OPENCL variable if set") 
     66                                    " overwrite SAS_OPENCL variable if set") 
    6767 
    6868        help_id = wx.NewId() 
     
    9191        self.SetSizer(self.vbox) 
    9292        self.vbox.Fit(self) 
    93  
     93        self.SetTitle("OpenCL options") 
    9494        self.Centre() 
    9595 
    9696    def _get_clinfo(self): 
     97        """ 
     98        Reading in information about available OpenCL infrastructure 
     99        :return: 
     100        """ 
    97101        clinfo = [] 
    98102        try: 
     
    100104            for platform in cl.get_platforms(): 
    101105                for device in platform.get_devices(): 
    102                     clinfo.append(device.name) 
     106                    clinfo.append(":".join([platform.name,device.name])) 
    103107        except ImportError: 
    104108            warnings.warn("pyopencl import failed. Please check installation") 
     
    117121            if btn != selected_button: 
    118122                btn.SetValue(0) 
    119         self.sas_opencl = self.option_button[selected_button.Name] 
     123        if selected_button.GetValue(): 
     124            self.sas_opencl = self.option_button[selected_button.Name] 
     125        else: 
     126            self.sas_opencl = None 
    120127 
    121128    def on_OK(self, event): 
Note: See TracChangeset for help on using the changeset viewer.