summaryrefslogtreecommitdiff
path: root/include/internal/routines/level1
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-03-28 23:00:44 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2016-03-28 23:00:44 +0200
commitaaa687ca984b18bd1ea499c92285b490fd78e2a3 (patch)
tree3210d6aa484a866cbafc9351baf49e5f0aab4ca3 /include/internal/routines/level1
parent1d5a702d9d31afa320a15ed9fa79471aec314f4a (diff)
Added preliminary support for the xNRM2 routines
Diffstat (limited to 'include/internal/routines/level1')
-rw-r--r--include/internal/routines/level1/xnrm2.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/include/internal/routines/level1/xnrm2.h b/include/internal/routines/level1/xnrm2.h
new file mode 100644
index 00000000..b3fffef6
--- /dev/null
+++ b/include/internal/routines/level1/xnrm2.h
@@ -0,0 +1,55 @@
+
+// =================================================================================================
+// 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 Xnrm2 routine. The precision is implemented using a template argument.
+//
+// =================================================================================================
+
+#ifndef CLBLAST_ROUTINES_XNRM2_H_
+#define CLBLAST_ROUTINES_XNRM2_H_
+
+#include "internal/routine.h"
+
+namespace clblast {
+// =================================================================================================
+
+// See comment at top of file for a description of the class
+template <typename T>
+class Xnrm2: public Routine<T> {
+ public:
+
+ // 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>::TestVectorX;
+ using Routine<T>::TestVectorDot;
+ using Routine<T>::RunKernel;
+ using Routine<T>::ErrorIn;
+
+ // Constructor
+ Xnrm2(Queue &queue, Event &event, const std::string &name = "NRM2");
+
+ // Templated-precision implementation of the routine
+ StatusCode DoNrm2(const size_t n,
+ const Buffer<T> &nrm2_buffer, const size_t nrm2_offset,
+ const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc);
+
+ private:
+ // Static variable to get the precision
+ const static Precision precision_;
+};
+
+// =================================================================================================
+} // namespace clblast
+
+// CLBLAST_ROUTINES_XNRM2_H_
+#endif