summaryrefslogtreecommitdiff
path: root/include/internal/routines
diff options
context:
space:
mode:
authorCNugteren <web@cedricnugteren.nl>2015-07-27 07:18:06 +0200
committerCNugteren <web@cedricnugteren.nl>2015-07-27 07:18:06 +0200
commitf7199b831f847340f0921ef2140a4e64809db037 (patch)
treed725b7e63b0662598ad4be0a4c2457820ded8ed4 /include/internal/routines
parentb10f4a633c4ffb3bb04d35503396ff94528df4d0 (diff)
Now using the new Claduc C++11 OpenCL header
Diffstat (limited to 'include/internal/routines')
-rw-r--r--include/internal/routines/level1/xaxpy.h20
-rw-r--r--include/internal/routines/level2/xgemv.h23
-rw-r--r--include/internal/routines/level3/xgemm.h25
-rw-r--r--include/internal/routines/level3/xhemm.h24
-rw-r--r--include/internal/routines/level3/xher2k.h25
-rw-r--r--include/internal/routines/level3/xherk.h22
-rw-r--r--include/internal/routines/level3/xsymm.h24
-rw-r--r--include/internal/routines/level3/xsyr2k.h25
-rw-r--r--include/internal/routines/level3/xsyrk.h22
-rw-r--r--include/internal/routines/level3/xtrmm.h22
10 files changed, 162 insertions, 70 deletions
diff --git a/include/internal/routines/level1/xaxpy.h b/include/internal/routines/level1/xaxpy.h
index e548e553..4b9da890 100644
--- a/include/internal/routines/level1/xaxpy.h
+++ b/include/internal/routines/level1/xaxpy.h
@@ -21,14 +21,26 @@ namespace clblast {
// See comment at top of file for a description of the class
template <typename T>
-class Xaxpy: public Routine {
+class Xaxpy: public Routine<T> {
public:
- Xaxpy(CommandQueue &queue, Event &event);
+
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::source_string_;
+ using Routine<T>::queue_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::TestVectorX;
+ using Routine<T>::TestVectorY;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
+
+ // Constructor
+ Xaxpy(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoAxpy(const size_t n, const T alpha,
- const Buffer &x_buffer, const size_t x_offset, const size_t x_inc,
- const Buffer &y_buffer, const size_t y_offset, const size_t y_inc);
+ const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
+ const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc);
private:
// Static variable to get the precision
diff --git a/include/internal/routines/level2/xgemv.h b/include/internal/routines/level2/xgemv.h
index a3109036..5ada9b03 100644
--- a/include/internal/routines/level2/xgemv.h
+++ b/include/internal/routines/level2/xgemv.h
@@ -21,18 +21,31 @@ namespace clblast {
// See comment at top of file for a description of the class
template <typename T>
-class Xgemv: public Routine {
+class Xgemv: public Routine<T> {
public:
- Xgemv(CommandQueue &queue, Event &event);
+
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::source_string_;
+ using Routine<T>::queue_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::TestVectorX;
+ using Routine<T>::TestVectorY;
+ using Routine<T>::TestMatrixA;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
+
+ // Constructor
+ Xgemv(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoGemv(const Layout layout, const Transpose a_transpose,
const size_t m, const size_t n,
const T alpha,
- const Buffer &a_buffer, const size_t a_offset, const size_t a_ld,
- const Buffer &x_buffer, const size_t x_offset, const size_t x_inc,
+ const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
+ const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
const T beta,
- const Buffer &y_buffer, const size_t y_offset, const size_t y_inc);
+ const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc);
private:
// Static variable to get the precision
diff --git a/include/internal/routines/level3/xgemm.h b/include/internal/routines/level3/xgemm.h
index 7ad4fcfb..a0c8b595 100644
--- a/include/internal/routines/level3/xgemm.h
+++ b/include/internal/routines/level3/xgemm.h
@@ -21,18 +21,33 @@ namespace clblast {
// See comment at top of file for a description of the class
template <typename T>
-class Xgemm: public Routine {
+class Xgemm: public Routine<T> {
public:
- Xgemm(CommandQueue &queue, Event &event);
+
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::source_string_;
+ using Routine<T>::queue_;
+ using Routine<T>::context_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::PadCopyTransposeMatrix;
+ using Routine<T>::TestMatrixA;
+ using Routine<T>::TestMatrixB;
+ using Routine<T>::TestMatrixC;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
+
+ // Constructor
+ Xgemm(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoGemm(const Layout layout, const Transpose a_transpose, const Transpose b_transpose,
const size_t m, const size_t n, const size_t k,
const T alpha,
- const Buffer &a_buffer, const size_t a_offset, const size_t a_ld,
- const Buffer &b_buffer, const size_t b_offset, const size_t b_ld,
+ const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
+ const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_ld,
const T beta,
- const Buffer &c_buffer, const size_t c_offset, const size_t c_ld);
+ const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
private:
// Static variable to get the precision
diff --git a/include/internal/routines/level3/xhemm.h b/include/internal/routines/level3/xhemm.h
index 6cc9d9ec..5f1e8723 100644
--- a/include/internal/routines/level3/xhemm.h
+++ b/include/internal/routines/level3/xhemm.h
@@ -25,30 +25,28 @@ template <typename T>
class Xhemm: public Xgemm<T> {
public:
- // Uses several variables from the Routine class
- using Routine::db_;
- using Routine::context_;
-
- // Uses several helper functions from the Routine class
- using Routine::RunKernel;
- using Routine::ErrorIn;
- using Routine::TestMatrixA;
- using Routine::GetProgramFromCache;
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::context_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::TestMatrixA;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
// Uses the regular Xgemm routine
using Xgemm<T>::DoGemm;
// Constructor
- Xhemm(CommandQueue &queue, Event &event);
+ Xhemm(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoHemm(const Layout layout, const Side side, const Triangle triangle,
const size_t m, const size_t n,
const T alpha,
- const Buffer &a_buffer, const size_t a_offset, const size_t a_ld,
- const Buffer &b_buffer, const size_t b_offset, const size_t b_ld,
+ const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
+ const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_ld,
const T beta,
- const Buffer &c_buffer, const size_t c_offset, const size_t c_ld);
+ const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
};
// =================================================================================================
diff --git a/include/internal/routines/level3/xher2k.h b/include/internal/routines/level3/xher2k.h
index 1836a812..9e961d23 100644
--- a/include/internal/routines/level3/xher2k.h
+++ b/include/internal/routines/level3/xher2k.h
@@ -23,18 +23,33 @@ namespace clblast {
// See comment at top of file for a description of the class
template <typename T, typename U>
-class Xher2k: public Routine {
+class Xher2k: public Routine<T> {
public:
- Xher2k(CommandQueue &queue, Event &event);
+
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::source_string_;
+ using Routine<T>::queue_;
+ using Routine<T>::context_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::PadCopyTransposeMatrix;
+ using Routine<T>::TestMatrixA;
+ using Routine<T>::TestMatrixB;
+ using Routine<T>::TestMatrixC;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
+
+ // Constructor
+ Xher2k(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoHer2k(const Layout layout, const Triangle triangle, const Transpose ab_transpose,
const size_t n, const size_t k,
const T alpha,
- const Buffer &a_buffer, const size_t a_offset, const size_t a_ld,
- const Buffer &b_buffer, const size_t b_offset, const size_t b_ld,
+ const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
+ const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_ld,
const U beta,
- const Buffer &c_buffer, const size_t c_offset, const size_t c_ld);
+ const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
private:
// Static variable to get the precision
diff --git a/include/internal/routines/level3/xherk.h b/include/internal/routines/level3/xherk.h
index 9b361254..f285a71c 100644
--- a/include/internal/routines/level3/xherk.h
+++ b/include/internal/routines/level3/xherk.h
@@ -23,17 +23,31 @@ namespace clblast {
// See comment at top of file for a description of the class
template <typename T, typename U>
-class Xherk: public Routine {
+class Xherk: public Routine<T> {
public:
- Xherk(CommandQueue &queue, Event &event);
+
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::source_string_;
+ using Routine<T>::queue_;
+ using Routine<T>::context_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::PadCopyTransposeMatrix;
+ using Routine<T>::TestMatrixA;
+ using Routine<T>::TestMatrixC;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
+
+ // Constructor
+ Xherk(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoHerk(const Layout layout, const Triangle triangle, const Transpose a_transpose,
const size_t n, const size_t k,
const U alpha,
- const Buffer &a_buffer, const size_t a_offset, const size_t a_ld,
+ const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
const U beta,
- const Buffer &c_buffer, const size_t c_offset, const size_t c_ld);
+ const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
private:
// Static variable to get the precision
diff --git a/include/internal/routines/level3/xsymm.h b/include/internal/routines/level3/xsymm.h
index 2028ceea..9ed3c722 100644
--- a/include/internal/routines/level3/xsymm.h
+++ b/include/internal/routines/level3/xsymm.h
@@ -27,30 +27,28 @@ template <typename T>
class Xsymm: public Xgemm<T> {
public:
- // Uses several variables from the Routine class
- using Routine::db_;
- using Routine::context_;
-
- // Uses several helper functions from the Routine class
- using Routine::RunKernel;
- using Routine::ErrorIn;
- using Routine::TestMatrixA;
- using Routine::GetProgramFromCache;
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::context_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::TestMatrixA;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
// Uses the regular Xgemm routine
using Xgemm<T>::DoGemm;
// Constructor
- Xsymm(CommandQueue &queue, Event &event);
+ Xsymm(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoSymm(const Layout layout, const Side side, const Triangle triangle,
const size_t m, const size_t n,
const T alpha,
- const Buffer &a_buffer, const size_t a_offset, const size_t a_ld,
- const Buffer &b_buffer, const size_t b_offset, const size_t b_ld,
+ const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
+ const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_ld,
const T beta,
- const Buffer &c_buffer, const size_t c_offset, const size_t c_ld);
+ const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
};
// =================================================================================================
diff --git a/include/internal/routines/level3/xsyr2k.h b/include/internal/routines/level3/xsyr2k.h
index 6259313c..85936658 100644
--- a/include/internal/routines/level3/xsyr2k.h
+++ b/include/internal/routines/level3/xsyr2k.h
@@ -23,18 +23,33 @@ namespace clblast {
// See comment at top of file for a description of the class
template <typename T>
-class Xsyr2k: public Routine {
+class Xsyr2k: public Routine<T> {
public:
- Xsyr2k(CommandQueue &queue, Event &event);
+
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::source_string_;
+ using Routine<T>::queue_;
+ using Routine<T>::context_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::PadCopyTransposeMatrix;
+ using Routine<T>::TestMatrixA;
+ using Routine<T>::TestMatrixB;
+ using Routine<T>::TestMatrixC;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
+
+ // Constructor
+ Xsyr2k(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoSyr2k(const Layout layout, const Triangle triangle, const Transpose ab_transpose,
const size_t n, const size_t k,
const T alpha,
- const Buffer &a_buffer, const size_t a_offset, const size_t a_ld,
- const Buffer &b_buffer, const size_t b_offset, const size_t b_ld,
+ const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
+ const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_ld,
const T beta,
- const Buffer &c_buffer, const size_t c_offset, const size_t c_ld);
+ const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
private:
// Static variable to get the precision
diff --git a/include/internal/routines/level3/xsyrk.h b/include/internal/routines/level3/xsyrk.h
index 3dab731f..14d51a58 100644
--- a/include/internal/routines/level3/xsyrk.h
+++ b/include/internal/routines/level3/xsyrk.h
@@ -25,17 +25,31 @@ namespace clblast {
// See comment at top of file for a description of the class
template <typename T>
-class Xsyrk: public Routine {
+class Xsyrk: public Routine<T> {
public:
- Xsyrk(CommandQueue &queue, Event &event);
+
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::source_string_;
+ using Routine<T>::queue_;
+ using Routine<T>::context_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::PadCopyTransposeMatrix;
+ using Routine<T>::TestMatrixA;
+ using Routine<T>::TestMatrixC;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
+
+ // Constructor
+ Xsyrk(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoSyrk(const Layout layout, const Triangle triangle, const Transpose a_transpose,
const size_t n, const size_t k,
const T alpha,
- const Buffer &a_buffer, const size_t a_offset, const size_t a_ld,
+ const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
const T beta,
- const Buffer &c_buffer, const size_t c_offset, const size_t c_ld);
+ const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
private:
// Static variable to get the precision
diff --git a/include/internal/routines/level3/xtrmm.h b/include/internal/routines/level3/xtrmm.h
index 4f49bebd..d8ac60fd 100644
--- a/include/internal/routines/level3/xtrmm.h
+++ b/include/internal/routines/level3/xtrmm.h
@@ -26,29 +26,27 @@ template <typename T>
class Xtrmm: public Xgemm<T> {
public:
- // Uses several variables from the Routine class
- using Routine::db_;
- using Routine::context_;
-
- // Uses several helper functions from the Routine class
- using Routine::RunKernel;
- using Routine::ErrorIn;
- using Routine::TestMatrixA;
- using Routine::GetProgramFromCache;
+ // Members and methods from the base class
+ using Routine<T>::db_;
+ using Routine<T>::context_;
+ using Routine<T>::GetProgramFromCache;
+ using Routine<T>::TestMatrixA;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
// Uses the regular Xgemm routine
using Xgemm<T>::DoGemm;
// Constructor
- Xtrmm(CommandQueue &queue, Event &event);
+ Xtrmm(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoTrmm(const Layout layout, const Side side, const Triangle triangle,
const Transpose a_transpose, const Diagonal diagonal,
const size_t m, const size_t n,
const T alpha,
- const Buffer &a_buffer, const size_t a_offset, const size_t a_ld,
- const Buffer &b_buffer, const size_t b_offset, const size_t b_ld);
+ const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
+ const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_ld);
};
// =================================================================================================