Changeset db05c44 in sasview for src/sas/qtgui/Perspectives/Fitting


Ignore:
Timestamp:
Aug 7, 2018 11:38:19 AM (6 years ago)
Author:
Torin Cooper-Bennun <torin.cooper-bennun@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
c0de493
Parents:
8a518285
Message:

fix OpenCL device never being set correctly; fix loading in default device from config (and setting to no OpenCL by default)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/GPUOptions.py

    r8a518285 rdb05c44  
    3434    clicked = False 
    3535    sas_open_cl = None 
     36    cl_options = None 
    3637 
    3738    def __init__(self, parent=None): 
     
    4950        cl_tuple = _get_clinfo() 
    5051        self.sas_open_cl = os.environ.get("SAS_OPENCL", "") 
     52 
     53        # Keys are the names in the form "platform: device". Corresponding values are the combined indices, e.g. 
     54        # "0:1", for setting the SAS_OPENCL env. 
     55        self.cl_options = {} 
     56 
    5157        for title, descr in cl_tuple: 
    5258            # Create an item for each openCL option 
     
    5561            check_box.setText(_translate("GPUOptions", descr, None)) 
    5662            self.optionsLayout.addWidget(check_box) 
    57             if (descr == self.sas_open_cl) or ( 
     63            if (title == self.sas_open_cl) or ( 
    5864                            title == "None" and not self.clicked): 
    5965                check_box.click() 
    6066                self.clicked = True 
     67            self.cl_options[descr] = title 
    6168        self.openCLCheckBoxGroup.setMinimumWidth(self.optionsLayout.sizeHint().width()+10) 
    6269 
     
    7683        checked = None 
    7784        for box in self.openCLCheckBoxGroup.findChildren(QtWidgets.QCheckBox): 
    78             if box.isChecked() and (str(box.text()) == self.sas_open_cl or ( 
     85            if box.isChecked() and (self.cl_options[str(box.text())] == self.sas_open_cl or ( 
    7986                    str(box.text()) == "No OpenCL" and self.sas_open_cl == "")): 
    8087                box.setChecked(False) 
     
    8289                checked = box 
    8390        if hasattr(checked, "text"): 
    84             self.sas_open_cl = str(checked.text()) 
     91            self.sas_open_cl = self.cl_options[str(checked.text())] 
    8592        else: 
    8693            self.sas_open_cl = None 
Note: See TracChangeset for help on using the changeset viewer.