// ================================================================================================= // This file is part of the CLBlast project. The project is licensed under the MIT license. 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 // // This file tests any mat-mat-mat (A,B,C) routine. It contains two types of tests: one testing // all sorts of input combinations, and one deliberatly testing with invalid values. // // ================================================================================================= #ifndef CLBLAST_TEST_CORRECTNESS_TESTABC_H_ #define CLBLAST_TEST_CORRECTNESS_TESTABC_H_ #include #include #include "correctness/tester.h" namespace clblast { // ================================================================================================= // See comment at top of file for a description of the class template class TestABC: public Tester { public: // Uses several variables from the Tester class using Tester::context_; using Tester::queue_; using Tester::kLayouts; using Tester::kTransposes; // Uses several helper functions from the Tester class using Tester::TestStart; using Tester::TestEnd; using Tester::TestSimilarity; using Tester::TestErrorCount; using Tester::TestErrorCodes; using Tester::GetExampleScalars; // Test settings for the regular test. Append to this list in case more tests are required. const std::vector kMatrixDims = { 7, 64 }; const std::vector kOffsets = { 0 }; const std::vector kAlphaValues = GetExampleScalars(); const std::vector kBetaValues = GetExampleScalars(); // Test settings for the invalid test const size_t kBufferSize = 64; // Shorthand for a BLAS routine using Routine = std::function&, const Buffer&, const Buffer&, const Buffer&, CommandQueue&)>; // Constructor, initializes the base class tester and input data TestABC(const size_t platform_id, const size_t device_id, const std::string &name, const std::vector &options, const Routine clblast_lambda, const Routine clblas_lambda); // The test functions, taking no inputs void TestRegular(Arguments &args, const std::string &name); void TestInvalidBufferSizes(Arguments &args, const std::string &name); private: // Source data to test with std::vector a_source_; std::vector b_source_; std::vector c_source_; // The routines to test Routine clblast_lambda_; Routine clblas_lambda_; }; // ================================================================================================= } // namespace clblast // CLBLAST_TEST_CORRECTNESS_TESTABC_H_ #endif