Changeset ebaaf05 in sasview
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/gpu_options.py
r4139147 rebaaf05 38 38 #Check if SAS_OPENCL is already set 39 39 self.sas_opencl = os.environ.get("SAS_OPENCL","") 40 for index, clopt in enumerate(clinfo): 41 button = wx.CheckBox(self.panel1, -1, label=clopt, name=clopt) 40 for clopt in clinfo: 41 print("clopt",clopt) 42 button = wx.CheckBox(self.panel1, -1, label=clopt[1], name=clopt[1]) 42 43 43 44 if clopt != "No OpenCL": 44 self.option_button[clopt ] = str(index)45 if self.sas_opencl == str(index):45 self.option_button[clopt[1]] = clopt[0] 46 if self.sas_opencl == clopt[0]: 46 47 button.SetValue(1) 47 48 else: … … 102 103 try: 103 104 import pyopencl as cl 104 for platform in cl.get_platforms(): 105 platforms = cl.get_platforms() 106 p_index = 0 107 for platform in platforms: 108 d_index = 0 105 109 for device in platform.get_devices(): 106 clinfo.append(":".join([platform.name,device.name])) 110 combined_index = ":".join(str(p_index),str(d_index)) \ 111 if len(platforms) > 1 else str(d_index) 112 clinfo.append((combined_index, ":".join([platform.name,device.name]))) 113 d_index+=1 114 p_index+=1 107 115 except ImportError: 108 116 warnings.warn("pyopencl import failed. Using only CPU computations") 109 117 110 clinfo.append( "No OpenCL")118 clinfo.append(("None","No OpenCL")) 111 119 return clinfo 112 120
Note: See TracChangeset
for help on using the changeset viewer.