From 2fe3fe15801f8ef11b38bfd93d7d68fbb37253a1 Mon Sep 17 00:00:00 2001 From: CNugteren Date: Fri, 10 Jul 2015 07:18:12 +0200 Subject: The clients now distinguish between the memory and alpha/beta data-type --- test/performance/client.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'test/performance/client.h') diff --git a/test/performance/client.h b/test/performance/client.h index f9f219d0..c9095967 100644 --- a/test/performance/client.h +++ b/test/performance/client.h @@ -10,6 +10,8 @@ // This class implements the performance-test client. It is generic for all CLBlast routines by // taking a number of routine-specific functions as arguments, such as how to compute buffer sizes // or how to get the FLOPS count. +// Typename T: the data-type of the routine's memory buffers (==precision) +// Typename U: the data-type of the alpha and beta arguments // // This file also provides the common interface to the performance client (see the 'RunClient' // function for details). @@ -32,7 +34,7 @@ namespace clblast { // ================================================================================================= // See comment at top of file for a description of the class -template +template class Client { public: @@ -40,9 +42,9 @@ class Client { const cl_device_type kDeviceType = CL_DEVICE_TYPE_ALL; // Shorthand for the routine-specific functions passed to the tester - using Routine = std::function&, const Buffers&, CommandQueue&)>; - using SetMetric = std::function&)>; - using GetMetric = std::function&)>; + using Routine = std::function&, const Buffers&, CommandQueue&)>; + using SetMetric = std::function&)>; + using GetMetric = std::function&)>; // The constructor Client(const Routine run_routine, const Routine run_reference, @@ -51,24 +53,24 @@ class Client { // Parses all command-line arguments, filling in the arguments structure. If no command-line // argument is given for a particular argument, it is filled in with a default value. - Arguments ParseArguments(int argc, char *argv[], const GetMetric default_a_ld, + Arguments ParseArguments(int argc, char *argv[], const GetMetric default_a_ld, const GetMetric default_b_ld, const GetMetric default_c_ld); // The main client function, setting-up arguments, matrices, OpenCL buffers, etc. After set-up, it // calls the client routines. - void PerformanceTest(Arguments &args, const SetMetric set_sizes); + void PerformanceTest(Arguments &args, const SetMetric set_sizes); private: // Runs a function a given number of times and returns the execution time of the shortest instance - double TimedExecution(const size_t num_runs, const Arguments &args, const Buffers &buffers, + double TimedExecution(const size_t num_runs, const Arguments &args, const Buffers &buffers, CommandQueue &queue, Routine run_blas, const std::string &library_name); // Prints the header of a performance-data table void PrintTableHeader(const bool silent, const std::vector &args); // Prints a row of performance data, including results of two libraries - void PrintTableRow(const Arguments& args, const double ms_clblast, const double ms_clblas); + void PrintTableRow(const Arguments& args, const double ms_clblast, const double ms_clblas); // The routine-specific functions passed to the tester const Routine run_routine_; @@ -82,12 +84,12 @@ class Client { // The interface to the performance client. This is a separate function in the header such that it // is automatically compiled for each routine, templated by the parameter "C". -template +template void RunClient(int argc, char *argv[]) { // Creates a new client - auto client = Client(C::RunRoutine, C::RunReference, C::GetOptions(), - C::GetFlops, C::GetBytes); + auto client = Client(C::RunRoutine, C::RunReference, C::GetOptions(), + C::GetFlops, C::GetBytes); // Simple command line argument parser with defaults auto args = client.ParseArguments(argc, argv, C::DefaultLDA, C::DefaultLDB, C::DefaultLDC); -- cgit v1.2.3