summaryrefslogtreecommitdiff
path: root/src/tuning/kernels/copy_fast.cpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-11-19 12:58:41 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2017-11-19 12:58:41 +0100
commit7a54494577ccee401b63cfa82688661fc66f59a4 (patch)
treec97a969961a80dad72797fdd2ce619a2b40d34bc /src/tuning/kernels/copy_fast.cpp
parent8a5a5e031e3552ef36d7b3a16ecf5cef6cdb4614 (diff)
Modified the kernel tuners to use the newly integrated auto-tuner
Diffstat (limited to 'src/tuning/kernels/copy_fast.cpp')
-rw-r--r--src/tuning/kernels/copy_fast.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/tuning/kernels/copy_fast.cpp b/src/tuning/kernels/copy_fast.cpp
index 068c5f1b..462107d3 100644
--- a/src/tuning/kernels/copy_fast.cpp
+++ b/src/tuning/kernels/copy_fast.cpp
@@ -7,7 +7,7 @@
// Author(s):
// Cedric Nugteren <www.cedricnugteren.nl>
//
-// This file uses the CLTune auto-tuner to tune the copy OpenCL kernels.
+// This file uses the auto-tuner to tune the copy OpenCL kernels.
//
// =================================================================================================
@@ -42,7 +42,6 @@ class TuneCopy {
settings.kernel_family = "copy";
settings.kernel_name = "CopyMatrixFast";
settings.sources =
-#include "../src/kernels/common.opencl"
#include "../src/kernels/level3/level3.opencl"
#include "../src/kernels/level3/copy_fast.opencl"
;
@@ -51,6 +50,10 @@ class TuneCopy {
settings.size_a = args.m * args.n;
settings.size_b = args.m * args.n;
+ // Inputs and outputs IDs (X:0, Y:1, A:2, B:3, C:4, temp:5)
+ settings.inputs = {2, 3};
+ settings.outputs = {3};
+
// Sets the base thread configuration
settings.global_size = {args.m, args.n};
settings.global_size_ref = settings.global_size;
@@ -78,20 +81,15 @@ class TuneCopy {
// Tests for valid arguments
static void TestValidArguments(const Arguments<T> &) { }
-
- // Sets the constraints and local memory size
- static void SetConstraints(cltune::Tuner &, const size_t) { }
- static void SetLocalMemorySize(cltune::Tuner &, const size_t, const Arguments<T> &) { }
+ static std::vector<Constraint> SetConstraints() { return {}; }
// Sets the kernel's arguments
- static void SetArguments(cltune::Tuner &tuner, const Arguments<T> &args,
- std::vector<T> &, std::vector<T> &,
- std::vector<T> &a_mat, std::vector<T> &b_mat, std::vector<T> &,
- std::vector<T> &) {
- tuner.AddArgumentScalar(static_cast<int>(args.m));
- tuner.AddArgumentInput(a_mat);
- tuner.AddArgumentOutput(b_mat);
- tuner.AddArgumentScalar(GetRealArg(args.alpha));
+ static void SetArguments(Kernel &kernel, const Arguments<T> &args,
+ std::vector<Buffer<T>>& buffers) {
+ kernel.SetArgument(0, static_cast<int>(args.m));
+ kernel.SetArgument(1, buffers[2]()); // 2 == A matrix
+ kernel.SetArgument(2, buffers[3]()); // 3 == B matrix
+ kernel.SetArgument(3, GetRealArg(args.alpha));
}
};