2015-05-30 12:30:43 +02:00
|
|
|
|
|
|
|
// =================================================================================================
|
|
|
|
// 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>
|
|
|
|
|
2016-04-27 16:02:13 +02:00
|
|
|
#include "internal/cache.h"
|
2015-05-30 12:30:43 +02:00
|
|
|
#include "internal/utilities.h"
|
|
|
|
#include "internal/database.h"
|
2016-06-17 11:29:07 +02:00
|
|
|
#include "internal/buffer_test.h"
|
2016-06-18 18:16:14 +02:00
|
|
|
#include "internal/routines/common.h"
|
2015-05-30 12:30:43 +02:00
|
|
|
|
|
|
|
namespace clblast {
|
|
|
|
// =================================================================================================
|
|
|
|
|
|
|
|
// See comment at top of file for a description of the class
|
|
|
|
class Routine {
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Base class constructor
|
2016-04-10 06:22:24 +02:00
|
|
|
explicit Routine(Queue &queue, EventPointer event, const std::string &name,
|
2015-05-30 12:30:43 +02:00
|
|
|
const std::vector<std::string> &routines, const Precision precision);
|
|
|
|
|
|
|
|
// Set-up phase of the kernel
|
2015-07-19 13:44:37 +02:00
|
|
|
StatusCode SetUp();
|
2015-05-30 12:30:43 +02:00
|
|
|
|
|
|
|
protected:
|
2016-04-27 16:02:13 +02:00
|
|
|
|
2016-06-18 18:16:14 +02:00
|
|
|
// Non-static variable for the precision
|
2015-05-30 12:30:43 +02:00
|
|
|
const Precision precision_;
|
|
|
|
|
2015-07-19 13:44:37 +02:00
|
|
|
// The routine's name and its kernel-source in string form
|
|
|
|
const std::string routine_name_;
|
|
|
|
std::string source_string_;
|
|
|
|
|
2015-05-30 12:30:43 +02:00
|
|
|
// The OpenCL objects, accessible only from derived classes
|
2015-07-27 07:18:06 +02:00
|
|
|
Queue queue_;
|
2016-04-10 06:22:24 +02:00
|
|
|
EventPointer event_;
|
2015-05-30 12:30:43 +02:00
|
|
|
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
|