summaryrefslogtreecommitdiff
path: root/src/routine.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-06-18 20:20:13 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2016-06-18 20:20:13 +0200
commitf726fbdc9fef937fbe32222f0e66aac8d7e2678c (patch)
treecb62cc877ea239052fb1882f7bf327aace3e7776 /src/routine.hpp
parentbacb5d2bb2ea7b141034878090aca850db8f9d00 (diff)
Moved all headers into the source tree, changed headers to .hpp extension
Diffstat (limited to 'src/routine.hpp')
-rw-r--r--src/routine.hpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/routine.hpp b/src/routine.hpp
new file mode 100644
index 00000000..54b5779f
--- /dev/null
+++ b/src/routine.hpp
@@ -0,0 +1,68 @@
+
+// =================================================================================================
+// 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 all the basic functionality for the BLAS routines. This class serves as a
+// base class for the actual routines (e.g. Xaxpy, Xgemm). It contains common functionality such as
+// compiling the OpenCL kernel, connecting to the database, etc.
+//
+// =================================================================================================
+
+#ifndef CLBLAST_ROUTINE_H_
+#define CLBLAST_ROUTINE_H_
+
+#include <string>
+#include <vector>
+
+#include "utilities.hpp"
+#include "cache.hpp"
+#include "buffer_test.hpp"
+#include "database/database.hpp"
+#include "routines/common.hpp"
+
+namespace clblast {
+// =================================================================================================
+
+// See comment at top of file for a description of the class
+class Routine {
+ public:
+
+ // Base class constructor
+ explicit Routine(Queue &queue, EventPointer event, const std::string &name,
+ const std::vector<std::string> &routines, const Precision precision);
+
+ // Set-up phase of the kernel
+ StatusCode SetUp();
+
+ protected:
+
+ // Non-static variable for the precision
+ const Precision precision_;
+
+ // The routine's name and its kernel-source in string form
+ const std::string routine_name_;
+ std::string source_string_;
+
+ // The OpenCL objects, accessible only from derived classes
+ Queue queue_;
+ EventPointer event_;
+ const Context context_;
+ const Device device_;
+
+ // OpenCL device properties
+ const std::string device_name_;
+
+ // Connection to the database for all the device-specific parameters
+ const Database db_;
+};
+
+// =================================================================================================
+} // namespace clblast
+
+// CLBLAST_ROUTINE_H_
+#endif