Changeset 65d1d04 in sasview for src/sas/sasgui/perspectives/fitting
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/gpu_options.py
r4320104 r65d1d04 17 17 18 18 class CustomMessageBox(wx.Dialog): 19 """ 20 Custom message box for OpenCL results 21 """ 19 22 def __init__(self, parent, msg, title): 20 23 … … 26 29 27 30 self.text = wx.TextCtrl(self, -1, size=(500, 400), 28 style=wx.TE_MULTILINE|wx.TE_READONLY)31 style=wx.TE_MULTILINE|wx.TE_READONLY) 29 32 self.text.SetValue(msg) 30 33 self.text.SetBackgroundColour(self.GetBackgroundColour()) … … 40 43 self.vbox.Add(self.panel, 0, wx.ALL, 10) 41 44 42 self.message_text = wx.StaticText(self, -1, "If tests fail on OpenCL devices, "43 "please select No OpenCL option.\n\n"44 "In case of large number of failing tests, "45 "please consider sending\n"46 "above report to help@sasview.org.")45 self.message_text = wx.StaticText(self, -1, "If tests fail on OpenCL devices, " 46 "please select No OpenCL option.\n\n" 47 "In case of large number of failing tests, " 48 "please consider sending\n" 49 "above report to help@sasview.org.") 47 50 48 51 self.vbox.Add(self.message_text, 0, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 10) … … 87 90 self.buttons = [] 88 91 #Check if SAS_OPENCL is already set as enviromental variable 89 self.sas_opencl = os.environ.get("SAS_OPENCL", "")92 self.sas_opencl = os.environ.get("SAS_OPENCL", "") 90 93 91 94 for clopt in clinfo: … … 134 137 self.Bind(wx.EVT_BUTTON, self.on_help, help_btn) 135 138 136 test_text = wx.StaticText(self, -1, "WARNING: Running tests can take a few minutes!")139 test_text = wx.StaticText(self, -1, "WARNING: Running tests can take a few minutes!") 137 140 self.vbox.Add(test_text, 0, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 10) 138 141 … … 170 173 for device in devices: 171 174 if len(devices) > 1 and len(platforms) > 1: 172 combined_index = ":".join([str(p_index), str(d_index)])175 combined_index = ":".join([str(p_index), str(d_index)]) 173 176 elif len(platforms) > 1: 174 177 combined_index = str(p_index) 175 178 else: 176 179 combined_index = str(d_index) 177 #combined_index = ":".join([str(p_index),str(d_index)]) \ 178 # if len(platforms) > 1 else str(d_index) 179 clinfo.append((combined_index, ":".join([platform.name,device.name]))) 180 clinfo.append((combined_index, ":".join([platform.name, device.name]))) 180 181 d_index += 1 181 182 p_index += 1 … … 183 184 warnings.warn("pyopencl import failed. Using only CPU computations") 184 185 185 clinfo.append(("None", "No OpenCL"))186 clinfo.append(("None", "No OpenCL")) 186 187 return clinfo 187 188 … … 211 212 else: 212 213 if "SAS_OPENCL" in os.environ: 213 del (os.environ["SAS_OPENCL"])214 del os.environ["SAS_OPENCL"] 214 215 215 216 #Sasmodels kernelcl doesn't exist when initiated with None … … 227 228 btn.SetValue(0) 228 229 229 self.sas_opencl =None230 self.sas_opencl = None 230 231 231 232 def on_test(self, event): … … 246 247 else: 247 248 if "SAS_OPENCL" in os.environ: 248 del (os.environ["SAS_OPENCL"])249 del os.environ["SAS_OPENCL"] 249 250 250 251 #Sasmodels kernelcl doesn't exist when initiated with None … … 263 264 env = environment() 264 265 clinfo = [(ctx.devices[0].platform.vendor, 265 ctx.devices[0].platform.version,266 ctx.devices[0].vendor,267 ctx.devices[0].name,268 ctx.devices[0].version)269 for ctx in env.context]266 ctx.devices[0].platform.version, 267 ctx.devices[0].vendor, 268 ctx.devices[0].name, 269 ctx.devices[0].version) 270 for ctx in env.context] 270 271 except ImportError: 271 272 clinfo = None … … 295 296 msg += 'Failing tests: ' 296 297 msg += json.dumps(info['failing tests']) 297 msg += "\n"298 else: 299 msg +="All tests passed!\n"300 301 msg += "\nPlatform Details:\n\n"298 msg += "\n" 299 else: 300 msg += "All tests passed!\n" 301 302 msg += "\nPlatform Details:\n\n" 302 303 msg += "Sasmodels version: " 303 304 msg += info['version']+"\n"
Note: See TracChangeset
for help on using the changeset viewer.