Changeset 1b061a31 in sasview for src/sas/sasgui/perspectives
- Timestamp:
- Jan 13, 2017 3:58:07 AM (8 years ago)
- Children:
- 506bca3
- Parents:
- 65d1d04
- git-author:
- wpotrzebowski <Wojciech.Potrzebowski@…> (01/13/17 03:56:27)
- git-committer:
- wpotrzebowski <Wojciech.Potrzebowski@…> (01/13/17 03:58:07)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/sas/sasgui/perspectives/fitting/gpu_options.py ¶
r65d1d04 r1b061a31 12 12 import warnings 13 13 import wx 14 import sasmodels 14 15 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 15 16 … … 164 165 """ 165 166 clinfo = [] 167 platforms = [] 166 168 try: 167 169 import pyopencl as cl 168 170 platforms = cl.get_platforms() 169 p_index = 0170 for platform in platforms:171 d_index = 0172 devices = platform.get_devices()173 for device in devices:174 if len(devices) > 1 and len(platforms) > 1:175 combined_index = ":".join([str(p_index), str(d_index)])176 elif len(platforms) > 1:177 combined_index = str(p_index)178 else:179 combined_index = str(d_index)180 clinfo.append((combined_index, ":".join([platform.name, device.name])))181 d_index += 1182 p_index += 1183 171 except ImportError: 184 172 warnings.warn("pyopencl import failed. Using only CPU computations") 173 174 p_index = 0 175 for platform in platforms: 176 d_index = 0 177 devices = platform.get_devices() 178 for device in devices: 179 if len(devices) > 1 and len(platforms) > 1: 180 combined_index = ":".join([str(p_index), str(d_index)]) 181 elif len(platforms) > 1: 182 combined_index = str(p_index) 183 else: 184 combined_index = str(d_index) 185 clinfo.append((combined_index, ":".join([platform.name, device.name]))) 186 d_index += 1 187 p_index += 1 185 188 186 189 clinfo.append(("None", "No OpenCL")) … … 206 209 Close window on accpetance 207 210 """ 208 import sasmodels 211 209 212 #If statement added to handle Reset 210 213 if self.sas_opencl: … … 223 226 def on_reset(self, event): 224 227 """ 225 Close window on accpetance228 Resets selected values 226 229 """ 227 230 for btn in self.buttons: … … 236 239 import json 237 240 import platform 238 import sasmodels241 #import sasmodels 239 242 240 243 #The same block of code as for OK but it is needed if we want to have
Note: See TracChangeset
for help on using the changeset viewer.