Changeset 133812c7 in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Nov 12, 2018 6:47:59 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- e5ae812
- Parents:
- ebcdb02
- git-author:
- Piotr Rozyczko <piotr.rozyczko@…> (10/31/18 06:34:14)
- git-committer:
- Piotr Rozyczko <piotr.rozyczko@…> (11/12/18 06:47:59)
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r17e2d502 r133812c7 2448 2448 2449 2449 # If multiple rows selected - toggle all of them, filtering uncheckable 2450 # Switch off signaling from the model to avoid recursion2451 self._model_model.blockSignals(True)2452 2450 # Convert to proper indices and set requested enablement 2453 2451 self.setParameterSelection(status) 2454 self._model_model.blockSignals(False)2455 2452 2456 2453 # update the list of parameters to fit -
src/sas/qtgui/Perspectives/Fitting/GPUOptions.py
rdb05c44 r133812c7 2 2 import os 3 3 import sys 4 import sasmodels5 4 import json 6 5 import platform 7 6 import webbrowser 7 import logging 8 9 import sasmodels 10 import sasmodels.model_test 11 import sasmodels.kernelcl 8 12 9 13 import sas.qtgui.Utilities.GuiUtils as GuiUtils … … 26 30 return QtWidgets.QApplication.translate(context, text, disambig) 27 31 32 logger = logging.getLogger(__name__) 28 33 29 34 class GPUOptions(QtWidgets.QDialog, Ui_GPUOptions): … … 106 111 del os.environ["SAS_OPENCL"] 107 112 # Sasmodels kernelcl doesn't exist when initiated with None 108 if 'sasmodels.kernelcl' in sys.modules: 109 sasmodels.kernelcl.ENV = None 110 from importlib import reload # assumed Python > 3.3 111 reload(sasmodels.core) 113 sasmodels.kernelcl.reset_environment() 112 114 return no_opencl_msg 113 115 … … 123 125 124 126 try: 125 from sasmodels.kernelcl import environment 126 env = environment() 127 env = sasmodels.kernelcl.environment() 127 128 clinfo = [(ctx.devices[0].platform.vendor, 128 129 ctx.devices[0].platform.version, … … 131 132 ctx.devices[0].version) 132 133 for ctx in env.context] 133 except ImportError:134 except Exception: 134 135 clinfo = None 135 136 … … 222 223 clinfo = [] 223 224 cl_platforms = [] 225 224 226 try: 225 227 import pyopencl as cl 226 cl_platforms = cl.get_platforms()227 228 except ImportError: 228 print("pyopencl import failed. Using only CPU computations") 229 except cl.LogicError as e: 230 print(e.value) 229 cl = None 230 231 if cl is None: 232 logger.warn("Unable to import the pyopencl package. It may not " 233 "have been installed. If you wish to use OpenCL, try " 234 "running pip install --user pyopencl") 235 else: 236 try: 237 cl_platforms = cl.get_platforms() 238 except cl.LogicError as err: 239 logger.warn("Unable to fetch the OpenCL platforms. This likely " 240 "means that the opencl drivers for your system are " 241 "not installed.") 242 logger.warn(err) 231 243 232 244 p_index = 0
Note: See TracChangeset
for help on using the changeset viewer.