]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - dense-linear-algebra-libraries/linalg.git/blob - blis/frame/3/trsm/bli_trsm_check.c
TI Linear Algebra Library (LINALG) Rlease 1.0.0
[dense-linear-algebra-libraries/linalg.git] / blis / frame / 3 / trsm / bli_trsm_check.c
1 /*
3    BLIS    
4    An object-based framework for developing high-performance BLAS-like
5    libraries.
7    Copyright (C) 2014, The University of Texas at Austin
9    Redistribution and use in source and binary forms, with or without
10    modification, are permitted provided that the following conditions are
11    met:
12     - Redistributions of source code must retain the above copyright
13       notice, this list of conditions and the following disclaimer.
14     - Redistributions in binary form must reproduce the above copyright
15       notice, this list of conditions and the following disclaimer in the
16       documentation and/or other materials provided with the distribution.
17     - Neither the name of The University of Texas at Austin nor the names
18       of its contributors may be used to endorse or promote products
19       derived from this software without specific prior written permission.
21    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25    HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
35 #include "blis.h"
37 void bli_trsm_basic_check( side_t  side,
38                            obj_t*  alpha,
39                            obj_t*  a,
40                            obj_t*  b,
41                            obj_t*  beta,
42                            obj_t*  c )
43 {
44         err_t e_val;
46         // Check object datatypes.
48         e_val = bli_check_noninteger_object( alpha );
49         bli_check_error_code( e_val );
51         e_val = bli_check_floating_object( a );
52         bli_check_error_code( e_val );
54         e_val = bli_check_floating_object( b );
55         bli_check_error_code( e_val );
57         e_val = bli_check_noninteger_object( beta );
58         bli_check_error_code( e_val );
60         e_val = bli_check_floating_object( c );
61         bli_check_error_code( e_val );
63         // Check object dimensions.
65         e_val = bli_check_scalar_object( alpha );
66         bli_check_error_code( e_val );
68         e_val = bli_check_scalar_object( beta );
69         bli_check_error_code( e_val );
71         e_val = bli_check_matrix_object( a );
72         bli_check_error_code( e_val );
74         e_val = bli_check_matrix_object( b );
75         bli_check_error_code( e_val );
77         e_val = bli_check_matrix_object( c );
78         bli_check_error_code( e_val );
80         if ( bli_is_left( side ) )
81         {
82                 e_val = bli_check_level3_dims( a, b, c );
83                 bli_check_error_code( e_val );
84         }
85         else // if ( bli_is_right( side ) )
86         {
87                 e_val = bli_check_level3_dims( b, a, c );
88                 bli_check_error_code( e_val );
89         }
90 }
92 void bli_trsm_check( side_t  side,
93                      obj_t*  alpha,
94                      obj_t*  a,
95                      obj_t*  b )
96 {
97         err_t e_val;
99         // Check basic properties of the operation.
101         bli_trsm_basic_check( side, alpha, a, b, &BLIS_ZERO, b );
103         // Check matrix squareness.
105         e_val = bli_check_square_object( a );
106         bli_check_error_code( e_val );
108         // Check matrix structure.
110         e_val = bli_check_triangular_object( a );
111         bli_check_error_code( e_val );
114 void bli_trsm_int_check( obj_t*  alpha,
115                          obj_t*  a,
116                          obj_t*  b,
117                          obj_t*  beta,
118                          obj_t*  c,
119                          trsm_t* cntl )
121         err_t e_val;
123         // Check object buffers (for non-NULLness).
125         e_val = bli_check_object_buffer( alpha );
126         bli_check_error_code( e_val );
128         e_val = bli_check_object_buffer( a );
129         bli_check_error_code( e_val );
131         e_val = bli_check_object_buffer( b );
132         bli_check_error_code( e_val );
134         e_val = bli_check_object_buffer( beta );
135         bli_check_error_code( e_val );
137         e_val = bli_check_object_buffer( c );
138         bli_check_error_code( e_val );
140         // Check basic properties of the operation.
142         bli_trsm_basic_check( BLIS_LEFT, alpha, a, b, beta, c );
144         // Check control tree pointer
146         e_val = bli_check_valid_cntl( ( void* )cntl );
147         bli_check_error_code( e_val );