diff options
author | cnugteren <web@cedricnugteren.nl> | 2016-03-30 21:37:56 -0700 |
---|---|---|
committer | cnugteren <web@cedricnugteren.nl> | 2016-03-30 21:37:56 -0700 |
commit | 8c3c6db7d07adaacb702fdaabfdf18f74fbfea13 (patch) | |
tree | f6dcd3f9d4f987ec74f87b1939c4b3600a7d42d0 /test/performance | |
parent | 6578102ae996ce0aa52b45704f38c1cd5a10d3c0 (diff) | |
parent | 5409f349a17f60ba68133fd0cc9789fb2918f790 (diff) |
Merge branch 'level1_routines' into development
Diffstat (limited to 'test/performance')
-rw-r--r-- | test/performance/client.cc | 11 | ||||
-rw-r--r-- | test/performance/routines/level1/xnrm2.cc | 35 |
2 files changed, 41 insertions, 5 deletions
diff --git a/test/performance/client.cc b/test/performance/client.cc index ebfad3a6..17f54231 100644 --- a/test/performance/client.cc +++ b/test/performance/client.cc @@ -136,14 +136,14 @@ void Client<T,U>::PerformanceTest(Arguments<U> &args, const SetMetric set_sizes) std::vector<T> b_source(args.b_size); std::vector<T> c_source(args.c_size); std::vector<T> ap_source(args.ap_size); - std::vector<T> dot_source(args.dot_size); + std::vector<T> scalar_source(args.scalar_size); PopulateVector(x_source); PopulateVector(y_source); PopulateVector(a_source); PopulateVector(b_source); PopulateVector(c_source); PopulateVector(ap_source); - PopulateVector(dot_source); + PopulateVector(scalar_source); // Creates the matrices on the device auto x_vec = Buffer<T>(context, args.x_size); @@ -152,15 +152,15 @@ void Client<T,U>::PerformanceTest(Arguments<U> &args, const SetMetric set_sizes) auto b_mat = Buffer<T>(context, args.b_size); auto c_mat = Buffer<T>(context, args.c_size); auto ap_mat = Buffer<T>(context, args.ap_size); - auto dot = Buffer<T>(context, args.dot_size); + auto scalar = Buffer<T>(context, args.scalar_size); x_vec.Write(queue, args.x_size, x_source); y_vec.Write(queue, args.y_size, y_source); a_mat.Write(queue, args.a_size, a_source); b_mat.Write(queue, args.b_size, b_source); c_mat.Write(queue, args.c_size, c_source); ap_mat.Write(queue, args.ap_size, ap_source); - dot.Write(queue, args.dot_size, dot_source); - auto buffers = Buffers<T>{x_vec, y_vec, a_mat, b_mat, c_mat, ap_mat, dot}; + scalar.Write(queue, args.scalar_size, scalar_source); + auto buffers = Buffers<T>{x_vec, y_vec, a_mat, b_mat, c_mat, ap_mat, scalar}; // Runs the routines and collects the timings auto timings = std::vector<std::pair<std::string, double>>(); @@ -267,6 +267,7 @@ void Client<T,U>::PrintTableRow(const Arguments<U>& args, else if (o == kArgCOffset) { integers.push_back(args.c_offset); } else if (o == kArgAPOffset) { integers.push_back(args.ap_offset); } else if (o == kArgDotOffset) {integers.push_back(args.dot_offset); } + else if (o == kArgNrm2Offset){integers.push_back(args.nrm2_offset); } } auto strings = std::vector<std::string>{}; for (auto &o: options_) { diff --git a/test/performance/routines/level1/xnrm2.cc b/test/performance/routines/level1/xnrm2.cc new file mode 100644 index 00000000..db6ec9ad --- /dev/null +++ b/test/performance/routines/level1/xnrm2.cc @@ -0,0 +1,35 @@ + +// ================================================================================================= +// 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> +// +// ================================================================================================= + +#include "performance/client.h" +#include "routines/level1/xnrm2.h" + +// Shortcuts to the clblast namespace +using float2 = clblast::float2; +using double2 = clblast::double2; + +// Main function (not within the clblast namespace) +int main(int argc, char *argv[]) { + switch(clblast::GetPrecision(argc, argv, clblast::Precision::kSingle)) { + case clblast::Precision::kHalf: throw std::runtime_error("Unsupported precision mode"); + case clblast::Precision::kSingle: + clblast::RunClient<clblast::TestXnrm2<float>, float, float>(argc, argv); break; + case clblast::Precision::kDouble: + clblast::RunClient<clblast::TestXnrm2<double>, double, double>(argc, argv); break; + case clblast::Precision::kComplexSingle: + clblast::RunClient<clblast::TestXnrm2<float2>, float2, float2>(argc, argv); break; + case clblast::Precision::kComplexDouble: + clblast::RunClient<clblast::TestXnrm2<double2>, double2, double2>(argc, argv); break; + } + return 0; +} + +// ================================================================================================= |