diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-06-17 14:30:37 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-06-17 14:30:37 +0200 |
commit | f9947b4d7ffedcf98cdb128de835422f647e7f15 (patch) | |
tree | c42d427a23de5d14b3407943d529d18cd9e516f0 /src/routines/level1/xscal.cc | |
parent | 536b7fe4bce4b183cb060a1b9045752ae39d842f (diff) |
Removed the precision argument from the routines in favor of a single templated function
Diffstat (limited to 'src/routines/level1/xscal.cc')
-rw-r--r-- | src/routines/level1/xscal.cc | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/routines/level1/xscal.cc b/src/routines/level1/xscal.cc index 22d2cb5b..4792d40b 100644 --- a/src/routines/level1/xscal.cc +++ b/src/routines/level1/xscal.cc @@ -19,19 +19,10 @@ namespace clblast { // ================================================================================================= -// Specific implementations to get the memory-type based on a template argument -template <> const Precision Xscal<half>::precision_ = Precision::kHalf; -template <> const Precision Xscal<float>::precision_ = Precision::kSingle; -template <> const Precision Xscal<double>::precision_ = Precision::kDouble; -template <> const Precision Xscal<float2>::precision_ = Precision::kComplexSingle; -template <> const Precision Xscal<double2>::precision_ = Precision::kComplexDouble; - -// ================================================================================================= - // Constructor: forwards to base class constructor template <typename T> Xscal<T>::Xscal(Queue &queue, EventPointer event, const std::string &name): - Routine<T>(queue, event, name, {"Xaxpy"}, precision_) { + Routine<T>(queue, event, name, {"Xaxpy"}, PrecisionValue<T>()) { source_string_ = #include "../../kernels/level1/level1.opencl" #include "../../kernels/level1/xscal.opencl" @@ -61,7 +52,7 @@ StatusCode Xscal<T>::DoScal(const size_t n, const T alpha, // Retrieves the Xscal kernel from the compiled binary try { - const auto program = GetProgramFromCache(context_, precision_, routine_name_); + const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_); auto kernel = Kernel(program, kernel_name); // Sets the kernel arguments |