diff --git a/Builds/MSVC/Installer/Product.wxs b/Builds/MSVC/Installer/Product.wxs index 0e12566..043d7ca 100644 --- a/Builds/MSVC/Installer/Product.wxs +++ b/Builds/MSVC/Installer/Product.wxs @@ -124,19 +124,19 @@ - + - + - + - + - + diff --git a/Builds/QtCreator/defaults.pri b/Builds/QtCreator/defaults.pri index 3fab218..4e2ebf9 100644 --- a/Builds/QtCreator/defaults.pri +++ b/Builds/QtCreator/defaults.pri @@ -94,7 +94,10 @@ win32 { LIBS += -ljpeg LIBS += -lpng LIBS += -lpthread - LIBS += -lOpenEXR + LIBS += -lIlmImf + LIBS += -lHalf + LIBS += -lImath + LIBS += -lIex unix:!macx { LIBS += -lxml2 diff --git a/Data/dark_linux.qss b/Data/dark_linux.qss index bf8f583..92de764 100644 --- a/Data/dark_linux.qss +++ b/Data/dark_linux.qss @@ -4,12 +4,12 @@ You should keep this at the top of whatever custom style you make to ensure the /* QTabBar::tab { height: 4ex; } */ -/* +/*For some reason the font changes if you set any style. Set this to whatever font is the default on your system*/ * { - font: 8pt "MS Shell Dlg 2";/*For some reason the font changes if you set any style. Set this to whatever font is the default on your system*/ + font: 8pt "MS Shell Dlg 2"; } -*/ + /*This is needed to give the labels on the status bar some padding.*/ QStatusBar QLabel { padding-left: 2px; padding-right: 2px; } @@ -135,7 +135,7 @@ QCheckBox::indicator:enabled:checked, QTableView::indicator:enabled:checked { background-color: lightgray; - image: url(:/Fractorium/Icons/checkbox_checked.png); + image: url(:/Fractorium/Icons/checkbox_checked.png); } QCheckBox::indicator:disabled:unchecked, @@ -149,7 +149,7 @@ QCheckBox::indicator:disabled:checked, QTableView::indicator:disabled:checked { background-color: gray; - image: none; + image: none; } QRadioButton::indicator:checked @@ -215,9 +215,9 @@ QComboBox::item:selected QComboBox QAbstractItemView { - border: 1px solid gray; + border: 1px solid gray; outline: none; - selection-background-color: darkgray; + selection-background-color: darkgray; } QTableView QComboBox @@ -244,9 +244,9 @@ QProgressBar { color: black; background-color: gray; - border: 0px none gray; + border: 0px none gray; border-radius: 3px; - text-align: center; + text-align: center center; } QProgressBar::chunk @@ -297,8 +297,8 @@ QGroupBox { padding-top: 3px; border: 2px solid gray; - border-radius: 4px; - margin-top: 3ex; + border-radius: 4px; + margin-top: 3ex; } QGroupBox::title @@ -353,7 +353,7 @@ QTreeView::item:selected QTreeView::branch:!has-children { - background: rgb(53, 53, 53); + background: rgb(53, 53, 53); } QTreeView::branch:has-children:closed @@ -459,7 +459,7 @@ QScrollBar::vertical QScrollBar::handle::vertical { - background-color: gray; + background-color: gray; border-top: 1px solid darkgray; border-bottom: 1px solid darkgray; min-height: 20px; @@ -485,15 +485,15 @@ QScrollBar::sub-line::vertical QScrollBar::up-arrow::vertical, QScrollBar::down-arrow::vertical { - border: 2px solid darkgray; - width: 5px; - height: 12px; - background-color: gray; + border: 2px solid darkgray; + width: 5px; + height: 12px; + background-color: gray; } QScrollBar::add-page::vertical, QScrollBar::sub-page::vertical, QScrollBar::add-page::horizontal, QScrollBar::sub-page::horizontal { - background-color: darkgray; + background-color: darkgray; } QScrollBar::horizontal @@ -532,10 +532,10 @@ QScrollBar::sub-line::horizontal QScrollBar::left-arrow::horizontal, QScrollBar::right-arrow::horizontal { - border: 2px solid darkgray; - width: 12px; - height: 5px; - background-color: gray; + border: 2px solid darkgray; + width: 12px; + height: 5px; + background-color: gray; } QMenu::separator diff --git a/Data/dark_mac.qss b/Data/dark_mac.qss index 1b1e37f..73e34e5 100644 --- a/Data/dark_mac.qss +++ b/Data/dark_mac.qss @@ -4,12 +4,11 @@ You should keep this at the top of whatever custom style you make to ensure the /* QTabBar::tab { height: 4ex; } */ -/* +/*For some reason the font changes if you set any style. Set this to whatever font is the default on your system*/ * { - font: 8pt "MS Shell Dlg 2";/*For some reason the font changes if you set any style. Set this to whatever font is the default on your system*/ + font: 8pt "MS Shell Dlg 2"; } -*/ /*Specific styles below this line*/ Fractorium @@ -132,7 +131,7 @@ QCheckBox::indicator:enabled:checked, QTableView::indicator:enabled:checked { background-color: lightgray; - image: url(:/Fractorium/Icons/checkbox_checked.png); + image: url(:/Fractorium/Icons/checkbox_checked.png); } QCheckBox::indicator:disabled:unchecked, @@ -146,7 +145,7 @@ QCheckBox::indicator:disabled:checked, QTableView::indicator:disabled:checked { background-color: gray; - image: none; + image: none; } QRadioButton::indicator:checked @@ -212,9 +211,9 @@ QComboBox::item:selected QComboBox QAbstractItemView { - border: 1px solid gray; + border: 1px solid gray; outline: none; - selection-background-color: darkgray; + selection-background-color: darkgray; } QTableView QComboBox @@ -241,9 +240,9 @@ QProgressBar { color: black; background-color: gray; - border: 0px none gray; + border: 0px none gray; border-radius: 3px; - text-align: center; + text-align: center center; } QProgressBar::chunk @@ -294,8 +293,8 @@ QGroupBox { padding-top: 3px; border: 2px solid gray; - border-radius: 4px; - margin-top: 3ex; + border-radius: 4px; + margin-top: 3ex; } QGroupBox::title @@ -483,15 +482,15 @@ QScrollBar::sub-line::vertical QScrollBar::up-arrow::vertical, QScrollBar::down-arrow::vertical { - border: 2px solid darkgray; - width: 5px; - height: 12px; - background-color: gray; + border: 2px solid darkgray; + width: 5px; + height: 12px; + background-color: gray; } QScrollBar::add-page::vertical, QScrollBar::sub-page::vertical, QScrollBar::add-page::horizontal, QScrollBar::sub-page::horizontal { - background-color: darkgray; + background-color: darkgray; } QScrollBar::horizontal @@ -530,10 +529,10 @@ QScrollBar::sub-line::horizontal QScrollBar::left-arrow::horizontal, QScrollBar::right-arrow::horizontal { - border: 2px solid darkgray; - width: 12px; - height: 5px; - background-color: gray; + border: 2px solid darkgray; + width: 12px; + height: 5px; + background-color: gray; } QMenu::separator diff --git a/Data/dark_windows.qss b/Data/dark_windows.qss index f15d324..6b19514 100644 --- a/Data/dark_windows.qss +++ b/Data/dark_windows.qss @@ -133,7 +133,7 @@ QCheckBox::indicator:enabled:checked, QTableView::indicator:enabled:checked { background-color: lightgray; - image: url(:/Fractorium/Icons/checkbox_checked.png); + image: url(:/Fractorium/Icons/checkbox_checked.png); } QCheckBox::indicator:disabled:unchecked, @@ -147,7 +147,7 @@ QCheckBox::indicator:disabled:checked, QTableView::indicator:disabled:checked { background-color: gray; - image: none; + image: none; } QRadioButton::indicator:checked @@ -242,15 +242,15 @@ QProgressBar { color: black; background-color: gray; - border: 0px none gray; + border: 0px none gray; border-radius: 3px; - text-align: center; + text-align: center center; } QProgressBar::chunk { border-radius: 3px; - background-color: lightgray; + background-color: lightgray; } QStatusBar QProgressBar @@ -295,8 +295,8 @@ QGroupBox { padding-top: 3px; border: 2px solid gray; - border-radius: 4px; - margin-top: 3ex; + border-radius: 4px; + margin-top: 3ex; } QGroupBox::title @@ -351,7 +351,7 @@ QTreeView::item:selected QTreeView::branch:!has-children { - background: rgb(53, 53, 53); + background: rgb(53, 53, 53); } QTreeView::branch:has-children:closed @@ -457,7 +457,7 @@ QScrollBar::vertical QScrollBar::handle::vertical { - background-color: gray; + background-color: gray; border-top: 1px solid darkgray; border-bottom: 1px solid darkgray; min-height: 20px; @@ -483,15 +483,15 @@ QScrollBar::sub-line::vertical QScrollBar::up-arrow::vertical, QScrollBar::down-arrow::vertical { - border: 2px solid darkgray; - width: 5px; - height: 12px; - background-color: gray; + border: 2px solid darkgray; + width: 5px; + height: 12px; + background-color: gray; } QScrollBar::add-page::vertical, QScrollBar::sub-page::vertical, QScrollBar::add-page::horizontal, QScrollBar::sub-page::horizontal { - background-color: darkgray; + background-color: darkgray; } QScrollBar::horizontal @@ -530,10 +530,10 @@ QScrollBar::sub-line::horizontal QScrollBar::left-arrow::horizontal, QScrollBar::right-arrow::horizontal { - border: 2px solid darkgray; - width: 12px; - height: 5px; - background-color: gray; + border: 2px solid darkgray; + width: 12px; + height: 5px; + background-color: gray; } QMenu::separator diff --git a/Data/lightdark.qss b/Data/lightdark.qss index e00b00d..6886e93 100644 --- a/Data/lightdark.qss +++ b/Data/lightdark.qss @@ -4,9 +4,10 @@ You should keep this at the top of whatever custom style you make to ensure the /* QTabBar::tab { height: 4ex; } */ +/*For some reason the font changes if you set any style. Set this to whatever font is the default on your system*/ * { - font: 8pt "MS Shell Dlg 2";/*For some reason the font changes if you set any style. Set this to whatever font is the default on your system*/ + font: 8pt "MS Shell Dlg 2"; } QObject @@ -41,42 +42,40 @@ QTableView /*For some reason, Qt does not draw table headers correctly, so the style must always be manually specified.*/ QHeaderView::section::vertical:enabled { - width: 12px; color: black; background-color: lightgray; border: none; padding: 0px; - padding-left: 4px; + padding-left: 4px; } QHeaderView::section::horizontal:enabled { - height: 18px; - color: black; - background-color: lightgray; - border: none; - padding: 0px; - padding-left: 4px; + height: 18px; + color: black; + background-color: lightgray; + border: none; + padding: 0px; + padding-left: 4px; } QHeaderView::section::vertical:disabled { - width: 12px; color: rgb(35, 35, 35); background-color: rgb(53, 53, 53); border: none; padding: 0px; - padding-left: 4px; + padding-left: 4px; } QHeaderView::section::horizontal:disabled { - height: 18px; + height: 18px; color:rgb(35, 35, 35); background-color: rgb(53, 53, 53); border: none; padding: 0px; - padding-left: 4px; + padding-left: 4px; } QTableView @@ -89,13 +88,13 @@ QTableView QTableView QTableCornerButton::section:enabled { - border: none; + border: none; background-color: lightgray; } QTableView QTableCornerButton::section:disabled { - border: none; + border: none; background-color: rgb(53, 53, 53); } @@ -154,12 +153,20 @@ QScrollBar::sub-line::vertical subcontrol-origin: margin; } -QScrollBar::up-arrow::vertical, QScrollBar::down-arrow::vertical +QScrollBar::up-arrow::vertical { - border: 2px solid darkgray; - width: 5px; - height: 12px; - background-color: gray; + border: 2px solid darkgray; + width: 5px; + height: 12px; + background-color: gray; +} + +QScrollBar::down-arrow::vertical +{ + border: 2px solid darkgray; + width: 5px; + height: 12px; + background-color: gray; } QScrollBar::add-page::vertical, @@ -167,7 +174,7 @@ QScrollBar::sub-page::vertical, QScrollBar::add-page::horizontal, QScrollBar::sub-page::horizontal { - background-color: darkgray; + background-color: darkgray; } QScrollBar::horizontal @@ -204,13 +211,20 @@ QScrollBar::sub-line::horizontal subcontrol-origin: margin; } -QScrollBar::left-arrow::horizontal, +QScrollBar::left-arrow::horizontal +{ + border: 2px solid darkgray; + width: 12px; + height: 5px; + background-color: gray; +} + QScrollBar::right-arrow::horizontal { - border: 2px solid darkgray; - width: 12px; - height: 5px; - background-color: gray; + border: 2px solid darkgray; + width: 12px; + height: 5px; + background-color: gray; } /*================================================================================================== @@ -368,7 +382,7 @@ QDockWidget QTabBar QDialog QTabBar { - border-color: transparent; /* set color for QTabBars inside Preferences dialog */ + border-color: transparent; /* set color for QTabBars inside Preferences dialog */ } /* end fix */ @@ -377,15 +391,15 @@ QTabBar::tab background-color: transparent; border: 1px solid transparent; padding: 4px 4px 4px 4px; - margin: 0px; + margin: 0px; } QDialog QTabBar::tab:top { - background-color: transparent; + background-color: transparent; border: 1px solid transparent; padding: 4px 4px 4px 4px; - min-width: 20ex; + min-width: 20ex; } QTabBar::tab:left, @@ -462,28 +476,28 @@ QToolBar QToolBar > QToolButton { - margin: 1px; - padding: 1px; - border-radius: 3px; + margin: 1px; + padding: 1px; + border-radius: 3px; border: 1px solid #5e5e5e; - position: relative; + position: relative; subcontrol-position: right; subcontrol-origin: margin; } QDialog > QToolBar > QToolButton { - width: 95px; - margin: 0px; - padding: 0px; - border-radius: 3px; + width: 95px; + margin: 0px; + padding: 0px; + border-radius: 3px; border: 1px solid #5e5e5e; } QDialog > QToolBar > QToolButton::menu-button { - left: -2px; - border-radius: 3px; + left: -2px; + border-radius: 3px; border: 1px solid #5e5e5e; } @@ -523,11 +537,13 @@ QPushButton { margin: 1px; padding: 4px; + color: white; + background-color: gray; } QPushButton:pressed { - background-color: gray; + background-color: darkgray; } QPushButton:focus @@ -574,7 +590,7 @@ QTableView::indicator:enabled:checked, QGroupBox::indicator:enabled:checked { background-color: lightgray; - image: url(:/Fractorium/Icons/checkbox_checked.png); + image: url(:/Fractorium/Icons/checkbox_checked.png); } QCheckBox::indicator:disabled:unchecked, @@ -590,7 +606,7 @@ QTableView::indicator:disabled:checked, QGroupBox::indicator:disabled:checked { background-color: gray; - image: none; + image: none; } QRadioButton::indicator:checked @@ -657,15 +673,15 @@ QProgressBar { color: black; background-color: gray; - border: 0px none gray; + border: 0px none gray; border-radius: 3px; - text-align: center; + text-align: center center; } QProgressBar::chunk { border-radius: 3px; - background-color: lightgray; + background-color: lightgray; } QStatusBar QProgressBar @@ -679,8 +695,8 @@ QGroupBox { padding-top: 8px; border: 2px solid gray; - border-radius: 4px; - margin-top: 3ex; + border-radius: 4px; + margin-top: 3ex; } QGroupBox::title @@ -751,16 +767,9 @@ QTableView#FinalRenderParamsTable QPushButton margin-bottom: 2px; } -QTableView#XaosTableView QHeaderView::section::vertical, -QTableView#XaosDistVizTableWidget QHeaderView::section::vertical, -QTableView#XaosAppliedTableView QHeaderView::section::vertical -{ - width: 19px; -} - QTableView#SummaryTable QHeaderView::section::vertical { - width: 69px; + width: 69px; } QssDialog QssTextEdit#QssEdit diff --git a/Data/uranium.qss b/Data/uranium.qss index f810389..ff76df1 100644 --- a/Data/uranium.qss +++ b/Data/uranium.qss @@ -4,9 +4,10 @@ You should keep this at the top of whatever custom style you make to ensure the /* QTabBar::tab { height: 4ex; } */ +/*For some reason the font changes if you set any style. Set this to whatever font is the default on your system*/ * { - font: 8pt "MS Shell Dlg 2";/*For some reason the font changes if you set any style. Set this to whatever font is the default on your system*/ + font: 8pt "MS Shell Dlg 2"; } QObject @@ -45,7 +46,6 @@ QTableView /*For some reason, Qt does not draw table headers correctly, so the style must always be manually specified.*/ QHeaderView::section::vertical:enabled { - width: 12px; color: black; background-color: rgb(176, 204, 177); border: none; @@ -65,7 +65,6 @@ QHeaderView::section::horizontal:enabled QHeaderView::section::vertical:disabled { - width: 12px; color: rgb(35, 35, 35); background-color: rgb(53, 53, 53); border: none; @@ -174,12 +173,20 @@ QScrollBar::sub-line::vertical subcontrol-origin: margin; } -QScrollBar::up-arrow::vertical, QScrollBar::down-arrow::vertical +QScrollBar::up-arrow::vertical { - border: 2px solid rgb(124, 232, 0); - width: 5px; - height: 12px; - background-color: gray; + border: 2px solid rgb(124, 232, 0); + width: 5px; + height: 12px; + background-color: gray; +} + +QScrollBar::down-arrow::vertical +{ + border: 2px solid rgb(124, 232, 0); + width: 5px; + height: 12px; + background-color: gray; } QScrollBar::add-page::vertical, @@ -187,12 +194,12 @@ QScrollBar::sub-page::vertical, QScrollBar::add-page::horizontal, QScrollBar::sub-page::horizontal { - background-color: rgb(115, 133, 116); + background-color: rgb(115, 133, 116); } QScrollBar::horizontal { - background-color: rgb(176, 204, 177); + background-color: rgb(115, 133, 116); border: 0px solid darkgray; height: 15px; margin: 0px 20px 0 20px; @@ -224,7 +231,14 @@ QScrollBar::sub-line::horizontal subcontrol-origin: margin; } -QScrollBar::left-arrow::horizontal, +QScrollBar::left-arrow::horizontal +{ + border: 2px solid rgb(124, 232, 0); + width: 12px; + height: 5px; + background-color: gray; +} + QScrollBar::right-arrow::horizontal { border: 2px solid rgb(124, 232, 0); @@ -718,7 +732,7 @@ QProgressBar background-color: gray; border: 0px none gray; border-radius: 3px; - text-align: center; + text-align: center center; } QProgressBar::chunk @@ -832,13 +846,6 @@ QTableView#FinalRenderParamsTable QPushButton margin-bottom: 2px; } -QTableView#XaosTableView QHeaderView::section::vertical, -QTableView#XaosDistVizTableWidget QHeaderView::section::vertical, -QTableView#XaosAppliedTableView QHeaderView::section::vertical -{ - width: 19px; -} - QTableView#SummaryTable QHeaderView::section::vertical { width: 69px; diff --git a/Source/Ember/PaletteList.h b/Source/Ember/PaletteList.h index 88366e3..ed048a5 100644 --- a/Source/Ember/PaletteList.h +++ b/Source/Ember/PaletteList.h @@ -49,7 +49,7 @@ public: bool IsModifiable(const string& filename); const map>>& Palettes() const; - SINGLETON_DERIVED_DECL(PaletteList); + SINGLETON_DERIVED_DECL_T(PaletteList, T); private: PaletteList(); bool Save(const string& filename); diff --git a/Source/Ember/Utils.h b/Source/Ember/Utils.h index e250f6b..5f6830d 100644 --- a/Source/Ember/Utils.h +++ b/Source/Ember/Utils.h @@ -277,6 +277,14 @@ protected: x(const x& other) = delete; \ const x& operator=(const x& other) = delete//Semicolon deliberately omitted to force it on the caller. +//Use this if the body of the destructor will be implemented in a cpp file and the type is templated. +#define SINGLETON_DERIVED_DECL_T(x, T) \ + friend class Singleton>; \ + public: \ + ~x(); \ + x(const x& other) = delete; \ + const x& operator=(const x& other) = delete//Semicolon deliberately omitted to force it on the caller. + //Use this if the body of the destructor is empty and is will be implemented inline in the header file. #define SINGLETON_DERIVED_IMPL(x) \ friend class Singleton; \ @@ -285,6 +293,14 @@ protected: x(const x& other) = delete; \ const x& operator=(const x& other) = delete +//Use this if the body of the destructor is empty and is will be implemented inline in the header file and the type is templated. +#define SINGLETON_DERIVED_IMPL_T(x, T) \ + friend class Singleton>; \ + public: \ + ~x(){} \ + x(const x& other) = delete; \ + const x& operator=(const x& other) = delete + /// /// The calculations in some variations were changed from what they were in flam3/Apophysis to match Chaotica. /// Some users prefer the old functionality, so provide an option to retain it. diff --git a/Source/Ember/VarFuncs.h b/Source/Ember/VarFuncs.h index 11b5d9c..e1070db 100644 --- a/Source/Ember/VarFuncs.h +++ b/Source/Ember/VarFuncs.h @@ -709,7 +709,7 @@ public: } } - SINGLETON_DERIVED_IMPL(VarFuncs); + SINGLETON_DERIVED_IMPL_T(VarFuncs, T); private: /// diff --git a/Source/Ember/VariationList.h b/Source/Ember/VariationList.h index 563b951..4dfb441 100644 --- a/Source/Ember/VariationList.h +++ b/Source/Ember/VariationList.h @@ -49,7 +49,7 @@ public: const vector*>& NonParametricVariations() const; const vector*>& ParametricVariations() const; - SINGLETON_DERIVED_DECL(VariationList); + SINGLETON_DERIVED_DECL_T(VariationList, T); private: VariationList(); diff --git a/Source/EmberCL/CL/opencl.hpp b/Source/EmberCL/CL/opencl.hpp index 0712eb3..be78a2a 100644 --- a/Source/EmberCL/CL/opencl.hpp +++ b/Source/EmberCL/CL/opencl.hpp @@ -71,16 +71,16 @@ * fixes in the new header as well as additional OpenCL 2.0 features. * As a result the header is not directly backward compatible and for this * reason we release it as opencl.hpp rather than a new version of cl.hpp. - * + * * * \section compatibility Compatibility * Due to the evolution of the underlying OpenCL API the 2.0 C++ bindings * include an updated approach to defining supported feature versions * and the range of valid underlying OpenCL runtime versions supported. * - * The combination of preprocessor macros CL_HPP_TARGET_OPENCL_VERSION and + * The combination of preprocessor macros CL_HPP_TARGET_OPENCL_VERSION and * CL_HPP_MINIMUM_OPENCL_VERSION control this range. These are three digit - * decimal values representing OpenCL runtime versions. The default for + * decimal values representing OpenCL runtime versions. The default for * the target is 300, representing OpenCL 3.0. The minimum is defined as 200. * These settings would use 2.0 and newer API calls only. * If backward compatibility with a 1.2 runtime is required, the minimum @@ -89,21 +89,21 @@ * Note that this is a compile-time setting, and so affects linking against * a particular SDK version rather than the versioning of the loaded runtime. * - * The earlier versions of the header included basic vector and string - * classes based loosely on STL versions. These were difficult to + * The earlier versions of the header included basic vector and string + * classes based loosely on STL versions. These were difficult to * maintain and very rarely used. For the 2.0 header we now assume * the presence of the standard library unless requested otherwise. - * We use std::array, std::vector, std::shared_ptr and std::string - * throughout to safely manage memory and reduce the chance of a + * We use std::array, std::vector, std::shared_ptr and std::string + * throughout to safely manage memory and reduce the chance of a * recurrance of earlier memory management bugs. * - * These classes are used through typedefs in the cl namespace: + * These classes are used through typedefs in the cl namespace: * cl::array, cl::vector, cl::pointer and cl::string. * In addition cl::allocate_pointer forwards to std::allocate_shared * by default. - * In all cases these standard library classes can be replaced with - * custom interface-compatible versions using the CL_HPP_NO_STD_ARRAY, - * CL_HPP_NO_STD_VECTOR, CL_HPP_NO_STD_UNIQUE_PTR and + * In all cases these standard library classes can be replaced with + * custom interface-compatible versions using the CL_HPP_NO_STD_ARRAY, + * CL_HPP_NO_STD_VECTOR, CL_HPP_NO_STD_UNIQUE_PTR and * CL_HPP_NO_STD_STRING macros. * * The OpenCL 1.x versions of the C++ bindings included a size_t wrapper @@ -114,12 +114,12 @@ * using the CL_HPP_ENABLE_SIZE_T_COMPATIBILITY macro. * * Finally, the program construction interface used a clumsy vector-of-pairs - * design in the earlier versions. We have replaced that with a cleaner - * vector-of-vectors and vector-of-strings design. However, for backward + * design in the earlier versions. We have replaced that with a cleaner + * vector-of-vectors and vector-of-strings design. However, for backward * compatibility old behaviour can be regained with the * CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY macro. - * - * In OpenCL 2.0 OpenCL C is not entirely backward compatibility with + * + * In OpenCL 2.0 OpenCL C is not entirely backward compatibility with * earlier versions. As a result a flag must be passed to the OpenCL C * compiled to request OpenCL 2.0 compilation of kernels with 1.2 as * the default in the absence of the flag. @@ -213,7 +213,7 @@ * bindings, including support for the optional exception feature and * also the supplied vector and string classes, see following sections for * decriptions of these features. - * + * * Note: the C++ bindings use std::call_once and therefore may need to be * compiled using special command-line options (such as "-pthread") on some * platforms! @@ -509,11 +509,11 @@ #if defined(_MSC_VER) #include -#endif // _MSC_VER - +#endif // _MSC_VER + // Check for a valid C++ version -// Need to do both tests here because for some reason __cplusplus is not +// Need to do both tests here because for some reason __cplusplus is not // updated in visual studio #if (!defined(_MSC_VER) && __cplusplus < 201103L) || (defined(_MSC_VER) && _MSC_VER < 1700) #error Visual studio 2013 or another C++11-supporting compiler required @@ -617,7 +617,7 @@ namespace cl { template using pointer = std::unique_ptr; } // namespace cl -#endif +#endif #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 #if !defined(CL_HPP_NO_STD_ARRAY) #include @@ -738,8 +738,8 @@ namespace cl { #endif // cl_khr_command_buffer #if defined(CL_HPP_ENABLE_EXCEPTIONS) - /*! \brief Exception class - * + /*! \brief Exception class + * * This may be thrown by API functions when CL_HPP_ENABLE_EXCEPTIONS is defined. */ class Error : public std::exception @@ -750,7 +750,7 @@ namespace cl { public: /*! \brief Create a new CL error exception for a given error code * and corresponding message. - * + * * \param err error code value. * * \param errStr a descriptive string that must remain in scope until @@ -1215,7 +1215,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, array* param, lo if (err != CL_SUCCESS) { return err; } - + // Bound the copy with N to prevent overruns // if passed N > than the amount copied if (elements > N) { @@ -1817,7 +1817,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1828,7 +1828,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1932,7 +1932,7 @@ template <> struct ReferenceHandler { static cl_int retain(cl_semaphore_khr semaphore) - { + { if (pfn_clRetainSemaphoreKHR != nullptr) { return pfn_clRetainSemaphoreKHR(semaphore); } @@ -2047,11 +2047,11 @@ protected: public: Wrapper() : object_(nullptr) { } - - Wrapper(const cl_type &obj, bool retainObject) : object_(obj) + + Wrapper(const cl_type &obj, bool retainObject) : object_(obj) { - if (retainObject) { - detail::errHandler(retain(), __RETAIN_ERR); + if (retainObject) { + detail::errHandler(retain(), __RETAIN_ERR); } } @@ -2160,15 +2160,15 @@ protected: } public: - Wrapper() : object_(nullptr), referenceCountable_(false) - { - } - - Wrapper(const cl_type &obj, bool retainObject) : - object_(obj), - referenceCountable_(false) + Wrapper() : object_(nullptr), referenceCountable_(false) { - referenceCountable_ = isReferenceCountable(obj); + } + + Wrapper(const cl_type &obj, bool retainObject) : + object_(obj), + referenceCountable_(false) + { + referenceCountable_ = isReferenceCountable(obj); if (retainObject) { detail::errHandler(retain(), __RETAIN_ERR); @@ -2179,11 +2179,11 @@ public: { release(); } - + Wrapper(const Wrapper& rhs) { object_ = rhs.object_; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); detail::errHandler(retain(), __RETAIN_ERR); } @@ -2222,7 +2222,7 @@ public: { detail::errHandler(release(), __RELEASE_ERR); object_ = rhs; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); return *this; } @@ -2357,10 +2357,10 @@ public: Device() : detail::Wrapper() { } /*! \brief Constructor from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ - explicit Device(const cl_device_id &device, bool retainObject = false) : + explicit Device(const cl_device_id &device, bool retainObject = false) : detail::Wrapper(device, retainObject) { } /*! \brief Returns the first device on the default context. @@ -2393,7 +2393,7 @@ public: } /*! \brief Assignment operator from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator = (const cl_device_id& rhs) @@ -2401,7 +2401,7 @@ public: detail::Wrapper::operator=(rhs); return *this; } - + //! \brief Wrapper for clGetDeviceInfo(). template @@ -2436,7 +2436,7 @@ public: cl_ulong getHostTimer(cl_int *error = nullptr) { cl_ulong retVal = 0; - cl_int err = + cl_int err = clGetHostTimer(this->get(), &retVal); detail::errHandler( err, @@ -2451,7 +2451,7 @@ public: * Return a synchronized pair of host and device timestamps as seen by device. * Use to correlate the clocks and get the host timer only using getHostTimer * as a lower cost mechanism in between calls. - * The resolution of the host timer may be queried with the + * The resolution of the host timer may be queried with the * CL_PLATFORM_HOST_TIMER_RESOLUTION query. * The resolution of the device timer may be queried with the * CL_DEVICE_PROFILING_TIMER_RESOLUTION query. @@ -2490,7 +2490,7 @@ public: return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction if (devices) { devices->resize(ids.size()); @@ -2498,7 +2498,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < ids.size(); i++) { - // We do not need to retain because this device is being created + // We do not need to retain because this device is being created // by the runtime (*devices)[i] = Device(ids[i], false); } @@ -2514,7 +2514,7 @@ public: const cl_device_partition_property_ext * properties, vector* devices) { - typedef CL_API_ENTRY cl_int + typedef CL_API_ENTRY cl_int ( CL_API_CALL * PFN_clCreateSubDevicesEXT)( cl_device_id /*in_device*/, const cl_device_partition_property_ext * /* properties */, @@ -2543,7 +2543,7 @@ public: if (err != CL_SUCCESS) { return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction if (devices) { devices->resize(ids.size()); @@ -2551,7 +2551,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < ids.size(); i++) { - // We do not need to retain because this device is being created + // We do not need to retain because this device is being created // by the runtime (*devices)[i] = Device(ids[i], false); } @@ -2677,7 +2677,7 @@ private: static void makeDefaultProvided(const Platform &p) { default_ = p; } - + public: #ifdef CL_HPP_UNIT_TEST_ENABLE /*! \brief Reset the default. @@ -2695,17 +2695,17 @@ public: Platform() : detail::Wrapper() { } /*! \brief Constructor from cl_platform_id. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This simply copies the platform ID value, which is an inexpensive operation. */ - explicit Platform(const cl_platform_id &platform, bool retainObject = false) : + explicit Platform(const cl_platform_id &platform, bool retainObject = false) : detail::Wrapper(platform, retainObject) { } /*! \brief Assignment operator from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator = (const cl_platform_id& rhs) @@ -2726,10 +2726,10 @@ public: } /** - * Modify the default platform to be used by + * Modify the default platform to be used by * subsequent operations. * Will only set the default if no default was previously created. - * @return updated default platform. + * @return updated default platform. * Should be compared to the passed value to ensure that it was updated. */ static Platform setDefault(const Platform &default_platform) @@ -2763,7 +2763,7 @@ public: } /*! \brief Gets a list of devices for this platform. - * + * * Wraps clGetDeviceIDs(). */ cl_int getDevices( @@ -2787,7 +2787,7 @@ public: } } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction // We must retain things we obtain from the API to avoid releasing // API-owned objects. @@ -2834,8 +2834,8 @@ public: vector* devices) const { typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clGetDeviceIDsFromD3D10KHR)( - cl_platform_id platform, - cl_d3d10_device_source_khr d3d_device_source, + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, void * d3d_object, cl_d3d10_device_set_khr d3d_device_set, cl_uint num_entries, @@ -2856,12 +2856,12 @@ public: cl_uint n = 0; cl_int err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, - d3d_device_set, - 0, - nullptr, + d3d_device_set, + 0, + nullptr, &n); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2869,18 +2869,18 @@ public: vector ids(n); err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, d3d_device_set, - n, - ids.data(), + n, + ids.data(), nullptr); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction // We must retain things we obtain from the API to avoid releasing // API-owned objects. @@ -2898,7 +2898,7 @@ public: #endif /*! \brief Gets a list of available platforms. - * + * * Wraps clGetPlatformIDs(). */ static cl_int get( @@ -2933,7 +2933,7 @@ public: } /*! \brief Gets the first available platform. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static cl_int get( @@ -2964,8 +2964,8 @@ public: *errResult = err; } return default_platform; - } - + } + #if CL_HPP_TARGET_OPENCL_VERSION >= 120 //! \brief Wrapper for clUnloadCompiler(). cl_int @@ -3006,7 +3006,7 @@ UnloadCompiler() * * \see cl_context */ -class Context +class Context : public detail::Wrapper { private: @@ -3060,7 +3060,7 @@ private: static void makeDefaultProvided(const Context &c) { default_ = c; } - + public: #ifdef CL_HPP_UNIT_TEST_ENABLE /*! \brief Reset the default. @@ -3138,7 +3138,7 @@ public: *err = error; } } - + /*! \brief Constructs a context including all or a subset of devices of a specified type. * * Wraps clCreateContextFromType(). @@ -3231,7 +3231,7 @@ public: * * \note All calls to this function return the same cl_context as the first. */ - static Context getDefault(cl_int * err = nullptr) + static Context getDefault(cl_int * err = nullptr) { std::call_once(default_initialized_, makeDefault); detail::errHandler(default_error_); @@ -3259,15 +3259,15 @@ public: Context() : detail::Wrapper() { } /*! \brief Constructor from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_context * into the new Context object. */ - explicit Context(const cl_context& context, bool retainObject = false) : + explicit Context(const cl_context& context, bool retainObject = false) : detail::Wrapper(context, retainObject) { } /*! \brief Assignment operator from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the rhs and calls * clReleaseContext() on the value previously held by this instance. */ @@ -3301,7 +3301,7 @@ public: } /*! \brief Gets a list of supported image formats. - * + * * Wraps clGetSupportedImageFormats(). */ cl_int getSupportedImageFormats( @@ -3310,17 +3310,17 @@ public: vector* formats) const { cl_uint numEntries; - + if (!formats) { return CL_SUCCESS; } cl_int err = ::clGetSupportedImageFormats( - object_, + object_, flags, - type, - 0, - nullptr, + type, + 0, + nullptr, &numEntries); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR); @@ -3353,7 +3353,7 @@ public: /*! \brief Registers a destructor callback function with a context. * * Wraps clSetContextDestructorCallback(). - * + * * Each call to this function registers the specified callback function on * a destructor callback stack associated with context. The registered * callback functions are called in the reverse order in which they were registered. @@ -3422,14 +3422,14 @@ public: Event() : detail::Wrapper() { } /*! \brief Constructor from cl_event - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_event * into the new Event object. */ - explicit Event(const cl_event& event, bool retainObject = false) : + explicit Event(const cl_event& event, bool retainObject = false) : detail::Wrapper(event, retainObject) { } /*! \brief Assignment operator from cl_event - takes ownership. @@ -3490,7 +3490,7 @@ public: } /*! \brief Blocks the calling thread until this event completes. - * + * * Wraps clWaitForEvents(). */ cl_int wait() const @@ -3515,13 +3515,13 @@ public: object_, type, pfn_notify, - user_data), + user_data), __SET_EVENT_CALLBACK_ERR); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ static cl_int @@ -3539,7 +3539,7 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Class interface for user events (a subset of cl_event's). - * + * * See Event for details about copy semantics, etc. */ class UserEvent : public Event @@ -3574,14 +3574,14 @@ public: cl_int setStatus(cl_int status) { return detail::errHandler( - ::clSetUserEventStatus(object_,status), + ::clSetUserEventStatus(object_,status), __SET_USER_EVENT_STATUS_ERR); } }; #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ inline static cl_int @@ -3677,7 +3677,7 @@ public: ::clSetMemObjectDestructorCallback( object_, pfn_notify, - user_data), + user_data), __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 @@ -3860,7 +3860,7 @@ public: * Allocate an SVM pointer. * * If the allocator is coarse-grained, this will take ownership to allow - * containers to correctly construct data in place. + * containers to correctly construct data in place. */ pointer allocate( size_type size, @@ -3910,7 +3910,7 @@ public: for (const Device &d : context_.getInfo()) { maxSize = std::min( - maxSize, + maxSize, static_cast(d.getInfo())); } @@ -4036,7 +4036,7 @@ cl::pointer>> allocate_svm(const cl #endif // #if !defined(CL_HPP_NO_STD_UNIQUE_PTR) /*! \brief Vector alias to simplify contruction of coarse-grained SVM containers. - * + * */ template < class T > using coarse_svm_vector = vector>>; @@ -4057,7 +4057,7 @@ using atomic_svm_vector = vector>> /*! \brief Class interface for Buffer Memory Objects. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -4142,7 +4142,7 @@ public: if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + size_type size = sizeof(DataType)*(endIterator - startIterator); Context context = Context::getDefault(err); @@ -4175,7 +4175,7 @@ public: template< typename IteratorType > Buffer(const Context &context, IteratorType startIterator, IteratorType endIterator, bool readOnly, bool useHostPtr = false, cl_int* err = nullptr); - + /*! * \brief Construct a Buffer from a host container via iterators using a specified queue. * If useHostPtr is specified iterators must be random access. @@ -4222,10 +4222,10 @@ public: Buffer result; cl_int error; result.object_ = ::clCreateSubBuffer( - object_, - flags, - buffer_create_type, - buffer_create_info, + object_, + flags, + buffer_create_type, + buffer_create_info, &error); detail::errHandler(error, __CREATE_SUBBUFFER_ERR); @@ -4242,7 +4242,7 @@ public: /*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. * * This is provided to facilitate interoperability with Direct3D. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -4250,7 +4250,7 @@ public: class BufferD3D10 : public Buffer { public: - + /*! \brief Constructs a BufferD3D10, in a specified context, from a * given ID3D10Buffer. @@ -4301,11 +4301,11 @@ public: /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. - * Defaults to false to maintain compatibility with + * Defaults to false to maintain compatibility with * earlier versions. * See Memory for further details. */ - explicit BufferD3D10(const cl_mem& buffer, bool retainObject = false) : + explicit BufferD3D10(const cl_mem& buffer, bool retainObject = false) : Buffer(buffer, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -4323,9 +4323,9 @@ public: /*! \brief Class interface for GL Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferGL : public Buffer @@ -4393,9 +4393,9 @@ public: /*! \brief Class interface for GL Render Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferRenderGL : public Buffer @@ -4431,7 +4431,7 @@ public: /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. - * Defaults to false to maintain compatibility with + * Defaults to false to maintain compatibility with * earlier versions. * See Memory for further details. */ @@ -4463,7 +4463,7 @@ public: /*! \brief C++ base class for Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image : public Memory @@ -4502,7 +4502,7 @@ public: detail::getInfo(&::clGetImageInfo, object_, name, param), __GET_IMAGE_INFO_ERR); } - + //! \brief Wrapper for clGetImageInfo() that returns by value. template typename detail::param_traits::param_type @@ -4522,7 +4522,7 @@ public: /*! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image1D : public Image @@ -4547,11 +4547,11 @@ public: desc.image_width = width; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4608,11 +4608,11 @@ public: desc.buffer = buffer(); object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - nullptr, + context(), + flags, + &format, + &desc, + nullptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4668,11 +4668,11 @@ public: desc.image_row_pitch = rowPitch; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4682,7 +4682,7 @@ public: } Image1DArray() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -4708,7 +4708,7 @@ public: /*! \brief Class interface for 2D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image2D : public Image @@ -4784,7 +4784,7 @@ public: /*! \brief Constructs a 2D Image from a buffer. * \note This will share storage with the underlying buffer. * - * Requires OpenCL 2.0 or newer or OpenCL 1.2 and the + * Requires OpenCL 2.0 or newer or OpenCL 1.2 and the * cl_khr_image2d_from_buffer extension. * * Wraps clCreateImage(). @@ -4827,10 +4827,10 @@ public: * \note This will share storage with the underlying image but may * reinterpret the channel order and type. * - * The image will be created matching with a descriptor matching the source. + * The image will be created matching with a descriptor matching the source. * * \param order is the channel order to reinterpret the image data as. - * The channel order may differ as described in the OpenCL + * The channel order may differ as described in the OpenCL * 2.0 API specification. * * Wraps clCreateImage(). @@ -4844,9 +4844,9 @@ public: cl_int error; // Descriptor fields have to match source image - size_type sourceWidth = + size_type sourceWidth = sourceImage.getImageInfo(); - size_type sourceHeight = + size_type sourceHeight = sourceImage.getImageInfo(); size_type sourceRowPitch = sourceImage.getImageInfo(); @@ -4857,7 +4857,7 @@ public: cl_image_format sourceFormat = sourceImage.getImageInfo(); - // Update only the channel order. + // Update only the channel order. // Channel format inherited from source. sourceFormat.image_channel_order = order; @@ -4918,13 +4918,13 @@ public: /*! \brief Class interface for GL 2D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. */ -class CL_API_PREFIX__VERSION_1_1_DEPRECATED Image2DGL : public Image2D +class CL_API_PREFIX__VERSION_1_1_DEPRECATED Image2DGL : public Image2D { public: /*! \brief Constructs an Image2DGL in a specified context, from a given @@ -4955,7 +4955,7 @@ public: } } - + //! \brief Default constructor - initializes to nullptr. Image2DGL() : Image2D() { } @@ -4966,7 +4966,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image2DGL(const cl_mem& image, bool retainObject = false) : + explicit Image2DGL(const cl_mem& image, bool retainObject = false) : Image2D(image, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -5014,11 +5014,11 @@ public: desc.image_slice_pitch = slicePitch; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -5028,7 +5028,7 @@ public: } Image2DArray() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -5050,7 +5050,7 @@ public: /*! \brief Class interface for 3D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3D : public Image @@ -5099,11 +5099,11 @@ public: desc.image_slice_pitch = slice_pitch; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -5137,7 +5137,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image3D(const cl_mem& image3D, bool retainObject = false) : + explicit Image3D(const cl_mem& image3D, bool retainObject = false) : Image(image3D, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -5156,9 +5156,9 @@ public: /*! \brief Class interface for GL 3D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3DGL : public Image3D @@ -5202,7 +5202,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image3DGL(const cl_mem& image, bool retainObject = false) : + explicit Image3DGL(const cl_mem& image, bool retainObject = false) : Image3D(image, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -5238,8 +5238,8 @@ public: { cl_int error; object_ = ::clCreateFromGLTexture( - context(), - flags, + context(), + flags, target, miplevel, texobj, @@ -5252,7 +5252,7 @@ public: } ImageGL() : Image() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -5260,7 +5260,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit ImageGL(const cl_mem& image, bool retainObject = false) : + explicit ImageGL(const cl_mem& image, bool retainObject = false) : Image(image, retainObject) { } ImageGL& operator = (const cl_mem& rhs) @@ -5394,7 +5394,7 @@ public: * to the same underlying cl_sampler as the original. For details, see * clRetainSampler() and clReleaseSampler(). * - * \see cl_sampler + * \see cl_sampler */ class Sampler : public detail::Wrapper { @@ -5442,18 +5442,18 @@ public: if (err != nullptr) { *err = error; } -#endif +#endif } /*! \brief Constructor from cl_sampler - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_sampler * into the new Sampler object. */ - explicit Sampler(const cl_sampler& sampler, bool retainObject = false) : + explicit Sampler(const cl_sampler& sampler, bool retainObject = false) : detail::Wrapper(sampler, retainObject) { } /*! \brief Assignment operator from cl_sampler - takes ownership. @@ -5467,7 +5467,7 @@ public: return *this; } - + //! \brief Wrapper for clGetSamplerInfo(). template @@ -5552,17 +5552,17 @@ public: NDRange(array a) : NDRange(a[0], a[1], a[2]){} /*! \brief Conversion operator to const size_type *. - * + * * \returns a pointer to the size of the first dimension. */ - operator const size_type*() const { - return sizes_; + operator const size_type*() const { + return sizes_; } //! \brief Queries the number of dimensions in the range. - size_type dimensions() const - { - return dimensions_; + size_type dimensions() const + { + return dimensions_; } //! \brief Returns the size of the object in bytes based on the @@ -5576,7 +5576,7 @@ public: { return sizes_; } - + const size_type* get() const { return sizes_; @@ -5624,7 +5624,7 @@ struct KernelArgumentHandler static const void* ptr(const LocalSpaceArg&) { return nullptr; } }; -} +} //! \endcond /*! Local @@ -5654,14 +5654,14 @@ public: Kernel() { } /*! \brief Constructor from cl_kernel - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_kernel * into the new Kernel object. */ - explicit Kernel(const cl_kernel& kernel, bool retainObject = false) : + explicit Kernel(const cl_kernel& kernel, bool retainObject = false) : detail::Wrapper(kernel, retainObject) { } /*! \brief Assignment operator from cl_kernel - takes ownership. @@ -5744,7 +5744,7 @@ public: } return param; } - + #if defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) || CL_HPP_TARGET_OPENCL_VERSION >= 210 cl_int getSubGroupInfo(const cl::Device &dev, cl_kernel_sub_group_info name, const cl::NDRange &range, size_type* param) const { @@ -5836,7 +5836,7 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 200 /*! - * Specify a vector of SVM pointers that the kernel may access in + * Specify a vector of SVM pointers that the kernel may access in * addition to its arguments. */ cl_int setSVMPointers(const vector &pointerList) @@ -5868,7 +5868,7 @@ public: * * \note It is only possible to enable fine-grained system SVM if all devices * in the context associated with kernel support it. - * + * * \param svmEnabled True if fine-grained system SVM is requested. False otherwise. * \return CL_SUCCESS if the function was executed succesfully. CL_INVALID_OPERATION * if no devices in the context support fine-grained system SVM. @@ -5887,7 +5887,7 @@ public: ) ); } - + template void setSVMPointersHelper(std::array &pointerList, const pointer &t0, const pointer &t1, Ts & ... ts) { @@ -5979,7 +5979,7 @@ public: typedef vector > Binaries; typedef vector > Sources; #endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) - + Program( const string& source, bool build = false, @@ -6047,7 +6047,7 @@ public: #endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) nullptr, nullptr); - + detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo()); } @@ -6249,7 +6249,7 @@ public: * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. * \param err if non-nullptr will be set to CL_SUCCESS on successful operation or one of the following errors: * CL_INVALID_CONTEXT if context is not a valid context. - * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; * or if any entry in binaries is nullptr or has length 0. * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. @@ -6263,9 +6263,9 @@ public: cl_int* err = nullptr) { cl_int error; - + const size_type numDevices = devices.size(); - + // Catch size mismatch early and return if(binaries.size() != numDevices) { error = CL_INVALID_VALUE; @@ -6290,7 +6290,7 @@ public: lengths[i] = binaries[(int)i].second; } #endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) - + vector deviceIDs(numDevices); for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); @@ -6299,7 +6299,7 @@ public: if(binaryStatus) { binaryStatus->resize(numDevices); } - + object_ = ::clCreateProgramWithBinary( context(), (cl_uint) devices.size(), deviceIDs.data(), @@ -6313,7 +6313,7 @@ public: } } - + #if CL_HPP_TARGET_OPENCL_VERSION >= 120 /** * Create program using builtin kernels. @@ -6333,12 +6333,12 @@ public: for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } - + object_ = ::clCreateProgramWithBuiltInKernels( - context(), + context(), (cl_uint) devices.size(), deviceIDs.data(), - kernelNames.c_str(), + kernelNames.c_str(), &error); detail::errHandler(error, __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR); @@ -6349,7 +6349,7 @@ public: #endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 Program() { } - + /*! \brief Constructor from cl_program - takes ownership. * @@ -6357,7 +6357,7 @@ public: * Defaults to false to maintain compatibility with * earlier versions. */ - explicit Program(const cl_program& program, bool retainObject = false) : + explicit Program(const cl_program& program, bool retainObject = false) : detail::Wrapper(program, retainObject) { } Program& operator = (const cl_program& rhs) @@ -6375,7 +6375,7 @@ public: { size_type numDevices = devices.size(); vector deviceIDs(numDevices); - + for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } @@ -6492,9 +6492,9 @@ public: } return param; } - + /** - * Build info function that returns a vector of device/info pairs for the specified + * Build info function that returns a vector of device/info pairs for the specified * info type and for all devices in the program. * On an error reading the info for any device, an empty vector of info will be returned. */ @@ -6546,7 +6546,7 @@ public: } vector value(numKernels); - + err = ::clCreateKernelsInProgram( object_, numKernels, value.data(), nullptr); if (err != CL_SUCCESS) { @@ -6559,7 +6559,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < value.size(); i++) { - // We do not need to retain because this kernel is being created + // We do not need to retain because this kernel is being created // by the runtime (*kernels)[i] = Kernel(value[i], false); } @@ -6773,7 +6773,7 @@ inline Kernel::Kernel(const Program& program, const char* name, cl_int* err) enum class QueueProperties : cl_command_queue_properties { - None = 0, + None_ = 0,//Had to change this because "None" wouldn't compile in gcc. Profiling = CL_QUEUE_PROFILING_ENABLE, OutOfOrder = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, }; @@ -6851,7 +6851,7 @@ public: default_ = CommandQueue(); } #endif // #ifdef CL_HPP_UNIT_TEST_ENABLE - + /*! * \brief Constructs a CommandQueue based on passed properties. @@ -7213,7 +7213,7 @@ public: #endif // CL_HPP_MINIMUM_OPENCL_VERSION < 200 } - static CommandQueue getDefault(cl_int * err = nullptr) + static CommandQueue getDefault(cl_int * err = nullptr) { std::call_once(default_initialized_, makeDefault); #if CL_HPP_TARGET_OPENCL_VERSION >= 200 @@ -7250,7 +7250,7 @@ public: * Defaults to false to maintain compatibility with * earlier versions. */ - explicit CommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : + explicit CommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : detail::Wrapper(commandQueue, retainObject) { } CommandQueue& operator = (const cl_command_queue& rhs) @@ -7372,8 +7372,8 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadBufferRect( - object_, - buffer(), + object_, + buffer(), blocking, buffer_offset.data(), host_offset.data(), @@ -7407,7 +7407,7 @@ public: void* ptr, const vector* events = nullptr, Event* event = nullptr) const - { + { return enqueueReadBufferRect( buffer, blocking, @@ -7440,8 +7440,8 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteBufferRect( - object_, - buffer(), + object_, + buffer(), blocking, buffer_offset.data(), host_offset.data(), @@ -7477,7 +7477,7 @@ public: Event* event = nullptr) const { return enqueueWriteBufferRect( - buffer, + buffer, blocking, { buffer_offset[0], buffer_offset[1], 0 }, { host_offset[0], host_offset[1], 0 }, @@ -7507,9 +7507,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferRect( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), dst_origin.data(), region.data(), @@ -7560,10 +7560,10 @@ public: /** * Enqueue a command to fill a buffer object with a pattern * of a given size. The pattern is specified as a vector type. - * \tparam PatternType The datatype of the pattern field. + * \tparam PatternType The datatype of the pattern field. * The pattern type must be an accepted OpenCL data type. - * \tparam offset Is the offset in bytes into the buffer at - * which to start filling. This must be a multiple of + * \tparam offset Is the offset in bytes into the buffer at + * which to start filling. This must be a multiple of * the pattern size. * \tparam size Is the size in bytes of the region to fill. * This must be a multiple of the pattern size. @@ -7580,11 +7580,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillBuffer( - object_, + object_, buffer(), static_cast(&pattern), - sizeof(PatternType), - offset, + sizeof(PatternType), + offset, size, (events != nullptr) ? (cl_uint) events->size() : 0, (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, @@ -7612,13 +7612,13 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadImage( - object_, - image(), - blocking, + object_, + image(), + blocking, origin.data(), - region.data(), - row_pitch, - slice_pitch, + region.data(), + row_pitch, + slice_pitch, ptr, (events != nullptr) ? (cl_uint) events->size() : 0, (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, @@ -7668,13 +7668,13 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteImage( - object_, - image(), - blocking, + object_, + image(), + blocking, origin.data(), - region.data(), - row_pitch, - slice_pitch, + region.data(), + row_pitch, + slice_pitch, ptr, (events != nullptr) ? (cl_uint) events->size() : 0, (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, @@ -7722,11 +7722,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyImage( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), - dst_origin.data(), + dst_origin.data(), region.data(), (events != nullptr) ? (cl_uint) events->size() : 0, (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, @@ -7764,15 +7764,15 @@ public: * \param fillColor is the color to use to fill the image. * This is a four component RGBA floating-point, signed integer * or unsigned integer color value if the image channel data - * type is an unnormalized signed integer type. + * type is an unnormalized signed integer type. */ template typename std::enable_if::value || std::is_same::value || std::is_same::value, - cl_int>::type + cl_int>::type enqueueFillImage( - const Image& image, + const Image& image, T fillColor, const array& origin, const array& region, @@ -7839,11 +7839,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyImageToBuffer( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), - region.data(), + region.data(), dst_offset, (events != nullptr) ? (cl_uint) events->size() : 0, (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, @@ -7864,7 +7864,7 @@ public: size_type dst_offset, const vector* events = nullptr, Event* event = nullptr) const - { + { return enqueueCopyImageToBuffer( src, dst, @@ -7887,11 +7887,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferToImage( - object_, - src(), - dst(), + object_, + src(), + dst(), src_offset, - dst_origin.data(), + dst_origin.data(), region.data(), (events != nullptr) ? (cl_uint) events->size() : 0, (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, @@ -7915,7 +7915,7 @@ public: { return enqueueCopyBufferToImage( src, - dst, + dst, src_offset, { dst_origin[0], dst_origin[1], 0 }, { region[0], region[1], 1 }, @@ -7968,7 +7968,7 @@ public: cl_int error; void * result = ::clEnqueueMapImage( object_, image(), blocking, flags, - origin.data(), + origin.data(), region.data(), row_pitch, slice_pitch, (events != nullptr) ? (cl_uint) events->size() : 0, @@ -8187,14 +8187,14 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 120 /** - * Enqueues a marker command which waits for either a list of events to complete, + * Enqueues a marker command which waits for either a list of events to complete, * or all previously enqueued commands to complete. * - * Enqueues a marker command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command returns an event which can be waited on, - * i.e. this event can be waited on to insure that all events either in the event_wait_list - * or all previously enqueued commands, queued before this command to command_queue, + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, * have completed. */ cl_int enqueueMarkerWithWaitList( @@ -8219,12 +8219,12 @@ public: /** * A synchronization point that enqueues a barrier operation. * - * Enqueues a barrier command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command blocks command execution, that is, any - * following commands enqueued after it do not execute until it completes. This command - * returns an event which can be waited on, i.e. this event can be waited on to insure that - * all events either in the event_wait_list or all previously enqueued commands, queued + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued * before this command to command_queue, have completed. */ cl_int enqueueBarrierWithWaitList( @@ -8245,7 +8245,7 @@ public: return err; } - + /** * Enqueues a command to indicate with which device a set of memory objects * should be associated. @@ -8258,17 +8258,17 @@ public: ) const { cl_event tmp; - + vector localMemObjects(memObjects.size()); for( int i = 0; i < (int)memObjects.size(); ++i ) { localMemObjects[i] = memObjects[i](); } - + cl_int err = detail::errHandler( ::clEnqueueMigrateMemObjects( - object_, - (cl_uint)memObjects.size(), + object_, + (cl_uint)memObjects.size(), localMemObjects.data(), flags, (events != nullptr) ? (cl_uint) events->size() : 0, @@ -8404,7 +8404,7 @@ public: } #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 - + cl_int enqueueNDRangeKernel( const Kernel& kernel, const NDRange& offset, @@ -8469,7 +8469,7 @@ public: for (unsigned int i = 0; i < elements; i++) { mems[i] = ((*mem_objects)[i])(); } - + cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueNativeKernel( @@ -8492,13 +8492,13 @@ public: * Deprecated APIs for 1.2 */ #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) - CL_API_PREFIX__VERSION_1_1_DEPRECATED + CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueMarker(Event* event = nullptr) const CL_API_SUFFIX__VERSION_1_1_DEPRECATED { cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueMarker( - object_, + object_, (event != nullptr) ? &tmp : nullptr), __ENQUEUE_MARKER_ERR); @@ -8589,7 +8589,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( #if CL_HPP_MINIMUM_OPENCL_VERSION < 120 CL_HPP_INIT_CL_EXT_FCN_PTR_(clEnqueueAcquireD3D10ObjectsKHR); #endif - + cl_event tmp; cl_int err = detail::errHandler( pfn_clEnqueueAcquireD3D10ObjectsKHR( @@ -8687,7 +8687,7 @@ CL_HPP_DEFINE_STATIC_MEMBER_ cl_int CommandQueue::default_error_ = CL_SUCCESS; #if CL_HPP_TARGET_OPENCL_VERSION >= 200 enum class DeviceQueueProperties : cl_command_queue_properties { - None = 0, + None_ = 0,//Had to change this because "None" wouldn't compile in gcc. Profiling = CL_QUEUE_PROFILING_ENABLE, }; @@ -8737,7 +8737,7 @@ public: DeviceCommandQueue( const Context& context, const Device& device, - DeviceQueueProperties properties = DeviceQueueProperties::None, + DeviceQueueProperties properties = DeviceQueueProperties::None_, cl_int* err = nullptr) { cl_int error; @@ -8762,7 +8762,7 @@ public: const Context& context, const Device& device, cl_uint queueSize, - DeviceQueueProperties properties = DeviceQueueProperties::None, + DeviceQueueProperties properties = DeviceQueueProperties::None_, cl_int* err = nullptr) { cl_int error; @@ -8771,7 +8771,7 @@ public: CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | static_cast(properties); cl_queue_properties queue_properties[] = { CL_QUEUE_PROPERTIES, mergedProperties, - CL_QUEUE_SIZE, queueSize, + CL_QUEUE_SIZE, queueSize, 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); @@ -8878,7 +8878,7 @@ public: } /*! - * Create a new default device command queue for the specified device + * Create a new default device command queue for the specified device * and of the requested size in bytes. * If there is already a default queue for the specified device this * function will return the pre-existing queue. @@ -8974,7 +8974,7 @@ Buffer::Buffer( if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + size_type size = sizeof(DataType)*(endIterator - startIterator); if( useHostPtr ) { @@ -9147,7 +9147,7 @@ inline cl_int enqueueMapSVM( } /** - * Enqueues to the default queue a command that will allow the host to + * Enqueues to the default queue a command that will allow the host to * update a region of a coarse-grained SVM buffer. * This variant takes a cl::pointer instance. */ @@ -9225,7 +9225,7 @@ inline cl_int enqueueUnmapMemObject( #if CL_HPP_TARGET_OPENCL_VERSION >= 200 /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a raw SVM pointer. */ @@ -9241,13 +9241,13 @@ inline cl_int enqueueUnmapSVM( return detail::errHandler(error, __ENQUEUE_UNMAP_MEM_OBJECT_ERR); } - return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), + return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), __ENQUEUE_UNMAP_MEM_OBJECT_ERR); } /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a cl::pointer instance. */ @@ -9268,7 +9268,7 @@ inline cl_int enqueueUnmapSVM( } /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a cl::vector instance. */ @@ -9351,11 +9351,11 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + size_type length = endIterator-startIterator; size_type byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = static_cast(queue.enqueueMapBuffer(buffer, CL_TRUE, CL_MAP_WRITE, 0, byteLength, 0, 0, &error)); // if exceptions enabled, enqueueMapBuffer will throw if( error != CL_SUCCESS ) { @@ -9363,8 +9363,8 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera } #if defined(_MSC_VER) std::copy( - startIterator, - endIterator, + startIterator, + endIterator, stdext::checked_array_iterator( pointer, length)); #else @@ -9373,7 +9373,7 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -9390,11 +9390,11 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + size_type length = endIterator-startIterator; size_type byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = static_cast(queue.enqueueMapBuffer(buffer, CL_TRUE, CL_MAP_READ, 0, byteLength, 0, 0, &error)); // if exceptions enabled, enqueueMapBuffer will throw if( error != CL_SUCCESS ) { @@ -9404,7 +9404,7 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -9456,25 +9456,25 @@ inline cl_int enqueueReadBufferRect( } return queue.enqueueReadBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } inline cl_int enqueueReadBufferRect( - const Buffer& buffer, + const Buffer& buffer, cl_bool blocking, const array& buffer_offset, - const array& host_offset, + const array& host_offset, const array& region, size_type buffer_row_pitch, size_type buffer_slice_pitch, @@ -9521,17 +9521,17 @@ inline cl_int enqueueWriteBufferRect( } return queue.enqueueWriteBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -9550,11 +9550,11 @@ inline cl_int enqueueWriteBufferRect( Event* event = nullptr) { return enqueueWriteBufferRect( - buffer, + buffer, blocking, { buffer_offset[0], buffer_offset[1], 0 }, { host_offset[0], host_offset[1], 0 }, - { region[0], region[1], 1 }, + { region[0], region[1], 1 }, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, @@ -9594,7 +9594,7 @@ inline cl_int enqueueCopyBufferRect( src_slice_pitch, dst_row_pitch, dst_slice_pitch, - events, + events, event); } @@ -9613,10 +9613,10 @@ inline cl_int enqueueCopyBufferRect( { return enqueueCopyBufferRect( src, - dst, + dst, { src_origin[0], src_origin[1], 0 }, { dst_origin[0], dst_origin[1], 0 }, - { region[0], region[1], 1 }, + { region[0], region[1], 1 }, src_row_pitch, src_slice_pitch, dst_row_pitch, @@ -9635,7 +9635,7 @@ inline cl_int enqueueReadImage( size_type slice_pitch, void* ptr, const vector* events = nullptr, - Event* event = nullptr) + Event* event = nullptr) { cl_int error; CommandQueue queue = CommandQueue::getDefault(&error); @@ -9652,24 +9652,24 @@ inline cl_int enqueueReadImage( row_pitch, slice_pitch, ptr, - events, + events, event); } inline cl_int enqueueReadImage( - const Image& image, + const Image& image, cl_bool blocking, const array& origin, const array& region, size_type row_pitch, size_type slice_pitch, - void* ptr, + void* ptr, const vector* events = nullptr, Event* event = nullptr) { return enqueueReadImage( image, - blocking, + blocking, { origin[0], origin[1], 0 }, { region[0], region[1], 1 }, row_pitch, @@ -9705,31 +9705,31 @@ inline cl_int enqueueWriteImage( row_pitch, slice_pitch, ptr, - events, + events, event); } inline cl_int enqueueWriteImage( - const Image& image, + const Image& image, cl_bool blocking, const array& origin, const array& region, - size_type row_pitch, + size_type row_pitch, size_type slice_pitch, const void* ptr, const vector* events = nullptr, Event* event = nullptr) { return enqueueWriteImage( - image, - blocking, + image, + blocking, { origin[0], origin[1], 0 }, - { region[0], region[1], 1 }, + { region[0], region[1], 1 }, row_pitch, slice_pitch, ptr, events, - event); + event); } inline cl_int enqueueCopyImage( @@ -9759,7 +9759,7 @@ inline cl_int enqueueCopyImage( } inline cl_int enqueueCopyImage( - const Image& src, + const Image& src, const Image& dst, const array& src_origin, const array& dst_origin, @@ -9768,7 +9768,7 @@ inline cl_int enqueueCopyImage( Event* event = nullptr) { return enqueueCopyImage( - src, + src, dst, { src_origin[0], src_origin[1], 0 }, { dst_origin[0], dst_origin[1], 0 }, @@ -9804,7 +9804,7 @@ inline cl_int enqueueCopyImageToBuffer( } inline cl_int enqueueCopyImageToBuffer( - const Image& src, + const Image& src, const Buffer& dst, const array& src_origin, const array& region, @@ -9893,7 +9893,7 @@ inline cl_int finish(void) if (error != CL_SUCCESS) { return error; - } + } return queue.finish(); @@ -9912,63 +9912,63 @@ private: friend class KernelFunctor; public: - EnqueueArgs(NDRange global) : + EnqueueArgs(NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(NDRange global, NDRange local) : + EnqueueArgs(NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(Event e, NDRange global) : + EnqueueArgs(Event e, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(const vector &events, NDRange global) : + EnqueueArgs(const vector &events, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -9976,9 +9976,9 @@ public: } - EnqueueArgs(const vector &events, NDRange global, NDRange local) : + EnqueueArgs(const vector &events, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -9986,9 +9986,9 @@ public: } - EnqueueArgs(const vector &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(const vector &events, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -9996,63 +9996,63 @@ public: } - EnqueueArgs(CommandQueue &queue, NDRange global) : + EnqueueArgs(CommandQueue &queue, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -10060,9 +10060,9 @@ public: } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -10070,9 +10070,9 @@ public: } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -10087,7 +10087,7 @@ public: /** * Type safe kernel functor. - * + * */ template class KernelFunctor @@ -10139,7 +10139,7 @@ public: { Event event; setArgs<0>(std::forward(ts)...); - + args.queue_.enqueueNDRangeKernel( kernel_, args.offset_, @@ -10172,7 +10172,7 @@ public: args.local_, &args.events_, &event); - + return event; } @@ -10245,7 +10245,7 @@ public: Semaphore( const Context &context, const vector& sema_props, - cl_int *err = nullptr) + cl_int *err = nullptr) { /* initialization of addresses to extension functions (it is done only once) */ std::call_once(ext_init_, initExtensions, context); @@ -10259,7 +10259,7 @@ public: sema_props.data(), &error); } - + detail::errHandler(error, __CREATE_SEMAPHORE_KHR_WITH_PROPERTIES_ERR); if (err != nullptr) { @@ -10269,7 +10269,7 @@ public: Semaphore( const vector& sema_props, cl_int* err = nullptr):Semaphore(Context::getDefault(err), sema_props, err) {} - + explicit Semaphore(const cl_semaphore_khr& semaphore, bool retainObject = false) : detail::Wrapper(semaphore, retainObject) {} Semaphore& operator = (const cl_semaphore_khr& rhs) { @@ -10296,13 +10296,13 @@ public: detail::cl_semaphore_info_khr, name>::param_type param; cl_int result = getInfo(name, ¶m); if (err != nullptr) { - *err = result; + *err = result; } - return param; + return param; } cl_int retain() - { + { if (pfn_clRetainSemaphoreKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __RETAIN_SEMAPHORE_KHR_ERR); @@ -10311,7 +10311,7 @@ public: } cl_int release() - { + { if (pfn_clReleaseSemaphoreKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __RELEASE_SEMAPHORE_KHR_ERR); @@ -10972,24 +10972,24 @@ public: #undef CL_HPP_ERR_STR_ #if !defined(CL_HPP_USER_OVERRIDE_ERROR_STRINGS) -#undef __GET_DEVICE_INFO_ERR -#undef __GET_PLATFORM_INFO_ERR -#undef __GET_DEVICE_IDS_ERR -#undef __GET_PLATFORM_IDS_ERR -#undef __GET_CONTEXT_INFO_ERR -#undef __GET_EVENT_INFO_ERR -#undef __GET_EVENT_PROFILE_INFO_ERR -#undef __GET_MEM_OBJECT_INFO_ERR -#undef __GET_IMAGE_INFO_ERR -#undef __GET_SAMPLER_INFO_ERR -#undef __GET_KERNEL_INFO_ERR -#undef __GET_KERNEL_ARG_INFO_ERR -#undef __GET_KERNEL_SUB_GROUP_INFO_ERR -#undef __GET_KERNEL_WORK_GROUP_INFO_ERR -#undef __GET_PROGRAM_INFO_ERR -#undef __GET_PROGRAM_BUILD_INFO_ERR -#undef __GET_COMMAND_QUEUE_INFO_ERR -#undef __CREATE_CONTEXT_ERR +#undef __GET_DEVICE_INFO_ERR +#undef __GET_PLATFORM_INFO_ERR +#undef __GET_DEVICE_IDS_ERR +#undef __GET_PLATFORM_IDS_ERR +#undef __GET_CONTEXT_INFO_ERR +#undef __GET_EVENT_INFO_ERR +#undef __GET_EVENT_PROFILE_INFO_ERR +#undef __GET_MEM_OBJECT_INFO_ERR +#undef __GET_IMAGE_INFO_ERR +#undef __GET_SAMPLER_INFO_ERR +#undef __GET_KERNEL_INFO_ERR +#undef __GET_KERNEL_ARG_INFO_ERR +#undef __GET_KERNEL_SUB_GROUP_INFO_ERR +#undef __GET_KERNEL_WORK_GROUP_INFO_ERR +#undef __GET_PROGRAM_INFO_ERR +#undef __GET_PROGRAM_BUILD_INFO_ERR +#undef __GET_COMMAND_QUEUE_INFO_ERR +#undef __CREATE_CONTEXT_ERR #undef __CREATE_CONTEXT_FROM_TYPE_ERR #undef __CREATE_COMMAND_BUFFER_KHR_ERR #undef __GET_COMMAND_BUFFER_INFO_KHR_ERR @@ -11008,80 +11008,80 @@ public: #undef __GET_MUTABLE_COMMAND_INFO_KHR_ERR #undef __RETAIN_COMMAND_BUFFER_KHR_ERR #undef __RELEASE_COMMAND_BUFFER_KHR_ERR -#undef __GET_SUPPORTED_IMAGE_FORMATS_ERR +#undef __GET_SUPPORTED_IMAGE_FORMATS_ERR #undef __SET_CONTEXT_DESCTRUCTOR_CALLBACK_ERR -#undef __CREATE_BUFFER_ERR -#undef __COPY_ERR -#undef __CREATE_SUBBUFFER_ERR -#undef __CREATE_GL_BUFFER_ERR -#undef __CREATE_GL_RENDER_BUFFER_ERR -#undef __GET_GL_OBJECT_INFO_ERR -#undef __CREATE_IMAGE_ERR -#undef __CREATE_GL_TEXTURE_ERR -#undef __IMAGE_DIMENSION_ERR -#undef __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR -#undef __CREATE_USER_EVENT_ERR -#undef __SET_USER_EVENT_STATUS_ERR -#undef __SET_EVENT_CALLBACK_ERR -#undef __WAIT_FOR_EVENTS_ERR -#undef __CREATE_KERNEL_ERR -#undef __SET_KERNEL_ARGS_ERR -#undef __CREATE_PROGRAM_WITH_SOURCE_ERR -#undef __CREATE_PROGRAM_WITH_BINARY_ERR -#undef __CREATE_PROGRAM_WITH_IL_ERR -#undef __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR -#undef __BUILD_PROGRAM_ERR -#undef __COMPILE_PROGRAM_ERR -#undef __LINK_PROGRAM_ERR -#undef __CREATE_KERNELS_IN_PROGRAM_ERR -#undef __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR -#undef __CREATE_SAMPLER_WITH_PROPERTIES_ERR -#undef __SET_COMMAND_QUEUE_PROPERTY_ERR -#undef __ENQUEUE_READ_BUFFER_ERR -#undef __ENQUEUE_READ_BUFFER_RECT_ERR -#undef __ENQUEUE_WRITE_BUFFER_ERR -#undef __ENQUEUE_WRITE_BUFFER_RECT_ERR -#undef __ENQEUE_COPY_BUFFER_ERR -#undef __ENQEUE_COPY_BUFFER_RECT_ERR -#undef __ENQUEUE_FILL_BUFFER_ERR -#undef __ENQUEUE_READ_IMAGE_ERR -#undef __ENQUEUE_WRITE_IMAGE_ERR -#undef __ENQUEUE_COPY_IMAGE_ERR -#undef __ENQUEUE_FILL_IMAGE_ERR -#undef __ENQUEUE_COPY_IMAGE_TO_BUFFER_ERR -#undef __ENQUEUE_COPY_BUFFER_TO_IMAGE_ERR -#undef __ENQUEUE_MAP_BUFFER_ERR -#undef __ENQUEUE_MAP_IMAGE_ERR -#undef __ENQUEUE_UNMAP_MEM_OBJECT_ERR -#undef __ENQUEUE_NDRANGE_KERNEL_ERR -#undef __ENQUEUE_NATIVE_KERNEL -#undef __ENQUEUE_MIGRATE_MEM_OBJECTS_ERR +#undef __CREATE_BUFFER_ERR +#undef __COPY_ERR +#undef __CREATE_SUBBUFFER_ERR +#undef __CREATE_GL_BUFFER_ERR +#undef __CREATE_GL_RENDER_BUFFER_ERR +#undef __GET_GL_OBJECT_INFO_ERR +#undef __CREATE_IMAGE_ERR +#undef __CREATE_GL_TEXTURE_ERR +#undef __IMAGE_DIMENSION_ERR +#undef __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR +#undef __CREATE_USER_EVENT_ERR +#undef __SET_USER_EVENT_STATUS_ERR +#undef __SET_EVENT_CALLBACK_ERR +#undef __WAIT_FOR_EVENTS_ERR +#undef __CREATE_KERNEL_ERR +#undef __SET_KERNEL_ARGS_ERR +#undef __CREATE_PROGRAM_WITH_SOURCE_ERR +#undef __CREATE_PROGRAM_WITH_BINARY_ERR +#undef __CREATE_PROGRAM_WITH_IL_ERR +#undef __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR +#undef __BUILD_PROGRAM_ERR +#undef __COMPILE_PROGRAM_ERR +#undef __LINK_PROGRAM_ERR +#undef __CREATE_KERNELS_IN_PROGRAM_ERR +#undef __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR +#undef __CREATE_SAMPLER_WITH_PROPERTIES_ERR +#undef __SET_COMMAND_QUEUE_PROPERTY_ERR +#undef __ENQUEUE_READ_BUFFER_ERR +#undef __ENQUEUE_READ_BUFFER_RECT_ERR +#undef __ENQUEUE_WRITE_BUFFER_ERR +#undef __ENQUEUE_WRITE_BUFFER_RECT_ERR +#undef __ENQEUE_COPY_BUFFER_ERR +#undef __ENQEUE_COPY_BUFFER_RECT_ERR +#undef __ENQUEUE_FILL_BUFFER_ERR +#undef __ENQUEUE_READ_IMAGE_ERR +#undef __ENQUEUE_WRITE_IMAGE_ERR +#undef __ENQUEUE_COPY_IMAGE_ERR +#undef __ENQUEUE_FILL_IMAGE_ERR +#undef __ENQUEUE_COPY_IMAGE_TO_BUFFER_ERR +#undef __ENQUEUE_COPY_BUFFER_TO_IMAGE_ERR +#undef __ENQUEUE_MAP_BUFFER_ERR +#undef __ENQUEUE_MAP_IMAGE_ERR +#undef __ENQUEUE_UNMAP_MEM_OBJECT_ERR +#undef __ENQUEUE_NDRANGE_KERNEL_ERR +#undef __ENQUEUE_NATIVE_KERNEL +#undef __ENQUEUE_MIGRATE_MEM_OBJECTS_ERR #undef __ENQUEUE_MIGRATE_SVM_ERR -#undef __ENQUEUE_ACQUIRE_GL_ERR -#undef __ENQUEUE_RELEASE_GL_ERR -#undef __CREATE_PIPE_ERR -#undef __GET_PIPE_INFO_ERR -#undef __RETAIN_ERR -#undef __RELEASE_ERR -#undef __FLUSH_ERR -#undef __FINISH_ERR -#undef __VECTOR_CAPACITY_ERR -#undef __CREATE_SUB_DEVICES_ERR -#undef __CREATE_SUB_DEVICES_ERR -#undef __ENQUEUE_MARKER_ERR -#undef __ENQUEUE_WAIT_FOR_EVENTS_ERR -#undef __ENQUEUE_BARRIER_ERR -#undef __UNLOAD_COMPILER_ERR -#undef __CREATE_GL_TEXTURE_2D_ERR -#undef __CREATE_GL_TEXTURE_3D_ERR -#undef __CREATE_IMAGE2D_ERR -#undef __CREATE_IMAGE3D_ERR -#undef __CREATE_COMMAND_QUEUE_ERR -#undef __ENQUEUE_TASK_ERR -#undef __CREATE_SAMPLER_ERR -#undef __ENQUEUE_MARKER_WAIT_LIST_ERR -#undef __ENQUEUE_BARRIER_WAIT_LIST_ERR -#undef __CLONE_KERNEL_ERR +#undef __ENQUEUE_ACQUIRE_GL_ERR +#undef __ENQUEUE_RELEASE_GL_ERR +#undef __CREATE_PIPE_ERR +#undef __GET_PIPE_INFO_ERR +#undef __RETAIN_ERR +#undef __RELEASE_ERR +#undef __FLUSH_ERR +#undef __FINISH_ERR +#undef __VECTOR_CAPACITY_ERR +#undef __CREATE_SUB_DEVICES_ERR +#undef __CREATE_SUB_DEVICES_ERR +#undef __ENQUEUE_MARKER_ERR +#undef __ENQUEUE_WAIT_FOR_EVENTS_ERR +#undef __ENQUEUE_BARRIER_ERR +#undef __UNLOAD_COMPILER_ERR +#undef __CREATE_GL_TEXTURE_2D_ERR +#undef __CREATE_GL_TEXTURE_3D_ERR +#undef __CREATE_IMAGE2D_ERR +#undef __CREATE_IMAGE3D_ERR +#undef __CREATE_COMMAND_QUEUE_ERR +#undef __ENQUEUE_TASK_ERR +#undef __CREATE_SAMPLER_ERR +#undef __ENQUEUE_MARKER_WAIT_LIST_ERR +#undef __ENQUEUE_BARRIER_WAIT_LIST_ERR +#undef __CLONE_KERNEL_ERR #undef __GET_HOST_TIMER_ERR #undef __GET_DEVICE_AND_HOST_TIMER_ERR #undef __GET_SEMAPHORE_KHR_INFO_ERR @@ -11100,4 +11100,4 @@ public: } // namespace cl -#endif // CL_HPP_ \ No newline at end of file +#endif // CL_HPP_ diff --git a/Source/Fractorium/FinalRenderDialog.cpp b/Source/Fractorium/FinalRenderDialog.cpp index 8f967c3..229a32a 100644 --- a/Source/Fractorium/FinalRenderDialog.cpp +++ b/Source/Fractorium/FinalRenderDialog.cpp @@ -25,6 +25,10 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(QWidget* p, Qt::WindowF m_Info = OpenCLInfo::Instance(); m_Fractorium = qobject_cast(p); m_Settings = FractoriumSettings::DefInstance(); + ui.FinalRenderIterationProgress->setAlignment(Qt::AlignCenter); + ui.FinalRenderFilteringProgress->setAlignment(Qt::AlignCenter); + ui.FinalRenderAccumProgress->setAlignment(Qt::AlignCenter); + ui.FinalRenderTotalProgress->setAlignment(Qt::AlignCenter); ui.FinalRenderThreadCountSpin->setRange(1, Timing::ProcessorCount()); connect(ui.FinalRenderEarlyClipCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnEarlyClipCheckBoxStateChanged(int)), Qt::QueuedConnection); connect(ui.FinalRenderYAxisUpCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnYAxisUpCheckBoxStateChanged(int)), Qt::QueuedConnection); @@ -44,7 +48,7 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(QWidget* p, Qt::WindowF SetupSpinner(ui.FinalRenderSizeTable, this, row, -1, m_WidthSpin, spinHeight, 10, std::numeric_limits::max(), 10, SIGNAL(valueChanged(int)), SLOT(OnWidthChanged(int)), true, 1920, 1920, 1920); SetupSpinner(ui.FinalRenderSizeTable, this, row, -1, m_HeightScaleSpin, spinHeight, 0.001, 99.99, 0.1, SIGNAL(valueChanged(double)), SLOT(OnHeightScaleChanged(double)), true, 1.0, 1.0, 1.0); SetupSpinner(ui.FinalRenderSizeTable, this, row, -1, m_HeightSpin, spinHeight, 10, std::numeric_limits::max(), 10, SIGNAL(valueChanged(int)), SLOT(OnHeightChanged(int)), true, 1080, 1080, 1080); - m_SubBatchPctSpin = (DoubleSpinBox*)ui.FinalRenderOpenCLSubBatchPctSpin; + m_SubBatchPctSpin = ui.FinalRenderOpenCLSubBatchPctSpin; m_SubBatchPctSpin->DoubleClick(true); m_SubBatchPctSpin->DoubleClickZero(0.025); m_SubBatchPctSpin->DoubleClickNonZero(0.025); diff --git a/Source/Fractorium/FinalRenderDialog.ui b/Source/Fractorium/FinalRenderDialog.ui index 41d9265..16f57ac 100644 --- a/Source/Fractorium/FinalRenderDialog.ui +++ b/Source/Fractorium/FinalRenderDialog.ui @@ -296,15 +296,15 @@ false + + 22 + 22 false - - 22 - AMD @@ -419,7 +419,7 @@ - + 0 @@ -441,22 +441,22 @@ <html><head/><body><p>The percentage of a sub batch to execute on each thread per kernel call when using OpenCL. Default: 0.025 (256 iters with a 10k sub batch size).</p><p>Increase this number for slightly faster render times.</p><p>Note that this can cause a crash and subsequent restart of the graphics driver if each kernel call takes too long. So reduce the value if you encounter such a problem.</p></body></html> - + OpenCL sub batch % per thread - + 3 - + 0.010000000000000 - + 1.000000000000000 - + 0.010000000000000 - + 0.250000000000000 @@ -593,30 +593,30 @@ false + + 35 + 85 false - - 35 - true false + + 22 + 22 false - - 22 - Width Scale @@ -811,30 +811,30 @@ false + + 35 + 110 false - - 35 - true false + + 22 + 22 false - - 22 - false @@ -1055,6 +1055,9 @@ 0 + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + @@ -1094,6 +1097,9 @@ 0 + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + @@ -1107,6 +1113,9 @@ 0 + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + @@ -1146,6 +1155,9 @@ 0 + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + @@ -1293,6 +1305,13 @@ + + + DoubleSpinBox + QWidget +
doublespinbox.h
+
+
FinalRenderEarlyClipCheckBox FinalRenderDoublePrecisionCheckBox diff --git a/Source/Fractorium/Fractorium.cpp b/Source/Fractorium/Fractorium.cpp index f942e7c..c0a35eb 100644 --- a/Source/Fractorium/Fractorium.cpp +++ b/Source/Fractorium/Fractorium.cpp @@ -148,6 +148,7 @@ Fractorium::Fractorium(QWidget* p) m_ProgressBar->setMaximumHeight(progressBarHeight); m_ProgressBar->setMinimumWidth(progressBarWidth); m_ProgressBar->setMaximumWidth(progressBarWidth); + m_ProgressBar->setAlignment(Qt::AlignCenter); ui.StatusBar->addPermanentWidget(m_ProgressBar); //Setup pointer in the GL window to point back to here. ui.GLDisplay->SetMainWindow(this); @@ -197,8 +198,24 @@ Fractorium::Fractorium(QWidget* p) { if (!QStyleFactory::keys().empty()) { - m_Theme = QStyleFactory::create(qApp->style()->objectName()); - setStyle(m_Theme); + auto foundFusion = false; + + for (auto& s : QStyleFactory::keys()) + { + if (s.compare("fusion", Qt::CaseInsensitive) == 0)//Default to fusion if it exists and the style has not been set yet. + { + m_Theme = QStyleFactory::create(s); + setStyle(m_Theme); + foundFusion = true; + break; + } + } + + if (!foundFusion) + { + m_Theme = QStyleFactory::create(qApp->style()->objectName()); + setStyle(m_Theme); + } } } diff --git a/Source/Fractorium/Fractorium.ui b/Source/Fractorium/Fractorium.ui index 08a9577..a73f0f6 100644 --- a/Source/Fractorium/Fractorium.ui +++ b/Source/Fractorium/Fractorium.ui @@ -77,8 +77,8 @@ 0 0 - 1279 - 980 + 1280 + 985
@@ -170,7 +170,7 @@ 0 0 230 - 931 + 926 @@ -480,9 +480,6 @@ Geometry - - AlignCenter - @@ -561,9 +558,6 @@ Iteration - - AlignCenter - @@ -661,9 +655,6 @@ Filter - - AlignCenter - @@ -1324,9 +1315,6 @@ Animation - - AlignCenter - @@ -1864,9 +1852,6 @@ Color - - AlignCenter - @@ -1895,7 +1880,7 @@ 310 - 439 + 444 @@ -2465,8 +2450,8 @@ 0 0 - 285 - 675 + 307 + 674 @@ -3155,7 +3140,7 @@ 0 0 291 - 874 + 869 @@ -3533,33 +3518,21 @@ Weight - - AlignCenter - Name - - AlignCenter - - - AlignLeading|AlignVCenter - - - AlignLeading|AlignVCenter - @@ -3761,9 +3734,6 @@ - - AlignLeading|AlignVCenter - @@ -3845,7 +3815,7 @@ false - 21 + 24 false @@ -4124,9 +4094,6 @@ true - - AlignLeading|AlignVCenter - @@ -4156,6 +4123,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -6279,8 +6259,8 @@ 0 0 - 267 - 656 + 269 + 650 @@ -6410,7 +6390,7 @@ 0 0 291 - 854 + 849 @@ -7153,9 +7133,6 @@ true - - AlignLeading|AlignVCenter - @@ -7291,7 +7268,7 @@ 0 0 1712 - 21 + 22 @@ -7524,8 +7501,8 @@ 0 0 - 422 - 587 + 418 + 631 @@ -7534,7 +7511,7 @@ 0 - + 4 @@ -8081,12 +8058,12 @@ Animation FPS: - - 200 - 1 + + 200 + 30 @@ -8140,9 +8117,9 @@ - - - + + + 2 diff --git a/Source/Fractorium/FractoriumXaos.cpp b/Source/Fractorium/FractoriumXaos.cpp index c646527..6b4a50a 100644 --- a/Source/Fractorium/FractoriumXaos.cpp +++ b/Source/Fractorium/FractoriumXaos.cpp @@ -176,16 +176,16 @@ void Fractorium::FillXaosTable() m_AppliedXaosTableModel->setVerticalHeaderLabels(vl); ui.XaosDistVizTableWidget->setRowCount(1); ui.XaosDistVizTableWidget->setColumnCount(count); - ui.XaosDistVizTableWidget->setHorizontalHeaderLabels(hl); - ui.XaosDistVizTableWidget->setVerticalHeaderLabels(blanks); ui.XaosDistVizTableWidget->verticalHeader()->setSectionsClickable(false); ui.XaosDistVizTableWidget->horizontalHeader()->setSectionsClickable(false); ui.XaosTableView->setModel(m_XaosTableModel); ui.XaosAppliedTableView->setModel(m_AppliedXaosTableModel); ui.XaosTableView->setItemDelegate(m_XaosTableItemDelegate);//No need for a delegate on the applied table because it's read-only. - ui.XaosDistVizTableWidget->verticalHeader()->setFixedWidth(ui.XaosTableView->verticalHeader()->width()); - SetTabOrder(this, ui.ClearXaosButton, ui.RandomXaosButton); ui.XaosDistVizTableWidget->setRowHeight(0, ui.XaosTableView->rowHeight(0) * count); + ui.XaosDistVizTableWidget->setHorizontalHeaderLabels(hl); + ui.XaosDistVizTableWidget->setVerticalHeaderLabels(vl); + SetTabOrder(this, ui.ClearXaosButton, ui.RandomXaosButton); + ui.XaosDistVizTableWidget->verticalHeader()->setStyleSheet("QHeaderView::section::vertical { color: rgba(0, 0, 0, 0); }"); m_Controller->FillXaos(); m_Controller->FillAppliedXaos(); //Needed to get the dark stylesheet to correctly color the top left corner button. diff --git a/Source/Fractorium/OptionsDialog.cpp b/Source/Fractorium/OptionsDialog.cpp index 610ed3d..2765b28 100644 --- a/Source/Fractorium/OptionsDialog.cpp +++ b/Source/Fractorium/OptionsDialog.cpp @@ -20,15 +20,39 @@ FractoriumOptionsDialog::FractoriumOptionsDialog(QWidget* p, Qt::WindowFlags f) ui.ThreadCountSpin->setRange(1, Timing::ProcessorCount()); connect(ui.OpenCLCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnOpenCLCheckBoxStateChanged(int)), Qt::QueuedConnection); connect(ui.DeviceTable, SIGNAL(cellChanged(int, int)), this, SLOT(OnDeviceTableCellChanged(int, int)), Qt::QueuedConnection); - SetupSpinner(table, this, row, 1, m_XmlTemporalSamplesSpin, spinHeight, 1, 1000, 100, "", "", true, 1000); - SetupSpinner(table, this, row, 1, m_XmlQualitySpin, spinHeight, 1, 200000, 50, "", "", true, 1000); - SetupSpinner(table, this, row, 1, m_XmlSupersampleSpin, spinHeight, 1, 4, 1, "", "", true, 2); + SetupSpinner(table, this, row, 1, m_XmlTemporalSamplesSpin, spinHeight, 1, 100000, 100, "", "", true, 300, 100, 100); + SetupSpinner(table, this, row, 1, m_XmlQualitySpin, spinHeight, 1, 200000, 50, "", "", true, 1000, 1000, 1000); + SetupSpinner(table, this, row, 1, m_XmlSupersampleSpin, spinHeight, 1, 4, 1, "", "", true, 2, 2, 2); m_IdEdit = new QLineEdit(ui.OptionsIdentityTable); ui.OptionsIdentityTable->setCellWidget(0, 1, m_IdEdit); m_UrlEdit = new QLineEdit(ui.OptionsIdentityTable); ui.OptionsIdentityTable->setCellWidget(1, 1, m_UrlEdit); m_NickEdit = new QLineEdit(ui.OptionsIdentityTable); ui.OptionsIdentityTable->setCellWidget(2, 1, m_NickEdit); + auto dspin = ui.OpenCLSubBatchPctSpin; + dspin->DoubleClick(true); + dspin->DoubleClickZero(0.025); + dspin->DoubleClickNonZero(0.025); + auto spin = ui.CpuQualitySpin; + spin->DoubleClick(true); + spin->DoubleClickZero(10); + spin->DoubleClickNonZero(10); + spin = ui.OpenCLQualitySpin; + spin->DoubleClick(true); + spin->DoubleClickZero(30); + spin->DoubleClickNonZero(30); + spin = ui.CpuSubBatchSpin; + spin->DoubleClick(true); + spin->DoubleClickZero(1); + spin->DoubleClickNonZero(1); + spin = ui.OpenCLSubBatchSpin; + spin->DoubleClick(true); + spin->DoubleClickZero(1); + spin->DoubleClickNonZero(1); + spin = ui.RandomCountSpin; + spin->DoubleClick(true); + spin->DoubleClickZero(1); + spin->DoubleClickNonZero(1); table->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); ui.OptionsIdentityTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); table = ui.DeviceTable; diff --git a/Source/Fractorium/OptionsDialog.ui b/Source/Fractorium/OptionsDialog.ui index c563761..651758a 100644 --- a/Source/Fractorium/OptionsDialog.ui +++ b/Source/Fractorium/OptionsDialog.ui @@ -193,15 +193,15 @@ false + + 22 + 22 false - - 22 - AMD @@ -221,25 +221,16 @@ Use - - AlignCenter - Primary - - AlignCenter - Device - - AlignCenter - @@ -290,36 +281,36 @@ - + <html><head/><body><p>The default quality per device to use for the interactive renderer when using OpenCL.</p><p>30 is a good number for this, but you can use a larger value if you have a faster GPU.</p></body></html> - + OpenCL Quality - + 1 - + 99999 - + 30 - + <html><head/><body><p>The number of ~8M iteration chunks ran using OpenCL in interactive mode for each mouse movement.</p><p>Increase this number for a higher quality image on each mouse movement, at the expense of responsiveness.</p></body></html> - + OpenCL chunks per mouse movement - + 1 - + 100 @@ -372,93 +363,93 @@ - + <html><head/><body><p>The number of ~10,000 iteration chunks ran per thread on the CPU in interactive mode for each mouse movement.</p><p>Increase this number for a higher quality image on each mouse movement, at the expense of responsiveness.</p><p>The number of iterations done in each chunk is controlled by the Sub Batch Size field in the Flame tab.</p></body></html> - + CPU chunks per mouse movement - + 1 - + 100 - + <html><head/><body><p>The number of threads to use with CPU rendering.</p><p>Decrease for more responsive editing, increase for better performance.</p></body></html> - + Threads - + 1 - + 64 - + <html><head/><body><p>The number of random flames to generate on startup.</p><p>These are usually of low quality, so leave the count as 1 unless you are searching for good randoms.</p></body></html> - + Randoms - + 1 - + 99999 - + <html><head/><body><p>The percentage of a sub batch to execute on each thread per kernel call when using OpenCL in interactive mode. Default: 0.025 (256 iters).</p><p>Increase this number for a higher quality image on each mouse movement, at the expense of responsiveness.</p><p>Note that this can cause a crash and subsequent restart of the graphics driver if each kernel call takes too long. So reduce the value if you encounter such a problem.</p></body></html> - + OpenCL sub batch percent per thread - + 3 - + 0.010000000000000 - + 1.000000000000000 - + 0.010000000000000 - + 0.025000000000000 - + <html><head/><body><p>The default quality to use for the interactive renderer when using the CPU.</p><p>10 is a good number for this, but you can use a larger value if you have a faster system.</p></body></html> - + CPU Quality - + 1 - + 99999 - + 10 @@ -638,30 +629,30 @@ false + + 35 + 110 false - - 35 - true false + + 22 + 22 false - - 22 - false @@ -831,30 +822,30 @@ false + + 35 + 110 false - - 35 - true false + + 22 + 22 false - - 22 - false @@ -952,6 +943,18 @@ + + + SpinBox + QWidget +
spinbox.h
+
+ + DoubleSpinBox + QWidget +
doublespinbox.h
+
+
EarlyClipCheckBox OpenCLCheckBox diff --git a/archive/build_linux.sh b/archive/build_linux.sh index 19a46fe..78b5541 100755 --- a/archive/build_linux.sh +++ b/archive/build_linux.sh @@ -12,9 +12,9 @@ FRACTORIUM_RPM_PACKAGE=$BUILD_PATH/../Bin/rpmbuild EXTRA_LIBS=/usr/lib/x86_64-linux-gnu # replace 5.12.8 by your QT version, and ensure the installation path is the same -QT_PATH=/home/$USER/Dev/Qt/5.12.8/gcc_64/bin +QT_PATH=/home/$USER/Dev/Qt/6.5.1/gcc_64/bin -LINUX_DEPLOY_QT=/home/$USER/Dev/linuxdeployqt-6-x86_64.AppImage +LINUX_DEPLOY_QT=/home/$USER/Dev/linuxdeployqt-continuous-x86_64.AppImage APP_IMAGE_TOOL=/home/$USER/Dev/appimagetool-x86_64.AppImage ####################### @@ -84,12 +84,12 @@ cp $FRACTORIUM_RELEASE_ROOT/ember* $FRACTORIUM_BIN cp $FRACTORIUM_RELEASE_ROOT/fractorium $FRACTORIUM_BIN cp $FRACTORIUM_RELEASE_ROOT/lib* $FRACTORIUM_LIB -cp $EXTRA_LIBS/libHalf.so.12 $FRACTORIUM_LIB -cp $EXTRA_LIBS/libIex-2_2.so.12 $FRACTORIUM_LIB -cp $EXTRA_LIBS/libIexMath-2_2.so.12 $FRACTORIUM_LIB -cp $EXTRA_LIBS/libIlmImf-2_2.so.22 $FRACTORIUM_LIB -cp $EXTRA_LIBS/libIlmThread-2_2.so.12 $FRACTORIUM_LIB -cp $EXTRA_LIBS/libImath-2_2.so.12 $FRACTORIUM_LIB +cp $EXTRA_LIBS/libHalf.so $FRACTORIUM_LIB +cp $EXTRA_LIBS/libIex.so $FRACTORIUM_LIB +cp $EXTRA_LIBS/libIexMath.so $FRACTORIUM_LIB +cp $EXTRA_LIBS/libIlmImf.so $FRACTORIUM_LIB +cp $EXTRA_LIBS/libIlmThread.so $FRACTORIUM_LIB +cp $EXTRA_LIBS/libImath.so $FRACTORIUM_LIB cp $EXTRA_LIBS/libjpeg.so.8 $FRACTORIUM_LIB cp $EXTRA_LIBS/libpng16.so.16 $FRACTORIUM_LIB cp $EXTRA_LIBS/libOpenCL.so.1 $FRACTORIUM_LIB