- Timestamp:
- Jan 13, 2017 1:58:07 AM (8 years ago)
- Children:
- 506bca3
- Parents:
- 65d1d04
- git-author:
- wpotrzebowski <Wojciech.Potrzebowski@…> (01/13/17 01:56:27)
- git-committer:
- wpotrzebowski <Wojciech.Potrzebowski@…> (01/13/17 01:58:07)
- Location:
- src/sas/sasgui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/gui_manager.py
re2c0939 r1b061a31 2116 2116 2117 2117 def _write_opencl_config_file(self): 2118 #from sas.sasgui.guiframe.customdir import SetupCustom 2119 #from sas.sasgui.guiframe.gui_manager import _find_local_config 2120 2121 sas_opencl = os.environ.get("SAS_OPENCL",None) 2122 #How to store it in file 2123 new_config_lines = [] 2124 config_file = open(custom_config.__file__) 2118 """ 2119 Writes OpenCL settings to custom config file, so they can be remmbered 2120 from session to session 2121 """ 2125 2122 if custom_config is not None: 2123 sas_opencl = os.environ.get("SAS_OPENCL",None) 2124 new_config_lines = [] 2125 config_file = open(custom_config.__file__) 2126 2126 config_lines = config_file.readlines() 2127 2127 for line in config_lines: … … 2133 2133 else: 2134 2134 new_config_lines.append(line) 2135 config_file.close() 2136 new_config_file = open(custom_config.__file__,"w") 2137 new_config_file.writelines(new_config_lines) 2138 new_config_file.close() 2135 config_file.close() 2136 2137 #If custom_config is None, settings will not be remmbered 2138 new_config_file = open(custom_config.__file__,"w") 2139 new_config_file.writelines(new_config_lines) 2140 new_config_file.close() 2141 else: 2142 logging.info("Failed to save OPENCL settings in custom config file") 2139 2143 2140 2144 -
src/sas/sasgui/guiframe/startup_configuration.py
r2a1b92eb r1b061a31 46 46 'CLEANUP_PLOT':CURRENT.CLEANUP_PLOT, 47 47 'DEFAULT_PERSPECTIVE':CURRENT.DEFAULT_PERSPECTIVE, 48 'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDE ,48 'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER, 49 49 'SAS_OPENCL': None} 50 50 except: -
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.