summaryrefslogtreecommitdiff
path: root/src/database
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-11-02 21:47:14 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2017-11-02 21:47:14 +0100
commit9b0a435fb00b845b875590be90acffcd4f3bb009 (patch)
tree754b523789ef717619b540925c97e7167ba28f06 /src/database
parent73272ab97dbd5abe757f6558c9b89665c5ac99d0 (diff)
Integrated the GEMM routine tuner for kernel selection; added first tuning results
Diffstat (limited to 'src/database')
-rw-r--r--src/database/database.cpp5
-rw-r--r--src/database/kernel_selection.hpp136
-rw-r--r--src/database/kernels/gemm_routine/gemm_routine.hpp14
-rw-r--r--src/database/kernels/gemm_routine/gemm_routine_16.hpp26
-rw-r--r--src/database/kernels/gemm_routine/gemm_routine_32.hpp34
-rw-r--r--src/database/kernels/gemm_routine/gemm_routine_3232.hpp34
-rw-r--r--src/database/kernels/gemm_routine/gemm_routine_64.hpp26
-rw-r--r--src/database/kernels/gemm_routine/gemm_routine_6464.hpp26
8 files changed, 163 insertions, 138 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp
index 836c8803..2fa86151 100644
--- a/src/database/database.cpp
+++ b/src/database/database.cpp
@@ -30,10 +30,11 @@
#include "database/kernels/transpose/transpose.hpp"
#include "database/kernels/padtranspose/padtranspose.hpp"
+#include "database/kernels/gemm_routine/gemm_routine.hpp"
+
#include "database/kernels/xtrsv.hpp"
#include "database/kernels/invert.hpp"
#include "database/apple_cpu_fallback.hpp"
-#include "database/kernel_selection.hpp"
namespace clblast {
// =================================================================================================
@@ -54,7 +55,7 @@ const std::vector<database::DatabaseEntry> Database::database = std::vector<data
database::TransposeHalf, database::TransposeSingle, database::TransposeDouble, database::TransposeComplexSingle, database::TransposeComplexDouble,
database::PadtransposeHalf, database::PadtransposeSingle, database::PadtransposeDouble, database::PadtransposeComplexSingle, database::PadtransposeComplexDouble,
database::InvertHalf, database::InvertSingle, database::InvertDouble, database::InvertComplexSingle, database::InvertComplexDouble,
- database::KernelSelectionHalf, database::KernelSelectionSingle, database::KernelSelectionDouble, database::KernelSelectionComplexSingle, database::KernelSelectionComplexDouble
+ database::GemmRoutineHalf, database::GemmRoutineSingle, database::GemmRoutineDouble, database::GemmRoutineComplexSingle, database::GemmRoutineComplexDouble
};
const std::vector<database::DatabaseEntry> Database::apple_cpu_fallback = std::vector<database::DatabaseEntry>{
database::XaxpyApple, database::XdotApple,
diff --git a/src/database/kernel_selection.hpp b/src/database/kernel_selection.hpp
deleted file mode 100644
index 6d74b9f9..00000000
--- a/src/database/kernel_selection.hpp
+++ /dev/null
@@ -1,136 +0,0 @@
-
-// =================================================================================================
-// 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 determines when to switch between the direct (for small sizes) and in-direct GEMM kernel
-// with pre/post-processing kernels (for larger sizes). These can be set in a similar way as for the
-// regular kernel tuning parameters: they can be specific for a certain vendor or device or can use
-// some common default values.
-//
-// =================================================================================================
-
-namespace clblast {
-namespace database {
-// =================================================================================================
-
-const DatabaseEntry KernelSelectionHalf = {
- "KernelSelection", Precision::kHalf, {"XGEMM_MIN_INDIRECT_SIZE"}, {
- { // Intel GPUs
- kDeviceTypeGPU, "Intel", {
- { "default", { { kDeviceNameDefault, Params{ 1*1*1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // NVIDIA GPUs
- kDeviceTypeGPU, "NVIDIA", {
- { "default", { { kDeviceNameDefault, Params{ 1280*1280*1280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // Default
- kDeviceTypeAll, "default", {
- { "default", { { kDeviceNameDefault, Params{ 512*512*512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- }
-};
-
-// =================================================================================================
-
-const DatabaseEntry KernelSelectionSingle = {
- "KernelSelection", Precision::kSingle, {"XGEMM_MIN_INDIRECT_SIZE"}, {
- { // Intel GPUs
- kDeviceTypeGPU, "Intel", {
- { "default", { { kDeviceNameDefault, Params{ 1*1*1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // NVIDIA GPUs
- kDeviceTypeGPU, "NVIDIA", {
- { "default", { { kDeviceNameDefault, Params{ 1280*1280*1280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- {
- kDeviceTypeGPU, "ARM", {
- { "default", { { kDeviceNameDefault, Params{ 128*128*128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // Default
- kDeviceTypeAll, "default", {
- { "default", { { kDeviceNameDefault, Params{ 512*512*512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- }
-};
-
-// =================================================================================================
-
-const DatabaseEntry KernelSelectionComplexSingle = {
- "KernelSelection", Precision::kComplexSingle, {"XGEMM_MIN_INDIRECT_SIZE"}, {
- { // Intel GPUs
- kDeviceTypeGPU, "Intel", {
- { "default", { { kDeviceNameDefault, Params{ 1*1*1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // NVIDIA GPUs
- kDeviceTypeGPU, "NVIDIA", {
- { "default", { { kDeviceNameDefault, Params{ 1280*1280*1280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // Default
- kDeviceTypeAll, "default", {
- { "default", { { kDeviceNameDefault, Params{ 512*512*512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- }
-};
-
-// =================================================================================================
-
-const DatabaseEntry KernelSelectionDouble = {
- "KernelSelection", Precision::kDouble, {"XGEMM_MIN_INDIRECT_SIZE"}, {
- { // Intel GPUs
- kDeviceTypeGPU, "Intel", {
- { "default", { { kDeviceNameDefault, Params{ 1*1*1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // NVIDIA GPUs
- kDeviceTypeGPU, "NVIDIA", {
- { "default", { { kDeviceNameDefault, Params{ 1280*1280*1280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // Default
- kDeviceTypeAll, "default", {
- { "default", { { kDeviceNameDefault, Params{ 512*512*512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- }
-};
-
-// =================================================================================================
-
-const DatabaseEntry KernelSelectionComplexDouble = {
- "KernelSelection", Precision::kComplexDouble, {"XGEMM_MIN_INDIRECT_SIZE"}, {
- { // Intel GPUs
- kDeviceTypeGPU, "Intel", {
- { "default", { { kDeviceNameDefault, Params{ 1*1*1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // NVIDIA GPUs
- kDeviceTypeGPU, "NVIDIA", {
- { "default", { { kDeviceNameDefault, Params{ 1280*1280*1280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- { // Default
- kDeviceTypeAll, "default", {
- { "default", { { kDeviceNameDefault, Params{ 512*512*512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } },
- }
- },
- }
-};
-
-// =================================================================================================
-} // namespace database
-} // namespace clblast
diff --git a/src/database/kernels/gemm_routine/gemm_routine.hpp b/src/database/kernels/gemm_routine/gemm_routine.hpp
new file mode 100644
index 00000000..f1470252
--- /dev/null
+++ b/src/database/kernels/gemm_routine/gemm_routine.hpp
@@ -0,0 +1,14 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. It
+// is auto-generated by the 'scripts/database/database.py' Python script.
+//
+// This file populates the database with best-found tuning parameters for the 'Gemm_Routine' kernels.
+//
+// =================================================================================================
+
+#include "database/kernels/gemm_routine/gemm_routine_16.hpp"
+#include "database/kernels/gemm_routine/gemm_routine_32.hpp"
+#include "database/kernels/gemm_routine/gemm_routine_3232.hpp"
+#include "database/kernels/gemm_routine/gemm_routine_64.hpp"
+#include "database/kernels/gemm_routine/gemm_routine_6464.hpp"
diff --git a/src/database/kernels/gemm_routine/gemm_routine_16.hpp b/src/database/kernels/gemm_routine/gemm_routine_16.hpp
new file mode 100644
index 00000000..e17afe4b
--- /dev/null
+++ b/src/database/kernels/gemm_routine/gemm_routine_16.hpp
@@ -0,0 +1,26 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. It
+// is auto-generated by the 'scripts/database/database.py' Python script.
+//
+// This file populates the database with best-found tuning parameters for the 'Gemm_Routine16' kernels.
+//
+// =================================================================================================
+
+namespace clblast {
+namespace database {
+
+const DatabaseEntry GemmRoutineHalf = {
+ "GemmRoutine", Precision::kHalf, {"XGEMM_MIN_INDIRECT_SIZE"}, {
+ { // Default
+ kDeviceTypeAll, "default", {
+ { "default", {
+ { kDeviceNameDefault , Params{ 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ } },
+ }
+ },
+ }
+};
+
+} // namespace database
+} // namespace clblast
diff --git a/src/database/kernels/gemm_routine/gemm_routine_32.hpp b/src/database/kernels/gemm_routine/gemm_routine_32.hpp
new file mode 100644
index 00000000..624de564
--- /dev/null
+++ b/src/database/kernels/gemm_routine/gemm_routine_32.hpp
@@ -0,0 +1,34 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. It
+// is auto-generated by the 'scripts/database/database.py' Python script.
+//
+// This file populates the database with best-found tuning parameters for the 'Gemm_Routine32' kernels.
+//
+// =================================================================================================
+
+namespace clblast {
+namespace database {
+
+const DatabaseEntry GemmRoutineSingle = {
+ "GemmRoutine", Precision::kSingle, {"XGEMM_MIN_INDIRECT_SIZE"}, {
+ { // Intel GPUs
+ kDeviceTypeGPU, "Intel", {
+ { "default", {
+ { Name{"Intel(R) HD Graphics Skylake ULT GT2 "}, Params{ 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ { kDeviceNameDefault , Params{ 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ } },
+ }
+ },
+ { // Default
+ kDeviceTypeAll, "default", {
+ { "default", {
+ { kDeviceNameDefault , Params{ 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ } },
+ }
+ },
+ }
+};
+
+} // namespace database
+} // namespace clblast
diff --git a/src/database/kernels/gemm_routine/gemm_routine_3232.hpp b/src/database/kernels/gemm_routine/gemm_routine_3232.hpp
new file mode 100644
index 00000000..689ae8d8
--- /dev/null
+++ b/src/database/kernels/gemm_routine/gemm_routine_3232.hpp
@@ -0,0 +1,34 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. It
+// is auto-generated by the 'scripts/database/database.py' Python script.
+//
+// This file populates the database with best-found tuning parameters for the 'Gemm_Routine3232' kernels.
+//
+// =================================================================================================
+
+namespace clblast {
+namespace database {
+
+const DatabaseEntry GemmRoutineComplexSingle = {
+ "GemmRoutine", Precision::kComplexSingle, {"XGEMM_MIN_INDIRECT_SIZE"}, {
+ { // Intel GPUs
+ kDeviceTypeGPU, "Intel", {
+ { "default", {
+ { Name{"Intel(R) HD Graphics Skylake ULT GT2 "}, Params{ 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ { kDeviceNameDefault , Params{ 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ } },
+ }
+ },
+ { // Default
+ kDeviceTypeAll, "default", {
+ { "default", {
+ { kDeviceNameDefault , Params{ 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ } },
+ }
+ },
+ }
+};
+
+} // namespace database
+} // namespace clblast
diff --git a/src/database/kernels/gemm_routine/gemm_routine_64.hpp b/src/database/kernels/gemm_routine/gemm_routine_64.hpp
new file mode 100644
index 00000000..7fd29128
--- /dev/null
+++ b/src/database/kernels/gemm_routine/gemm_routine_64.hpp
@@ -0,0 +1,26 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. It
+// is auto-generated by the 'scripts/database/database.py' Python script.
+//
+// This file populates the database with best-found tuning parameters for the 'Gemm_Routine64' kernels.
+//
+// =================================================================================================
+
+namespace clblast {
+namespace database {
+
+const DatabaseEntry GemmRoutineDouble = {
+ "GemmRoutine", Precision::kDouble, {"XGEMM_MIN_INDIRECT_SIZE"}, {
+ { // Default
+ kDeviceTypeAll, "default", {
+ { "default", {
+ { kDeviceNameDefault , Params{ 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ } },
+ }
+ },
+ }
+};
+
+} // namespace database
+} // namespace clblast
diff --git a/src/database/kernels/gemm_routine/gemm_routine_6464.hpp b/src/database/kernels/gemm_routine/gemm_routine_6464.hpp
new file mode 100644
index 00000000..85d2c8f1
--- /dev/null
+++ b/src/database/kernels/gemm_routine/gemm_routine_6464.hpp
@@ -0,0 +1,26 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. It
+// is auto-generated by the 'scripts/database/database.py' Python script.
+//
+// This file populates the database with best-found tuning parameters for the 'Gemm_Routine6464' kernels.
+//
+// =================================================================================================
+
+namespace clblast {
+namespace database {
+
+const DatabaseEntry GemmRoutineComplexDouble = {
+ "GemmRoutine", Precision::kComplexDouble, {"XGEMM_MIN_INDIRECT_SIZE"}, {
+ { // Default
+ kDeviceTypeAll, "default", {
+ { "default", {
+ { kDeviceNameDefault , Params{ 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ } },
+ }
+ },
+ }
+};
+
+} // namespace database
+} // namespace clblast