summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCNugteren <web@cedricnugteren.nl>2015-07-12 15:11:50 +0200
committerCNugteren <web@cedricnugteren.nl>2015-07-12 15:11:50 +0200
commitb5d39d9d0c3e1084cb5131e2822d4fb754b0b412 (patch)
tree163d6dcb5367f619c88002dd4bf772aa8f13cb74 /include
parent9a929f3fb2081bd2fd8f68efce3b9d93e86bf611 (diff)
Added the HEMM routine, tester, and client
Diffstat (limited to 'include')
-rw-r--r--include/clblast.h11
-rw-r--r--include/internal/routines/xhemm.h58
2 files changed, 69 insertions, 0 deletions
diff --git a/include/clblast.h b/include/clblast.h
index e6c49dbf..80ea1707 100644
--- a/include/clblast.h
+++ b/include/clblast.h
@@ -130,6 +130,17 @@ StatusCode Symm(const Layout layout, const Side side, const Triangle triangle,
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
cl_command_queue* queue, cl_event* event);
+// Templated-precision hermitian matrix-matrix multiplication: CHEMM/ZHEMM
+template <typename T>
+StatusCode Hemm(const Layout layout, const Side side, const Triangle triangle,
+ const size_t m, const size_t n,
+ const T alpha,
+ const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
+ const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
+ const T beta,
+ cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
+ cl_command_queue* queue, cl_event* event);
+
// Templated-precision rank-K update of a symmetric matrix: SSYRK/DSYRK/CSYRK/ZSYRK
template <typename T>
StatusCode Syrk(const Layout layout, const Triangle triangle, const Transpose a_transpose,
diff --git a/include/internal/routines/xhemm.h b/include/internal/routines/xhemm.h
new file mode 100644
index 00000000..1b1a0dfa
--- /dev/null
+++ b/include/internal/routines/xhemm.h
@@ -0,0 +1,58 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
+// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
+// width of 100 characters per line.
+//
+// Author(s):
+// Cedric Nugteren <www.cedricnugteren.nl>
+//
+// This file implements the Xhemm routine. It is based on the generalized matrix multiplication
+// routine (Xgemm). The implementation is very similar to the Xsymm routine.
+//
+// =================================================================================================
+
+#ifndef CLBLAST_ROUTINES_XHEMM_H_
+#define CLBLAST_ROUTINES_XHEMM_H_
+
+#include "internal/routines/xgemm.h"
+
+namespace clblast {
+// =================================================================================================
+
+// See comment at top of file for a description of the class
+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;
+
+ // Uses the regular Xgemm routine
+ using Xgemm<T>::DoGemm;
+
+ // Constructor
+ Xhemm(CommandQueue &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 T beta,
+ const Buffer &c_buffer, const size_t c_offset, const size_t c_ld);
+};
+
+// =================================================================================================
+} // namespace clblast
+
+// CLBLAST_ROUTINES_XHEMM_H_
+#endif