]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - dense-linear-algebra-libraries/linalg.git/blob - blis/frame/2/gemv/bli_gemv_check.c
TI Linear Algebra Library (LINALG) Rlease 1.0.0
[dense-linear-algebra-libraries/linalg.git] / blis / frame / 2 / gemv / bli_gemv_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_gemv_basic_check( obj_t*  alpha,
38                            obj_t*  a,
39                            obj_t*  x,
40                            obj_t*  beta,
41                            obj_t*  y )
42 {
43         err_t e_val;
45         // Check object datatypes.
47         e_val = bli_check_noninteger_object( alpha );
48         bli_check_error_code( e_val );
50         e_val = bli_check_noninteger_object( beta );
51         bli_check_error_code( e_val );
53         e_val = bli_check_floating_object( a );
54         bli_check_error_code( e_val );
56         e_val = bli_check_floating_object( x );
57         bli_check_error_code( e_val );
59         e_val = bli_check_floating_object( y );
60         bli_check_error_code( e_val );
62         // Check object dimensions.
64         e_val = bli_check_scalar_object( alpha );
65         bli_check_error_code( e_val );
67         e_val = bli_check_scalar_object( beta );
68         bli_check_error_code( e_val );
70         e_val = bli_check_matrix_object( a );
71         bli_check_error_code( e_val );
73         e_val = bli_check_vector_object( x );
74         bli_check_error_code( e_val );
76         e_val = bli_check_vector_object( y );
77         bli_check_error_code( e_val );
79         e_val = bli_check_vector_dim_equals( x, bli_obj_width_after_trans( *a ) );
80         bli_check_error_code( e_val );
82         e_val = bli_check_vector_dim_equals( y, bli_obj_length_after_trans( *a ) );
83         bli_check_error_code( e_val );
84 }
86 void bli_gemv_check( obj_t*  alpha,
87                      obj_t*  a,
88                      obj_t*  x,
89                      obj_t*  beta,
90                      obj_t*  y )
91 {
92         err_t e_val;
94         // Check basic properties of the operation.
96         bli_gemv_basic_check( alpha, a, x, beta, y );
98         // Check matrix structure.
100         e_val = bli_check_general_object( a );
101         bli_check_error_code( e_val );
104 void bli_gemv_int_check( obj_t*  alpha,
105                          obj_t*  a,
106                          obj_t*  x,
107                          obj_t*  beta,
108                          obj_t*  y,
109                          gemv_t* cntl )
111         err_t e_val;
113         // Check basic properties of the operation.
115         bli_gemv_basic_check( alpha, a, x, beta, y );
117         // Check object buffers (for non-NULLness).
119         e_val = bli_check_object_buffer( alpha );
120         bli_check_error_code( e_val );
122         e_val = bli_check_object_buffer( a );
123         bli_check_error_code( e_val );
125         e_val = bli_check_object_buffer( x );
126         bli_check_error_code( e_val );
128         e_val = bli_check_object_buffer( beta );
129         bli_check_error_code( e_val );
131         e_val = bli_check_object_buffer( y );
132         bli_check_error_code( e_val );
134         // Check control tree pointer.
136         e_val = bli_check_valid_cntl( ( void* )cntl );
137         bli_check_error_code( e_val );