summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCNugteren <web@cedricnugteren.nl>2015-06-26 08:10:23 +0200
committerCNugteren <web@cedricnugteren.nl>2015-06-26 08:10:23 +0200
commit75f263ce3aa35f57115670af18719137b3020e79 (patch)
tree1d584c03bc3514018ec6da8619d9770cf98126f8
parentff9f9fac57b550d4a8834a5e5b344c2eefa9099f (diff)
Added symmetric matrix support for the ABC performance tester
-rw-r--r--test/performance/client.cc13
-rw-r--r--test/performance/client.h2
-rw-r--r--test/performance/routines/xgemm.cc8
-rw-r--r--test/performance/routines/xsymm.cc8
4 files changed, 16 insertions, 15 deletions
diff --git a/test/performance/client.cc b/test/performance/client.cc
index 65ff3218..b089f925 100644
--- a/test/performance/client.cc
+++ b/test/performance/client.cc
@@ -239,14 +239,15 @@ template void ClientAC<double2>(int, char **, Routine2<double2>, const std::vect
// This is the matrix-matrix-matrix variant of the set-up/tear-down client routine.
template <typename T>
void ClientABC(int argc, char *argv[], Routine3<T> client_routine,
- const std::vector<std::string> &options) {
+ const std::vector<std::string> &options, const bool symmetric) {
// Function to determine how to find the default value of the leading dimension of matrix A
- auto default_ld_a = [](const Arguments<T> args) { return args.m; };
+ auto default_ld_a = [&symmetric](const Arguments<T> args) { return (symmetric) ? args.n : args.m; };
// Simple command line argument parser with defaults
auto args = ParseArguments<T>(argc, argv, options, default_ld_a);
if (args.print_help) { return; }
+ if (symmetric) { args.m = args.n; }
// Prints the header of the output table
PrintTableHeader(args.silent, options);
@@ -314,10 +315,10 @@ void ClientABC(int argc, char *argv[], Routine3<T> client_routine,
}
// Compiles the above function
-template void ClientABC<float>(int, char **, Routine3<float>, const std::vector<std::string>&);
-template void ClientABC<double>(int, char **, Routine3<double>, const std::vector<std::string>&);
-template void ClientABC<float2>(int, char **, Routine3<float2>, const std::vector<std::string>&);
-template void ClientABC<double2>(int, char **, Routine3<double2>, const std::vector<std::string>&);
+template void ClientABC<float>(int, char **, Routine3<float>, const std::vector<std::string>&, const bool);
+template void ClientABC<double>(int, char **, Routine3<double>, const std::vector<std::string>&, const bool);
+template void ClientABC<float2>(int, char **, Routine3<float2>, const std::vector<std::string>&, const bool);
+template void ClientABC<double2>(int, char **, Routine3<double2>, const std::vector<std::string>&, const bool);
// =================================================================================================
diff --git a/test/performance/client.h b/test/performance/client.h
index edcd1b68..097ae048 100644
--- a/test/performance/client.h
+++ b/test/performance/client.h
@@ -56,7 +56,7 @@ void ClientAC(int argc, char *argv[], Routine2<T> client_routine,
const std::vector<std::string> &options);
template <typename T>
void ClientABC(int argc, char *argv[], Routine3<T> client_routine,
- const std::vector<std::string> &options);
+ const std::vector<std::string> &options, const bool symmetric);
// =================================================================================================
diff --git a/test/performance/routines/xgemm.cc b/test/performance/routines/xgemm.cc
index 97e19b44..76e398e0 100644
--- a/test/performance/routines/xgemm.cc
+++ b/test/performance/routines/xgemm.cc
@@ -96,10 +96,10 @@ void ClientXgemm(int argc, char *argv[]) {
kArgAlpha, kArgBeta};
switch(GetPrecision(argc, argv)) {
case Precision::kHalf: throw std::runtime_error("Unsupported precision mode");
- case Precision::kSingle: ClientABC<float>(argc, argv, PerformanceXgemm<float>, o); break;
- case Precision::kDouble: ClientABC<double>(argc, argv, PerformanceXgemm<double>, o); break;
- case Precision::kComplexSingle: ClientABC<float2>(argc, argv, PerformanceXgemm<float2>, o); break;
- case Precision::kComplexDouble: ClientABC<double2>(argc, argv, PerformanceXgemm<double2>, o); break;
+ case Precision::kSingle: ClientABC<float>(argc, argv, PerformanceXgemm<float>, o, false); break;
+ case Precision::kDouble: ClientABC<double>(argc, argv, PerformanceXgemm<double>, o, false); break;
+ case Precision::kComplexSingle: ClientABC<float2>(argc, argv, PerformanceXgemm<float2>, o, false); break;
+ case Precision::kComplexDouble: ClientABC<double2>(argc, argv, PerformanceXgemm<double2>, o, false); break;
}
}
diff --git a/test/performance/routines/xsymm.cc b/test/performance/routines/xsymm.cc
index 0b1d75a5..d78d4eb8 100644
--- a/test/performance/routines/xsymm.cc
+++ b/test/performance/routines/xsymm.cc
@@ -96,10 +96,10 @@ void ClientXsymm(int argc, char *argv[]) {
kArgAlpha, kArgBeta};
switch(GetPrecision(argc, argv)) {
case Precision::kHalf: throw std::runtime_error("Unsupported precision mode");
- case Precision::kSingle: ClientABC<float>(argc, argv, PerformanceXsymm<float>, o); break;
- case Precision::kDouble: ClientABC<double>(argc, argv, PerformanceXsymm<double>, o); break;
- case Precision::kComplexSingle: ClientABC<float2>(argc, argv, PerformanceXsymm<float2>, o); break;
- case Precision::kComplexDouble: ClientABC<double2>(argc, argv, PerformanceXsymm<double2>, o); break;
+ case Precision::kSingle: ClientABC<float>(argc, argv, PerformanceXsymm<float>, o, false); break;
+ case Precision::kDouble: ClientABC<double>(argc, argv, PerformanceXsymm<double>, o, false); break;
+ case Precision::kComplexSingle: ClientABC<float2>(argc, argv, PerformanceXsymm<float2>, o, false); break;
+ case Precision::kComplexDouble: ClientABC<double2>(argc, argv, PerformanceXsymm<double2>, o, false); break;
}
}