diff options
author | Ivan Shapovalov <intelfx@intelfx.name> | 2016-10-18 04:53:06 +0300 |
---|---|---|
committer | Ivan Shapovalov <intelfx@intelfx.name> | 2016-10-22 08:45:27 +0300 |
commit | 56f300607b1d0b81ab3269894fda5a066c46cdeb (patch) | |
tree | 60b4c5566cc4bbfad15a7791a4e20c2a60e16707 /src/routines/level1 | |
parent | b98af44fcf89b9946e1de438b1f5527e6bf28905 (diff) |
Routine: get rid of ::SetUp()
Since we now use C++ exceptions inside the implementation (and exceptions
can be thrown from constructors), there is no need for a separate
Routine::SetUp() function.
For this, we also change the way how the kernel source string is constructed.
The kernel-specific source code is now passed to the Routine ctor via
an initializer_list of C strings to avoid unnecessary data copying
while also working around C1091 of MSVC 2013.
Diffstat (limited to 'src/routines/level1')
-rw-r--r-- | src/routines/level1/xamax.cpp | 5 | ||||
-rw-r--r-- | src/routines/level1/xasum.cpp | 5 | ||||
-rw-r--r-- | src/routines/level1/xaxpy.cpp | 5 | ||||
-rw-r--r-- | src/routines/level1/xcopy.cpp | 5 | ||||
-rw-r--r-- | src/routines/level1/xdot.cpp | 5 | ||||
-rw-r--r-- | src/routines/level1/xnrm2.cpp | 5 | ||||
-rw-r--r-- | src/routines/level1/xscal.cpp | 5 | ||||
-rw-r--r-- | src/routines/level1/xswap.cpp | 5 |
8 files changed, 16 insertions, 24 deletions
diff --git a/src/routines/level1/xamax.cpp b/src/routines/level1/xamax.cpp index 8307188b..e9efa1a7 100644 --- a/src/routines/level1/xamax.cpp +++ b/src/routines/level1/xamax.cpp @@ -22,10 +22,9 @@ namespace clblast { // Constructor: forwards to base class constructor template <typename T> Xamax<T>::Xamax(Queue &queue, EventPointer event, const std::string &name): - Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>()) { - source_string_ = + Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>(), {}, { #include "../../kernels/level1/xamax.opencl" - ; + }) { } // ================================================================================================= diff --git a/src/routines/level1/xasum.cpp b/src/routines/level1/xasum.cpp index 9dde7a87..a242a5fa 100644 --- a/src/routines/level1/xasum.cpp +++ b/src/routines/level1/xasum.cpp @@ -22,10 +22,9 @@ namespace clblast { // Constructor: forwards to base class constructor template <typename T> Xasum<T>::Xasum(Queue &queue, EventPointer event, const std::string &name): - Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>()) { - source_string_ = + Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>(), {}, { #include "../../kernels/level1/xasum.opencl" - ; + }) { } // ================================================================================================= diff --git a/src/routines/level1/xaxpy.cpp b/src/routines/level1/xaxpy.cpp index cbcbb3cd..5436c5b7 100644 --- a/src/routines/level1/xaxpy.cpp +++ b/src/routines/level1/xaxpy.cpp @@ -22,11 +22,10 @@ namespace clblast { // Constructor: forwards to base class constructor template <typename T> Xaxpy<T>::Xaxpy(Queue &queue, EventPointer event, const std::string &name): - Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>()) { - source_string_ = + Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>(), {}, { #include "../../kernels/level1/level1.opencl" #include "../../kernels/level1/xaxpy.opencl" - ; + }) { } // ================================================================================================= diff --git a/src/routines/level1/xcopy.cpp b/src/routines/level1/xcopy.cpp index 3bfbada6..d86200c0 100644 --- a/src/routines/level1/xcopy.cpp +++ b/src/routines/level1/xcopy.cpp @@ -22,11 +22,10 @@ namespace clblast { // Constructor: forwards to base class constructor template <typename T> Xcopy<T>::Xcopy(Queue &queue, EventPointer event, const std::string &name): - Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>()) { - source_string_ = + Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>(), {}, { #include "../../kernels/level1/level1.opencl" #include "../../kernels/level1/xcopy.opencl" - ; + }) { } // ================================================================================================= diff --git a/src/routines/level1/xdot.cpp b/src/routines/level1/xdot.cpp index e0d297f8..9d718913 100644 --- a/src/routines/level1/xdot.cpp +++ b/src/routines/level1/xdot.cpp @@ -22,10 +22,9 @@ namespace clblast { // Constructor: forwards to base class constructor template <typename T> Xdot<T>::Xdot(Queue &queue, EventPointer event, const std::string &name): - Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>()) { - source_string_ = + Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>(), {}, { #include "../../kernels/level1/xdot.opencl" - ; + }) { } // ================================================================================================= diff --git a/src/routines/level1/xnrm2.cpp b/src/routines/level1/xnrm2.cpp index eb795498..373820a4 100644 --- a/src/routines/level1/xnrm2.cpp +++ b/src/routines/level1/xnrm2.cpp @@ -22,10 +22,9 @@ namespace clblast { // Constructor: forwards to base class constructor template <typename T> Xnrm2<T>::Xnrm2(Queue &queue, EventPointer event, const std::string &name): - Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>()) { - source_string_ = + Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>(), {}, { #include "../../kernels/level1/xnrm2.opencl" - ; + }) { } // ================================================================================================= diff --git a/src/routines/level1/xscal.cpp b/src/routines/level1/xscal.cpp index ed126879..17410f01 100644 --- a/src/routines/level1/xscal.cpp +++ b/src/routines/level1/xscal.cpp @@ -22,11 +22,10 @@ namespace clblast { // Constructor: forwards to base class constructor template <typename T> Xscal<T>::Xscal(Queue &queue, EventPointer event, const std::string &name): - Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>()) { - source_string_ = + Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>(), {}, { #include "../../kernels/level1/level1.opencl" #include "../../kernels/level1/xscal.opencl" - ; + }) { } // ================================================================================================= diff --git a/src/routines/level1/xswap.cpp b/src/routines/level1/xswap.cpp index 2f2c0370..c9b97dc9 100644 --- a/src/routines/level1/xswap.cpp +++ b/src/routines/level1/xswap.cpp @@ -22,11 +22,10 @@ namespace clblast { // Constructor: forwards to base class constructor template <typename T> Xswap<T>::Xswap(Queue &queue, EventPointer event, const std::string &name): - Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>()) { - source_string_ = + Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>(), {}, { #include "../../kernels/level1/level1.opencl" #include "../../kernels/level1/xswap.opencl" - ; + }) { } // ================================================================================================= |