Changeset 0c9204a in sasview
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/gpu_options.py
rf370ea07 r0c9204a 38 38 vbox = wx.BoxSizer(wx.VERTICAL) 39 39 vbox.Add(panel, 0, wx.ALL, 10) 40 41 message_text = wx.StaticText(self, -1,"If tests fail on OpenCL devices, " 42 "please select No OpenCL option.\n\n" 43 "In case of large number of failing tests, " 44 "please consider sending above\n" 45 "report to help@sasview.org.") 46 47 message_text.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) 48 vbox.Add(message_text, 0, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 10) 40 49 41 50 ok_btn = wx.Button(self, wx.ID_OK) … … 232 241 import platform 233 242 import sasmodels 243 244 #The same block of code as for OK but it is needed if we want to have 245 #active response to Test button 246 if self.sas_opencl: 247 os.environ["SAS_OPENCL"] = self.sas_opencl 248 else: 249 if "SAS_OPENCL" in os.environ: 250 del(os.environ["SAS_OPENCL"]) 251 252 #Sasmodels kernelcl doesn't exist when initiated with None 253 try: 254 sasmodels.kernelcl.ENV = None 255 except: 256 #TODO: Need to provide reasonable exception case 257 pass 258 259 #Need to reload sasmodels.core module to account SAS_OPENCL = "None" 260 reload(sasmodels.core) 261 262 234 263 from sasmodels.model_test import model_tests 235 264 … … 247 276 248 277 failures = [] 278 tests_completed = 0 249 279 for test in model_tests(): 250 280 try: … … 252 282 except Exception: 253 283 failures.append(test.description) 284 285 tests_completed += 1 254 286 255 287 info = { … … 260 292 } 261 293 262 msg_info = "OpenCL tests"263 264 msg = "Results: "294 msg_info = 'OpenCL tests results' 295 296 msg = str(tests_completed)+' tests completed.\n' 265 297 if len(failures) > 0: 266 msg += 'Failing tests:\n' 298 msg += str(len(failures))+' tests failed.\n' 299 msg += 'Failing tests: ' 267 300 msg += json.dumps(info['failing tests']) 301 msg +="\n" 268 302 else: 269 303 msg+="All tests passed!\n" 270 304 271 msg +="\n Details:\n"305 msg +="\nHardware Details:\n" 272 306 msg += "Sasmodels version: " 273 307 msg += info['version']+"\n" 274 308 msg += "\nPlatform used: " 275 309 msg += json.dumps(info['platform'])+"\n" 276 msg += "\nOpenCL driver: " 277 msg += json.dumps(info['opencl'])+"\n" 310 if self.sas_opencl.lower() == "none": 311 msg += "\nOpenCL driver: None" 312 else: 313 msg += "\nOpenCL driver: " 314 msg += json.dumps(info['opencl'])+"\n" 278 315 279 316 CustomMessageBox(self.panel1, msg, msg_info)
Note: See TracChangeset
for help on using the changeset viewer.