Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/gpu_options.py
re4fe091 rbd55e15 74 74 reset_btn.SetToolTipString("Restore initial settings") 75 75 76 test_id = wx.NewId() 77 test_btn = wx.Button(self, test_id, 'Test') 78 test_btn.SetToolTipString("Test if models compile on the given infrastructure") 79 76 80 self.Bind(wx.EVT_BUTTON, self.on_OK, accept_btn) 81 self.Bind(wx.EVT_BUTTON, self.on_test, test_btn) 77 82 self.Bind(wx.EVT_BUTTON, self.on_reset, reset_btn) 78 83 self.Bind(wx.EVT_BUTTON, self.on_help, help_btn) 84 79 85 80 86 btn_sizer = wx.BoxSizer(wx.HORIZONTAL) 81 87 btn_sizer.Add((10, 20), 1) # stretchable whitespace 82 88 btn_sizer.Add(accept_btn, 0) 89 btn_sizer.Add((10, 20), 0) # non-stretchable whitespace 90 btn_sizer.Add(test_btn, 0) 83 91 btn_sizer.Add((10, 20), 0) # non-stretchable whitespace 84 92 btn_sizer.Add(reset_btn, 0) … … 164 172 self.sas_opencl=None 165 173 174 def on_test(self, event): 175 """ 176 Run sasmodels check from here and report results from 177 """ 178 import json 179 import platform 180 181 import sasmodels 182 from sasmodels.model_test import model_tests 183 try: 184 from sasmodels.kernelcl import environment 185 env = environment() 186 clinfo = [(ctx.devices[0].platform.vendor, 187 ctx.devices[0].platform.version, 188 ctx.devices[0].vendor, 189 ctx.devices[0].name, 190 ctx.devices[0].version) 191 for ctx in env.context] 192 except ImportError: 193 clinfo = None 194 195 failures = [] 196 for test in model_tests(): 197 try: 198 test() 199 except Exception: 200 failures.append(test.description) 201 202 info = { 203 'version': sasmodels.__version__, 204 'platform': platform.uname(), 205 'opencl': clinfo, 206 'failing tests': failures, 207 } 208 print(json.dumps(info['failing tests'])) 209 166 210 def on_help(self, event): 167 211 """
Note: See TracChangeset
for help on using the changeset viewer.