summaryrefslogtreecommitdiff
path: root/src/tuning/kernels/transpose_fast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tuning/kernels/transpose_fast.cpp')
-rw-r--r--src/tuning/kernels/transpose_fast.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/tuning/kernels/transpose_fast.cpp b/src/tuning/kernels/transpose_fast.cpp
index 56726903..1e0d3c7b 100644
--- a/src/tuning/kernels/transpose_fast.cpp
+++ b/src/tuning/kernels/transpose_fast.cpp
@@ -7,7 +7,7 @@
// Author(s):
// Cedric Nugteren <www.cedricnugteren.nl>
//
-// This file uses the CLTune auto-tuner to tune the transpose OpenCL kernels.
+// This file uses the auto-tuner to tune the transpose OpenCL kernels.
//
// =================================================================================================
@@ -42,7 +42,6 @@ class TuneTranspose {
settings.kernel_family = "transpose";
settings.kernel_name = "TransposeMatrixFast";
settings.sources =
-#include "../src/kernels/common.opencl"
#include "../src/kernels/level3/level3.opencl"
#include "../src/kernels/level3/transpose_fast.opencl"
;
@@ -51,6 +50,10 @@ class TuneTranspose {
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,25 +81,15 @@ class TuneTranspose {
// 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 &tuner, const size_t id, const Arguments<T> &args) {
- auto LocalMemorySize = [args] (std::vector<size_t> v) {
- return ((v[0]*v[1]*(v[0]*v[1]+v[2]))*GetBytes(args.precision));
- };
- tuner.SetLocalMemoryUsage(id, LocalMemorySize, {"TRA_DIM", "TRA_WPT", "TRA_PAD"});
- }
+ 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));
}
};