1 //=================================================================================================
2 /*!
3 //  \file src/mathtest/blas/OperationTest.cpp
4 //  \brief Source file for the BLAS operation test
5 //
6 //  Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
7 //
8 //  This file is part of the Blaze library. You can redistribute it and/or modify it under
9 //  the terms of the New (Revised) BSD License. Redistribution and use in source and binary
10 //  forms, with or without modification, are permitted provided that the following conditions
11 //  are met:
12 //
13 //  1. Redistributions of source code must retain the above copyright notice, this list of
14 //     conditions and the following disclaimer.
15 //  2. Redistributions in binary form must reproduce the above copyright notice, this list
16 //     of conditions and the following disclaimer in the documentation and/or other materials
17 //     provided with the distribution.
18 //  3. Neither the names of the Blaze development group nor the names of its contributors
19 //     may be used to endorse or promote products derived from this software without specific
20 //     prior written permission.
21 //
22 //  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
23 //  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 //  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25 //  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 //  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
27 //  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
28 //  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 //  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 //  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31 //  DAMAGE.
32 */
33 //=================================================================================================
34 
35 
36 //*************************************************************************************************
37 // Includes
38 //*************************************************************************************************
39 
40 #include <cstdlib>
41 #include <iostream>
42 #include <blaze/util/Complex.h>
43 #include <blazetest/mathtest/blas/OperationTest.h>
44 
45 
46 namespace blazetest {
47 
48 namespace mathtest {
49 
50 namespace blas {
51 
52 //=================================================================================================
53 //
54 //  CONSTRUCTORS
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
59 /*!\brief Constructor for the OperationTest class test.
60 //
61 // \exception std::runtime_error Operation error detected.
62 */
OperationTest()63 OperationTest::OperationTest()
64 {
65    using blaze::complex;
66 
67 
68    //=====================================================================================
69    // Single precision tests
70    //=====================================================================================
71 
72    //testDotu< float >();
73    //testDotc< float >();
74    //testAxpy< float >();
75    //testTrsm< float >();
76 
77 
78    //=====================================================================================
79    // Double precision tests
80    //=====================================================================================
81 
82    testDotu< double >();
83    testDotc< double >();
84    testAxpy< double >();
85    testTrsm< double >();
86 
87 
88    //=====================================================================================
89    // Single precision complex tests
90    //=====================================================================================
91 
92    //testDotu< complex<float> >();
93    //testDotc< complex<float> >();
94    //testAxpy< complex<float> >();
95    //testTrsm< complex<float> >();
96 
97 
98    //=====================================================================================
99    // Double precision complex tests
100    //=====================================================================================
101 
102    testDotu< complex<double> >();
103    testDotc< complex<double> >();
104    testAxpy< complex<double> >();
105    testTrsm< complex<double> >();
106 }
107 //*************************************************************************************************
108 
109 } // namespace blas
110 
111 } // namespace mathtest
112 
113 } // namespace blazetest
114 
115 
116 
117 
118 //=================================================================================================
119 //
120 //  MAIN FUNCTION
121 //
122 //=================================================================================================
123 
124 //*************************************************************************************************
main()125 int main()
126 {
127    std::cout << "   Running BLAS operation test..." << std::endl;
128 
129    try
130    {
131       RUN_BLAS_OPERATION_TEST;
132    }
133    catch( std::exception& ex ) {
134       std::cerr << "\n\n ERROR DETECTED during BLAS operation test:\n"
135                 << ex.what() << "\n";
136       return EXIT_FAILURE;
137    }
138 
139    return EXIT_SUCCESS;
140 }
141 //*************************************************************************************************
142