From 75f263ce3aa35f57115670af18719137b3020e79 Mon Sep 17 00:00:00 2001 From: CNugteren Date: Fri, 26 Jun 2015 08:10:23 +0200 Subject: [PATCH] Added symmetric matrix support for the ABC performance tester --- test/performance/client.cc | 13 +++++++------ test/performance/client.h | 2 +- test/performance/routines/xgemm.cc | 8 ++++---- test/performance/routines/xsymm.cc | 8 ++++---- 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(int, char **, Routine2, const std::vect // This is the matrix-matrix-matrix variant of the set-up/tear-down client routine. template void ClientABC(int argc, char *argv[], Routine3 client_routine, - const std::vector &options) { + const std::vector &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 args) { return args.m; }; + auto default_ld_a = [&symmetric](const Arguments args) { return (symmetric) ? args.n : args.m; }; // Simple command line argument parser with defaults auto args = ParseArguments(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 client_routine, } // Compiles the above function -template void ClientABC(int, char **, Routine3, const std::vector&); -template void ClientABC(int, char **, Routine3, const std::vector&); -template void ClientABC(int, char **, Routine3, const std::vector&); -template void ClientABC(int, char **, Routine3, const std::vector&); +template void ClientABC(int, char **, Routine3, const std::vector&, const bool); +template void ClientABC(int, char **, Routine3, const std::vector&, const bool); +template void ClientABC(int, char **, Routine3, const std::vector&, const bool); +template void ClientABC(int, char **, Routine3, const std::vector&, 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 client_routine, const std::vector &options); template void ClientABC(int argc, char *argv[], Routine3 client_routine, - const std::vector &options); + const std::vector &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(argc, argv, PerformanceXgemm, o); break; - case Precision::kDouble: ClientABC(argc, argv, PerformanceXgemm, o); break; - case Precision::kComplexSingle: ClientABC(argc, argv, PerformanceXgemm, o); break; - case Precision::kComplexDouble: ClientABC(argc, argv, PerformanceXgemm, o); break; + case Precision::kSingle: ClientABC(argc, argv, PerformanceXgemm, o, false); break; + case Precision::kDouble: ClientABC(argc, argv, PerformanceXgemm, o, false); break; + case Precision::kComplexSingle: ClientABC(argc, argv, PerformanceXgemm, o, false); break; + case Precision::kComplexDouble: ClientABC(argc, argv, PerformanceXgemm, 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(argc, argv, PerformanceXsymm, o); break; - case Precision::kDouble: ClientABC(argc, argv, PerformanceXsymm, o); break; - case Precision::kComplexSingle: ClientABC(argc, argv, PerformanceXsymm, o); break; - case Precision::kComplexDouble: ClientABC(argc, argv, PerformanceXsymm, o); break; + case Precision::kSingle: ClientABC(argc, argv, PerformanceXsymm, o, false); break; + case Precision::kDouble: ClientABC(argc, argv, PerformanceXsymm, o, false); break; + case Precision::kComplexSingle: ClientABC(argc, argv, PerformanceXsymm, o, false); break; + case Precision::kComplexDouble: ClientABC(argc, argv, PerformanceXsymm, o, false); break; } }