- Timestamp:
- Oct 25, 2017 7:58:46 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- c31d41e7
- Parents:
- 37be27f
- Location:
- src/sas/qtgui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/GuiManager.py
ra6cd8d1 r9863343 623 623 def actionGPU_Options(self): 624 624 """ 625 """ 626 if getattr(self._current_perspective, "gpu_options_widget"): 625 Load the OpenCL selection dialog if the fitting perspective is active 626 """ 627 if hasattr(self._current_perspective, "gpu_options_widget"): 627 628 self._current_perspective.gpu_options_widget.show() 628 629 pass -
src/sas/qtgui/Perspectives/Fitting/GPUOptions.py
r37be27f r9863343 6 6 import platform 7 7 8 import sas.qtgui.Utilities.GuiUtils as GuiUtils 8 9 from PyQt4 import QtGui, QtCore, QtWebKit 9 10 from sas.qtgui.Perspectives.Fitting.UI.GPUOptionsUI import Ui_GPUOptions … … 38 39 self.setupUi(self) 39 40 self.addOpenCLOptions() 41 self.setFixedSize(self.size()) 40 42 self.createLinks() 41 43 … … 61 63 # Expand group and shift items down as more are added 62 64 self.openCLCheckBoxGroup.resize(391, 60 + i) 63 self. label.setGeometry(QtCore.QRect(20, 90 + i, 391, 37))65 self.warningMessage.setGeometry(QtCore.QRect(20, 90 + i, 391, 37)) 64 66 self.okButton.setGeometry(QtCore.QRect(20, 127 + i, 93, 28)) 65 67 self.resetButton.setGeometry(QtCore.QRect(120, 127 + i, 93, 28)) … … 73 75 Link user interactions to function calls 74 76 """ 75 self.testButton.clicked.connect( lambda: self.testButtonClicked())76 self.helpButton.clicked.connect( lambda: self.helpButtonClicked())77 self.testButton.clicked.connect(self.testButtonClicked) 78 self.helpButton.clicked.connect(self.helpButtonClicked) 77 79 for item in self.openCLCheckBoxGroup.findChildren(QtGui.QCheckBox): 78 item.clicked.connect( lambda: self.checked())80 item.clicked.connect(self.checked) 79 81 80 82 def checked(self): … … 151 153 } 152 154 153 msg_info = 'OpenCL tests results'154 155 155 msg = str(tests_completed) + ' tests completed.\n' 156 156 if len(failures) > 0: … … 172 172 msg += "\nOpenCL driver: " 173 173 msg += json.dumps(info['opencl']) + "\n" 174 GPUTestResults(self, msg , msg_info)174 GPUTestResults(self, msg) 175 175 176 176 def helpButtonClicked(self): … … 178 178 Open the help menu when the help button is clicked 179 179 """ 180 tree_location = "user/sasgui/perspectives/fitting/gpu_setup.html" 181 anchor = "#device-selection" 180 help_location = GuiUtils.HELP_DIRECTORY_LOCATION 181 help_location += "/user/sasgui/perspectives/fitting/gpu_setup.html" 182 help_location += "#device-selection" 182 183 self.helpView = QtWebKit.QWebView() 183 help_location = tree_location + anchor184 184 self.helpView.load(QtCore.QUrl(help_location)) 185 185 self.helpView.show() … … 211 211 OpenCL Dialog to modify the OpenCL options 212 212 """ 213 def __init__(self, parent, msg , title):213 def __init__(self, parent, msg): 214 214 super(GPUTestResults, self).__init__(parent) 215 215 self.setupUi(self) 216 216 self.resultsText.setText(_translate("GPUTestResults", msg, None)) 217 self.setFixedSize(self.size()) 217 218 self.open() 218 219 … … 223 224 """ 224 225 clinfo = [] 225 platforms = []226 cl_platforms = [] 226 227 try: 227 228 import pyopencl as cl 228 platforms = cl.get_platforms()229 cl_platforms = cl.get_platforms() 229 230 except ImportError: 230 231 print("pyopencl import failed. Using only CPU computations") 231 232 232 233 p_index = 0 233 for platform inplatforms:234 for cl_platform in cl_platforms: 234 235 d_index = 0 235 devices =platform.get_devices()236 for device in devices:237 if len( devices) > 1 and len(platforms) > 1:236 cl_platforms = cl_platform.get_devices() 237 for cl_platform in cl_platforms: 238 if len(cl_platforms) > 1 and len(cl_platforms) > 1: 238 239 combined_index = ":".join([str(p_index), str(d_index)]) 239 elif len( platforms) > 1:240 elif len(cl_platforms) > 1: 240 241 combined_index = str(p_index) 241 242 else: 242 243 combined_index = str(d_index) 243 clinfo.append((combined_index, ":".join([ platform.name,244 device.name])))244 clinfo.append((combined_index, ":".join([cl_platform.name, 245 cl_platform.name]))) 245 246 d_index += 1 246 247 p_index += 1 -
src/sas/qtgui/Perspectives/Fitting/UI/GPUOptionsUI.ui
rced1bff r9863343 7 7 <x>0</x> 8 8 <y>0</y> 9 <width>4 40</width>10 <height>2 11</height>9 <width>438</width> 10 <height>206</height> 11 11 </rect> 12 12 </property> 13 <property name="sizePolicy"> 14 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 15 <horstretch>0</horstretch> 16 <verstretch>0</verstretch> 17 </sizepolicy> 18 </property> 13 19 <property name="windowTitle"> 14 <string> Dialog</string>20 <string>OpenCL Options</string> 15 21 </property> 16 22 <widget class="QPushButton" name="testButton"> … … 82 88 </property> 83 89 </widget> 84 <widget class="QLabel" name=" label">90 <widget class="QLabel" name="warningMessage"> 85 91 <property name="geometry"> 86 92 <rect> … … 114 120 <hint type="sourcelabel"> 115 121 <x>66</x> 116 <y>1 53</y>122 <y>183</y> 117 123 </hint> 118 124 <hint type="destinationlabel"> … … 129 135 <hints> 130 136 <hint type="sourcelabel"> 131 <x> 166</x>132 <y>1 53</y>137 <x>266</x> 138 <y>183</y> 133 139 </hint> 134 140 <hint type="destinationlabel"> -
src/sas/qtgui/Perspectives/Fitting/UI/GPUTestResultsUI.ui
rced1bff r9863343 12 12 </property> 13 13 <property name="windowTitle"> 14 <string> Dialog</string>14 <string>OpenCL Test Results</string> 15 15 </property> 16 <widget class="QDialogButtonBox" name=" buttonBox">16 <widget class="QDialogButtonBox" name="okButton"> 17 17 <property name="geometry"> 18 18 <rect> … … 33 33 </property> 34 34 </widget> 35 <widget class="QLabel" name=" label">35 <widget class="QLabel" name="falingTestsNoOpenCL"> 36 36 <property name="geometry"> 37 37 <rect> … … 49 49 </property> 50 50 </widget> 51 <widget class="QLabel" name=" label_2">51 <widget class="QLabel" name="howToReportIssues"> 52 52 <property name="geometry"> 53 53 <rect> … … 76 76 <height>321</height> 77 77 </rect> 78 </property> 79 <property name="sizePolicy"> 80 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 81 <horstretch>0</horstretch> 82 <verstretch>0</verstretch> 83 </sizepolicy> 78 84 </property> 79 85 <property name="title"> … … 116 122 <connections> 117 123 <connection> 118 <sender> buttonBox</sender>124 <sender>okButton</sender> 119 125 <signal>accepted()</signal> 120 126 <receiver>GPUTestResults</receiver> … … 132 138 </connection> 133 139 <connection> 134 <sender> buttonBox</sender>140 <sender>okButton</sender> 135 141 <signal>rejected()</signal> 136 142 <receiver>GPUTestResults</receiver>
Note: See TracChangeset
for help on using the changeset viewer.