mirror of
https://github.com/amd/blis.git
synced 2026-04-20 07:38:53 +00:00
Added randn[vm] operations, support in testsuite.
Details:
- Defined a new randomization operation, randn, on vectors and matrices.
The randnv and randnm operations randomize each element of the target
object with values from a narrow range of values. Presently, those
values are all integer powers of two, but they do not need to be powers
of two in order to achieve the primary goal, which is to initialize
objects that can be operated on with plenty of precision "slack"
available to allow computations that avoid roundoff. Using this method
of randomization makes it much more likely that testsuite residuals of
properly-functioning operations are close to zero, if not exactly zero.
- Updated existing randomization operations randv and randm to skip
special diagonal handling and normalization for matrices with structure.
This is now handled by the testsuite modules by explicitly calling a
testsuite function that loads the diagonal (and scales off-diagonal
elements).
- Added support for randnv and randnm in the testsuite with a new switch
in input.general that universally toggles between use of the classic
randv/randm, which use real values on the interval [-1,1], and
randnv/randnm, which use only values from a narrow range. Currently,
the narrow range is: +/-{2^0, 2^-1, 2^-2, 2^-3, 2^-4, 2^-5, 2^-6}, as
well as 0.0.
- Updated testsuite modules so that a testsutie wrapper function is called
instead of directly calling the randomization operations (such as
bli_randv() and bli_randm()). This wrapper also takes a bool_t that
indicates whether the object's elements should be normalized. (NOTE: As
alluded to above, in the test modules of triangular solve operations such
as trsv and trsm, we perform the extra step of loading the diagonal.)
- Defined a new level-0 operation, invertsc, which inverts a scalar.
- Updated the abval2ris and sqrt2ris level-0 macros to avoid an unlikely
but possible divide-by-zero.
- Updated function signature and prototype formatting in testsuite.
This commit is contained in:
@@ -58,6 +58,20 @@ GENFRONT( sqrtsc )
|
||||
GENFRONT( subsc )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
obj_t* chi \
|
||||
) \
|
||||
{ \
|
||||
bli_l0_xsc_check( chi ); \
|
||||
}
|
||||
|
||||
GENFRONT( invertsc )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
@@ -237,6 +251,32 @@ void bli_zipsc_check
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_l0_xsc_check
|
||||
(
|
||||
obj_t* chi
|
||||
)
|
||||
{
|
||||
err_t e_val;
|
||||
|
||||
// Check object datatypes.
|
||||
|
||||
e_val = bli_check_noninteger_object( chi );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_nonconstant_object( chi );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
// Check object dimensions.
|
||||
|
||||
e_val = bli_check_scalar_object( chi );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
// Check object buffers (for non-NULLness).
|
||||
|
||||
e_val = bli_check_object_buffer( chi );
|
||||
bli_check_error_code( e_val );
|
||||
}
|
||||
|
||||
void bli_l0_xxsc_check
|
||||
(
|
||||
obj_t* chi,
|
||||
|
||||
@@ -54,6 +54,17 @@ GENTPROT( sqrtsc )
|
||||
GENTPROT( subsc )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
obj_t* chi \
|
||||
);
|
||||
|
||||
GENTPROT( invertsc )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( opname ) \
|
||||
\
|
||||
@@ -121,6 +132,11 @@ GENTPROT( zipsc )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_l0_xsc_check
|
||||
(
|
||||
obj_t* chi
|
||||
);
|
||||
|
||||
void bli_l0_xxsc_check
|
||||
(
|
||||
obj_t* chi,
|
||||
|
||||
@@ -111,6 +111,36 @@ GENFRONT( mulsc )
|
||||
GENFRONT( subsc )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC0(opname) \
|
||||
( \
|
||||
obj_t* chi \
|
||||
) \
|
||||
{ \
|
||||
num_t dt = bli_obj_datatype( *chi ); \
|
||||
\
|
||||
conj_t conjchi = bli_obj_conj_status( *chi ); \
|
||||
\
|
||||
void* buf_chi = bli_obj_buffer_for_1x1( dt, *chi ); \
|
||||
\
|
||||
if ( bli_error_checking_is_enabled() ) \
|
||||
PASTEMAC(opname,_check)( chi ); \
|
||||
\
|
||||
/* Invoke the typed function. */ \
|
||||
bli_call_ft_2 \
|
||||
( \
|
||||
dt, \
|
||||
opname, \
|
||||
conjchi, \
|
||||
buf_chi \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( invertsc )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
|
||||
@@ -66,6 +66,17 @@ GENPROT( sqrtsc )
|
||||
GENPROT( subsc )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
void PASTEMAC0(opname) \
|
||||
( \
|
||||
obj_t* chi \
|
||||
);
|
||||
|
||||
GENPROT( invertsc )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
|
||||
@@ -59,6 +59,25 @@ INSERT_GENTFUNC_BASIC( divsc, invscals )
|
||||
INSERT_GENTFUNC_BASIC( subsc, subs )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname, kername ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
conj_t conjchi, \
|
||||
ctype* chi \
|
||||
) \
|
||||
{ \
|
||||
ctype chi_conj; \
|
||||
\
|
||||
PASTEMAC(ch,copycjs)( conjchi, *chi, chi_conj ); \
|
||||
PASTEMAC(ch,kername)( chi_conj ); \
|
||||
PASTEMAC(ch,copys)( chi_conj, *chi ); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC( invertsc, inverts )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname, kername ) \
|
||||
\
|
||||
|
||||
@@ -53,6 +53,18 @@ INSERT_GENTPROT_BASIC( mulsc )
|
||||
INSERT_GENTPROT_BASIC( subsc )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
conj_t conjchi, \
|
||||
ctype* chi \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC( invertsc )
|
||||
|
||||
|
||||
#undef GENTPROTR
|
||||
#define GENTPROTR( ctype, ctype_r, ch, chr, opname ) \
|
||||
\
|
||||
|
||||
@@ -163,6 +163,7 @@
|
||||
#include "bli_neg2s.h"
|
||||
|
||||
#include "bli_rands.h"
|
||||
#include "bli_randnp2s.h"
|
||||
|
||||
#include "bli_scals.h"
|
||||
#include "bli_scaljs.h"
|
||||
|
||||
167
frame/include/level0/bli_randnp2s.h
Normal file
167
frame/include/level0/bli_randnp2s.h
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_RANDNP2S_H
|
||||
#define BLIS_RANDNP2S_H
|
||||
|
||||
// randnp2s
|
||||
|
||||
|
||||
#define bli_srandnp2s( a ) \
|
||||
{ \
|
||||
bli_drandnp2s( a ); \
|
||||
}
|
||||
#define bli_drandnp2s_prev( a ) \
|
||||
{ \
|
||||
const double m_max = 3.0; \
|
||||
const double m_max2 = m_max + 2.0; \
|
||||
double t; \
|
||||
double r_val; \
|
||||
\
|
||||
/* Compute a narrow-range power of two.
|
||||
|
||||
For the purposes of commentary, we'll assume that m_max = 4. This
|
||||
represents the largest power of two we will use to generate the
|
||||
random numbers. */ \
|
||||
\
|
||||
/* Generate a random real number t on the interval: [0.0, 6.0]. */ \
|
||||
t = ( ( double ) rand() / ( double ) RAND_MAX ) * m_max2; \
|
||||
\
|
||||
/* Modify t to guarantee that is never equal to the upper bound of
|
||||
the interval (in this case, 6.0). */ \
|
||||
if ( t == m_max2 ) t = t - 1.0; \
|
||||
\
|
||||
/* Transform the interval into the set of integers, {0,1,2,3,4,5}. */ \
|
||||
t = floor( t ); \
|
||||
\
|
||||
/* Map values of t == 0 to a final value of 0. */ \
|
||||
if ( t == 0.0 ) r_val = 0.0; \
|
||||
else \
|
||||
{ \
|
||||
/* This case handles values of t = {1,2,3,4,5}. */ \
|
||||
\
|
||||
double s_exp, s_val; \
|
||||
\
|
||||
/* Compute two random numbers to determine the signs of the
|
||||
exponent and the end result. */ \
|
||||
PASTEMAC(d,rands)( s_exp ); \
|
||||
PASTEMAC(d,rands)( s_val ); \
|
||||
\
|
||||
/* Compute r_val = 2^s where s = +/-(t-1) = {-4,-3,-2,-1,0,1,2,3,4}. */ \
|
||||
if ( s_exp < 0.0 ) r_val = pow( 2.0, -(t - 1.0) ); \
|
||||
else r_val = pow( 2.0, t - 1.0 ); \
|
||||
\
|
||||
/* If our sign value is negative, our random power of two will
|
||||
be negative. */ \
|
||||
if ( s_val < 0.0 ) r_val = -r_val; \
|
||||
} \
|
||||
\
|
||||
/* Normalize by the largest possible positive value. */ \
|
||||
r_val = r_val / pow( 2.0, m_max ); \
|
||||
\
|
||||
/* r_val = 0, or +/-{2^-4, 2^-3, 2^-2, 2^-1, 2^0, 2^1, 2^2, 2^3, 2^4}. */ \
|
||||
/* NOTE: For single-precision macros, this assignment results in typecast
|
||||
down to float. */ \
|
||||
a = r_val; \
|
||||
}
|
||||
#define bli_drandnp2s( a ) \
|
||||
{ \
|
||||
const double m_max = 6.0; \
|
||||
const double m_max2 = m_max + 2.0; \
|
||||
double t; \
|
||||
double r_val; \
|
||||
\
|
||||
/* Compute a narrow-range power of two.
|
||||
|
||||
For the purposes of commentary, we'll assume that m_max = 4. This
|
||||
represents the largest power of two we will use to generate the
|
||||
random numbers. */ \
|
||||
\
|
||||
/* Generate a random real number t on the interval: [0.0, 6.0]. */ \
|
||||
t = ( ( double ) rand() / ( double ) RAND_MAX ) * m_max2; \
|
||||
\
|
||||
/* Modify t to guarantee that is never equal to the upper bound of
|
||||
the interval (in this case, 6.0). */ \
|
||||
if ( t == m_max2 ) t = t - 1.0; \
|
||||
\
|
||||
/* Transform the interval into the set of integers, {0,1,2,3,4,5}. */ \
|
||||
t = floor( t ); \
|
||||
\
|
||||
/* Map values of t == 0 to a final value of 0. */ \
|
||||
if ( t == 0.0 ) r_val = 0.0; \
|
||||
else \
|
||||
{ \
|
||||
/* This case handles values of t = {1,2,3,4,5}. */ \
|
||||
\
|
||||
double s_val; \
|
||||
\
|
||||
/* Compute r_val = 2^s where s = +/-(t-1) = {-4,-3,-2,-1,0}. */ \
|
||||
r_val = pow( 2.0, -(t - 1.0) ); \
|
||||
\
|
||||
/* Compute a random number to determine the sign of the final
|
||||
result. */ \
|
||||
PASTEMAC(d,rands)( s_val ); \
|
||||
\
|
||||
/* If our sign value is negative, our random power of two will
|
||||
be negative. */ \
|
||||
if ( s_val < 0.0 ) r_val = -r_val; \
|
||||
} \
|
||||
\
|
||||
/* r_val = 0, or +/-{2^0, 2^-1, 2^-2, 2^-3, 2^-4}. */ \
|
||||
/* NOTE: For single-precision macros, this assignment results in typecast
|
||||
down to float. */ \
|
||||
a = r_val; \
|
||||
}
|
||||
#define bli_crandnp2s( a ) \
|
||||
{ \
|
||||
float ar, ai; \
|
||||
\
|
||||
bli_srandnp2s( ar ); \
|
||||
bli_srandnp2s( ai ); \
|
||||
\
|
||||
bli_csets( ar, ai, (a) ); \
|
||||
}
|
||||
#define bli_zrandnp2s( a ) \
|
||||
{ \
|
||||
double ar, ai; \
|
||||
\
|
||||
bli_drandnp2s( ar ); \
|
||||
bli_drandnp2s( ai ); \
|
||||
\
|
||||
bli_zsets( ar, ai, (a) ); \
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -50,9 +50,14 @@
|
||||
#define bli_cabval2ris( xr, xi, ar, ai ) \
|
||||
{ \
|
||||
float s = bli_fmaxabs( (xr), (xi) ); \
|
||||
float mag = sqrtf( s ) * \
|
||||
sqrtf( ( (xr) / s ) * (xr) + \
|
||||
( (xi) / s ) * (xi) ); \
|
||||
float mag; \
|
||||
if ( s == 0.0F ) mag = 0.0F; \
|
||||
else \
|
||||
{ \
|
||||
mag = sqrtf( s ) * \
|
||||
sqrtf( ( (xr) / s ) * (xr) + \
|
||||
( (xi) / s ) * (xi) ); \
|
||||
} \
|
||||
(ar) = mag; \
|
||||
(ai) = 0.0F; \
|
||||
}
|
||||
@@ -60,9 +65,14 @@
|
||||
#define bli_zabval2ris( xr, xi, ar, ai ) \
|
||||
{ \
|
||||
double s = bli_fmaxabs( (xr), (xi) ); \
|
||||
double mag = sqrt( s ) * \
|
||||
sqrt( ( (xr) / s ) * (xr) + \
|
||||
( (xi) / s ) * (xi) ); \
|
||||
double mag; \
|
||||
if ( s == 0.0 ) mag = 0.0; \
|
||||
else \
|
||||
{ \
|
||||
mag = sqrt( s ) * \
|
||||
sqrt( ( (xr) / s ) * (xr) + \
|
||||
( (xi) / s ) * (xi) ); \
|
||||
} \
|
||||
(ar) = mag; \
|
||||
(ai) = 0.0; \
|
||||
}
|
||||
|
||||
@@ -50,9 +50,14 @@
|
||||
#define bli_csqrt2ris( xr, xi, ar, ai ) \
|
||||
{ \
|
||||
float s = bli_fmaxabs( (xr), (xi) ); \
|
||||
float mag = sqrtf( s ) * \
|
||||
sqrtf( ( (xr) / s ) * (xr) + \
|
||||
( (xi) / s ) * (xi) ); \
|
||||
float mag; \
|
||||
if ( s == 0.0F ) mag = 0.0F; \
|
||||
else \
|
||||
{ \
|
||||
mag = sqrtf( s ) * \
|
||||
sqrtf( ( (xr) / s ) * (xr) + \
|
||||
( (xi) / s ) * (xi) ); \
|
||||
} \
|
||||
\
|
||||
(ar) = sqrtf( ( mag + (xr) ) / 2.0F ); \
|
||||
(ai) = sqrtf( ( mag - (xi) ) / 2.0F ); \
|
||||
@@ -61,9 +66,14 @@
|
||||
#define bli_zsqrt2ris( xr, xi, ar, ai ) \
|
||||
{ \
|
||||
double s = bli_fmaxabs( (xr), (xi) ); \
|
||||
double mag = sqrt( s ) * \
|
||||
sqrt( ( (xr) / s ) * (xr) + \
|
||||
( (xi) / s ) * (xi) ); \
|
||||
double mag; \
|
||||
if ( s == 0.0 ) mag = 0.0; \
|
||||
else \
|
||||
{ \
|
||||
mag = sqrt( s ) * \
|
||||
sqrt( ( (xr) / s ) * (xr) + \
|
||||
( (xi) / s ) * (xi) ); \
|
||||
} \
|
||||
\
|
||||
(ar) = sqrt( ( mag + (xr) ) / 2.0 ); \
|
||||
(ai) = sqrt( ( mag - (xi) ) / 2.0 ); \
|
||||
|
||||
@@ -149,7 +149,9 @@ void PASTEMAC(opname,_check) \
|
||||
}
|
||||
|
||||
GENFRONT( randv )
|
||||
GENFRONT( randnv )
|
||||
GENFRONT( randm )
|
||||
GENFRONT( randnm )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
@@ -295,6 +297,9 @@ void bli_utilv_norm_check
|
||||
e_val = bli_check_nonconstant_object( norm );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_object_real_proj_of( x, norm );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
// Check object dimensions.
|
||||
|
||||
e_val = bli_check_vector_object( x );
|
||||
@@ -332,6 +337,9 @@ void bli_utilm_norm_check
|
||||
e_val = bli_check_nonconstant_object( norm );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_object_real_proj_of( x, norm );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
// Check object dimensions.
|
||||
|
||||
e_val = bli_check_matrix_object( x );
|
||||
|
||||
@@ -127,7 +127,9 @@ void PASTEMAC(opname,_check) \
|
||||
);
|
||||
|
||||
GENPROT( randv )
|
||||
GENPROT( randnv )
|
||||
GENPROT( randm )
|
||||
GENPROT( randnm )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
|
||||
@@ -424,6 +424,7 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
}
|
||||
|
||||
GENFRONT( randv )
|
||||
GENFRONT( randnv )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
@@ -465,6 +466,7 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
}
|
||||
|
||||
GENFRONT( randm )
|
||||
GENFRONT( randnm )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
|
||||
@@ -150,6 +150,7 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
);
|
||||
|
||||
GENPROT( randv )
|
||||
GENPROT( randnv )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
@@ -162,6 +163,7 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
);
|
||||
|
||||
GENPROT( randm )
|
||||
GENPROT( randnm )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
|
||||
@@ -341,6 +341,7 @@ void PASTEMAC(ch,opname) \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0( randv )
|
||||
INSERT_GENTFUNC_BASIC0( randnv )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
@@ -381,6 +382,7 @@ void PASTEMAC(ch,opname) \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0( randm )
|
||||
INSERT_GENTFUNC_BASIC0( randnm )
|
||||
|
||||
|
||||
#undef GENTFUNCR
|
||||
|
||||
@@ -159,6 +159,7 @@ void PASTEMAC(ch,opname) \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC( randv )
|
||||
INSERT_GENTPROT_BASIC( randnv )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
@@ -175,6 +176,7 @@ void PASTEMAC(ch,opname) \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC( randm )
|
||||
INSERT_GENTPROT_BASIC( randnm )
|
||||
|
||||
|
||||
#undef GENTPROTR
|
||||
|
||||
@@ -842,7 +842,7 @@ INSERT_GENTFUNC_BASIC0_I( fprintm )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, varname ) \
|
||||
#define GENTFUNC( ctype, ch, varname, randmac ) \
|
||||
\
|
||||
void PASTEMAC(ch,varname) \
|
||||
( \
|
||||
@@ -858,17 +858,18 @@ void PASTEMAC(ch,varname) \
|
||||
\
|
||||
for ( i = 0; i < n; ++i ) \
|
||||
{ \
|
||||
PASTEMAC(ch,rands)( *chi1 ); \
|
||||
PASTEMAC(ch,randmac)( *chi1 ); \
|
||||
\
|
||||
chi1 += incx; \
|
||||
} \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0( randv_unb_var1 )
|
||||
INSERT_GENTFUNC_BASIC( randv_unb_var1, rands )
|
||||
INSERT_GENTFUNC_BASIC( randnv_unb_var1, randnp2s )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, varname ) \
|
||||
#define GENTFUNC( ctype, ch, varname, kername ) \
|
||||
\
|
||||
void PASTEMAC(ch,varname) \
|
||||
( \
|
||||
@@ -913,7 +914,7 @@ void PASTEMAC(ch,varname) \
|
||||
\
|
||||
x1 = x + (j )*ldx + (0 )*incx; \
|
||||
\
|
||||
PASTEMAC(ch,randv) \
|
||||
PASTEMAC(ch,kername) \
|
||||
( \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
@@ -939,7 +940,7 @@ void PASTEMAC(ch,varname) \
|
||||
x0 = x1; \
|
||||
chi1 = x1 + (n_elem-1)*incx; \
|
||||
\
|
||||
PASTEMAC(ch,randv) \
|
||||
PASTEMAC(ch,kername) \
|
||||
( \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
@@ -947,10 +948,13 @@ void PASTEMAC(ch,varname) \
|
||||
); \
|
||||
\
|
||||
/* We want positive diagonal elements between 1 and 2. */ \
|
||||
/*
|
||||
PASTEMAC(ch,abval2s)( *chi1, *chi1 ); \
|
||||
PASTEMAC(ch,adds)( *one, *chi1 ); \
|
||||
*/ \
|
||||
\
|
||||
/* Scale the super-diagonal elements by 1/max(m,n). */ \
|
||||
/*
|
||||
PASTEMAC(ch,scalv) \
|
||||
( \
|
||||
BLIS_NO_CONJUGATE, \
|
||||
@@ -959,6 +963,7 @@ void PASTEMAC(ch,varname) \
|
||||
x0, incx, \
|
||||
cntx \
|
||||
); \
|
||||
*/ \
|
||||
} \
|
||||
} \
|
||||
else if ( bli_is_lower( uplox_eff ) ) \
|
||||
@@ -972,7 +977,7 @@ void PASTEMAC(ch,varname) \
|
||||
x2 = x1 + incx; \
|
||||
chi1 = x1; \
|
||||
\
|
||||
PASTEMAC(ch,randv) \
|
||||
PASTEMAC(ch,kername) \
|
||||
( \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
@@ -980,10 +985,13 @@ void PASTEMAC(ch,varname) \
|
||||
); \
|
||||
\
|
||||
/* We want positive diagonal elements between 1 and 2. */ \
|
||||
/*
|
||||
PASTEMAC(ch,abval2s)( *chi1, *chi1 ); \
|
||||
PASTEMAC(ch,adds)( *one, *chi1 ); \
|
||||
*/ \
|
||||
\
|
||||
/* Scale the sub-diagonal elements by 1/max(m,n). */ \
|
||||
/*
|
||||
PASTEMAC(ch,scalv) \
|
||||
( \
|
||||
BLIS_NO_CONJUGATE, \
|
||||
@@ -992,12 +1000,14 @@ void PASTEMAC(ch,varname) \
|
||||
x2, incx, \
|
||||
cntx \
|
||||
); \
|
||||
*/ \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0( randm_unb_var1 )
|
||||
INSERT_GENTFUNC_BASIC( randm_unb_var1, randv )
|
||||
INSERT_GENTFUNC_BASIC( randnm_unb_var1, randnv )
|
||||
|
||||
|
||||
#undef GENTFUNCR
|
||||
|
||||
@@ -161,6 +161,7 @@ void PASTEMAC(ch,varname) \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC( randv_unb_var1 )
|
||||
INSERT_GENTPROT_BASIC( randnv_unb_var1 )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
@@ -177,6 +178,7 @@ void PASTEMAC(ch,varname) \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC( randm_unb_var1 )
|
||||
INSERT_GENTPROT_BASIC( randnm_unb_var1 )
|
||||
|
||||
|
||||
#undef GENTPROTR
|
||||
|
||||
@@ -18,6 +18,9 @@ c # Vector storage scheme(s) to test:
|
||||
0 # Test all combinations of storage schemes?
|
||||
1 # Perform all tests with alignment?
|
||||
# '0' = do NOT align buffers/ldims; '1' = align buffers/ldims
|
||||
0 # Randomize vectors and matrices using:
|
||||
# '0' = real values on [-1,1];
|
||||
# '1' = powers of 2 in narrow precision range
|
||||
32 # General stride spacing (for cases when testing general stride)
|
||||
sdcz # Datatype(s) to test:
|
||||
# 's' = single real; 'c' = single complex;
|
||||
|
||||
@@ -46,32 +46,49 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_addm_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_addm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_addm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_addm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_addm_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_addm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_addm_check( obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid );
|
||||
void libblis_test_addm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_addm_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_addm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_setm( params, &(op->ops->setm) );
|
||||
libblis_test_normfm( params, &(op->ops->normfm) );
|
||||
@@ -79,7 +96,11 @@ void libblis_test_addm_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_addm( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_addm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -108,15 +129,18 @@ void libblis_test_addm( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_addm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_addm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
double time_min = 1e9;
|
||||
double time;
|
||||
@@ -172,7 +196,7 @@ void libblis_test_addm_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_addm_check( &alpha, &beta, &x, &y, resid );
|
||||
libblis_test_addm_check( params, &alpha, &beta, &x, &y, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -184,9 +208,12 @@ void libblis_test_addm_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_addm_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_addm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -201,11 +228,15 @@ void libblis_test_addm_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_addm_check( obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid )
|
||||
void libblis_test_addm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_addm( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_addm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,31 +46,48 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_addv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_addv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_addv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_addv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_addv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_addv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_addv_check( obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid );
|
||||
void libblis_test_addv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
void libblis_test_addv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_addv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_setv( params, &(op->ops->setv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -78,7 +95,11 @@ void libblis_test_addv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_addv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_addv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -107,15 +128,18 @@ void libblis_test_addv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_addv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_addv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
double time_min = 1e9;
|
||||
double time;
|
||||
@@ -168,7 +192,7 @@ void libblis_test_addv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_addv_check( &alpha, &beta, &x, &y, resid );
|
||||
libblis_test_addv_check( params, &alpha, &beta, &x, &y, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -180,9 +204,12 @@ void libblis_test_addv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_addv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_addv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -197,11 +224,15 @@ void libblis_test_addv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_addv_check( obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid )
|
||||
void libblis_test_addv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *x );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *x );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_addv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_addv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,35 +46,52 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_axpbyv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_axpbyv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_axpbyv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_axpbyv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_axpbyv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y );
|
||||
void libblis_test_axpbyv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_axpbyv_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid );
|
||||
void libblis_test_axpbyv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpbyv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpbyv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -89,7 +106,11 @@ void libblis_test_axpbyv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpbyv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpbyv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -118,15 +139,18 @@ void libblis_test_axpbyv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpbyv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_axpbyv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -168,8 +192,8 @@ void libblis_test_axpbyv_experiment( test_params_t* params,
|
||||
bli_setsc( -1.0, 0.0, &beta );
|
||||
|
||||
// Randomize x and y, and save y.
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_vobj_randomize( params, FALSE, &x );
|
||||
libblis_test_vobj_randomize( params, FALSE, &y );
|
||||
bli_copyv( &y, &y_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -192,7 +216,7 @@ void libblis_test_axpbyv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 14.0 / 3.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_axpbyv_check( &alpha, &x, &beta, &y, &y_save, resid );
|
||||
libblis_test_axpbyv_check( params, &alpha, &x, &beta, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -205,11 +229,14 @@ void libblis_test_axpbyv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpbyv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y )
|
||||
void libblis_test_axpbyv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -224,12 +251,16 @@ void libblis_test_axpbyv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpbyv_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_axpbyv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_axpbyv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_axpbyv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,38 +46,55 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_axpy2v_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_axpy2v_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_axpy2v_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_axpy2v_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_axpy2v_impl( iface_t iface,
|
||||
obj_t* alpha1,
|
||||
obj_t* alpha2,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
cntx_t* cntx );
|
||||
void libblis_test_axpy2v_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha1,
|
||||
obj_t* alpha2,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
cntx_t* cntx
|
||||
);
|
||||
|
||||
void libblis_test_axpy2v_check( obj_t* alpha1,
|
||||
obj_t* alpha2,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
obj_t* z_orig,
|
||||
double* resid );
|
||||
void libblis_test_axpy2v_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha1,
|
||||
obj_t* alpha2,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
obj_t* z_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpy2v_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpy2v_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -89,7 +106,11 @@ void libblis_test_axpy2v_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpy2v( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpy2v
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -118,15 +139,18 @@ void libblis_test_axpy2v( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpy2v_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_axpy2v_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -176,9 +200,9 @@ void libblis_test_axpy2v_experiment( test_params_t* params,
|
||||
}
|
||||
|
||||
// Randomize x and y, and save y.
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
bli_randv( &z );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &y );
|
||||
libblis_test_vobj_randomize( params, TRUE, &z );
|
||||
bli_copyv( &z, &z_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -204,7 +228,7 @@ void libblis_test_axpy2v_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( z ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_axpy2v_check( &alpha1, &alpha2, &x, &y, &z, &z_save, resid );
|
||||
libblis_test_axpy2v_check( params, &alpha1, &alpha2, &x, &y, &z, &z_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &z, perf, resid );
|
||||
@@ -221,13 +245,16 @@ void libblis_test_axpy2v_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpy2v_impl( iface_t iface,
|
||||
obj_t* alpha1,
|
||||
obj_t* alpha2,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
cntx_t* cntx )
|
||||
void libblis_test_axpy2v_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha1,
|
||||
obj_t* alpha2,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -242,13 +269,17 @@ void libblis_test_axpy2v_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpy2v_check( obj_t* alpha1,
|
||||
obj_t* alpha2,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
obj_t* z_orig,
|
||||
double* resid )
|
||||
void libblis_test_axpy2v_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha1,
|
||||
obj_t* alpha2,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
obj_t* z_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *z );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *z );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_axpy2v( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_axpy2v
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,36 +46,53 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_axpyf_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_axpyf_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_axpyf_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_axpyf_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_axpyf_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
cntx_t* cntx );
|
||||
void libblis_test_axpyf_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
cntx_t* cntx
|
||||
);
|
||||
|
||||
void libblis_test_axpyf_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid );
|
||||
void libblis_test_axpyf_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyf_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpyf_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -87,7 +104,11 @@ void libblis_test_axpyf_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyf( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpyf
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -116,15 +137,18 @@ void libblis_test_axpyf( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyf_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_axpyf_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -179,9 +203,9 @@ void libblis_test_axpyf_experiment( test_params_t* params,
|
||||
}
|
||||
|
||||
// Randomize A, x, and y, and save y.
|
||||
bli_randm( &a );
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_mobj_randomize( params, FALSE, &a );
|
||||
libblis_test_vobj_randomize( params, FALSE, &x );
|
||||
libblis_test_vobj_randomize( params, FALSE, &y );
|
||||
bli_copyv( &y, &y_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -207,7 +231,7 @@ void libblis_test_axpyf_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_axpyf_check( &alpha, &a, &x, &y, &y_save, resid );
|
||||
libblis_test_axpyf_check( params, &alpha, &a, &x, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -224,12 +248,15 @@ void libblis_test_axpyf_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyf_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
cntx_t* cntx )
|
||||
void libblis_test_axpyf_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -244,12 +271,16 @@ void libblis_test_axpyf_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyf_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_axpyf_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_axpyf( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_axpyf
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,33 +46,50 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_axpym_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_axpym_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_axpym_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_axpym_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_axpym_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_axpym_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_axpym_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_save,
|
||||
double* resid );
|
||||
void libblis_test_axpym_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_save,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpym_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpym_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
libblis_test_normfm( params, &(op->ops->normfm) );
|
||||
@@ -84,7 +101,11 @@ void libblis_test_axpym_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpym( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpym
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -113,15 +134,18 @@ void libblis_test_axpym( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpym_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_axpym_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -162,8 +186,8 @@ void libblis_test_axpym_experiment( test_params_t* params,
|
||||
bli_setsc( 0.0, -2.0, &alpha );
|
||||
|
||||
// Randomize and save y.
|
||||
bli_randm( &x );
|
||||
bli_randm( &y );
|
||||
libblis_test_mobj_randomize( params, FALSE, &x );
|
||||
libblis_test_mobj_randomize( params, FALSE, &y );
|
||||
bli_copym( &y, &y_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -186,7 +210,7 @@ void libblis_test_axpym_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_axpym_check( &alpha, &x, &y, &y_save, resid );
|
||||
libblis_test_axpym_check( params, &alpha, &x, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -199,10 +223,13 @@ void libblis_test_axpym_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpym_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_axpym_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -217,11 +244,15 @@ void libblis_test_axpym_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpym_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_axpym_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_axpym( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_axpym
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,33 +46,50 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_axpyv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_axpyv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_axpyv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_axpyv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_axpyv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_axpyv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_axpyv_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid );
|
||||
void libblis_test_axpyv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpyv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -84,7 +101,11 @@ void libblis_test_axpyv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_axpyv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -113,15 +134,18 @@ void libblis_test_axpyv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_axpyv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -160,8 +184,8 @@ void libblis_test_axpyv_experiment( test_params_t* params,
|
||||
bli_setsc( 0.0, -2.0, &alpha );
|
||||
|
||||
// Randomize x and y, and save y.
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_vobj_randomize( params, FALSE, &x );
|
||||
libblis_test_vobj_randomize( params, FALSE, &y );
|
||||
bli_copyv( &y, &y_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -184,7 +208,7 @@ void libblis_test_axpyv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_axpyv_check( &alpha, &x, &y, &y_save, resid );
|
||||
libblis_test_axpyv_check( params, &alpha, &x, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -197,10 +221,13 @@ void libblis_test_axpyv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_axpyv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -215,11 +242,15 @@ void libblis_test_axpyv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_axpyv_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_axpyv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_axpyv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_axpyv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,30 +46,47 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_copym_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_copym_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_copym_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_copym_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_copym_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_copym_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_copym_check( obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid );
|
||||
void libblis_test_copym_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_copym_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_copym_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
libblis_test_subm( params, &(op->ops->subm) );
|
||||
@@ -78,7 +95,11 @@ void libblis_test_copym_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_copym( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_copym
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -107,15 +128,18 @@ void libblis_test_copym( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_copym_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_copym_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
double time_min = 1e9;
|
||||
double time;
|
||||
@@ -141,7 +165,7 @@ void libblis_test_copym_experiment( test_params_t* params,
|
||||
sc_str[1], m, n, &y );
|
||||
|
||||
// Randomize x and set y to one.
|
||||
bli_randm( &x );
|
||||
libblis_test_mobj_randomize( params, FALSE, &x );
|
||||
bli_setm( &BLIS_ONE, &y );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -162,7 +186,7 @@ void libblis_test_copym_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_copym_check( &x, &y, resid );
|
||||
libblis_test_copym_check( params, &x, &y, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -174,9 +198,12 @@ void libblis_test_copym_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_copym_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_copym_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -191,9 +218,13 @@ void libblis_test_copym_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_copym_check( obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid )
|
||||
void libblis_test_copym_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *x );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_copym( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_copym
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,30 +46,47 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_copyv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_copyv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_copyv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_copyv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_copyv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_copyv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_copyv_check( obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid );
|
||||
void libblis_test_copyv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_copyv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_copyv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_subv( params, &(op->ops->subv) );
|
||||
@@ -78,7 +95,11 @@ void libblis_test_copyv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_copyv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_copyv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -107,15 +128,18 @@ void libblis_test_copyv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_copyv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_copyv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
double time_min = 1e9;
|
||||
double time;
|
||||
@@ -138,7 +162,7 @@ void libblis_test_copyv_experiment( test_params_t* params,
|
||||
libblis_test_vobj_create( params, datatype, sc_str[1], m, &y );
|
||||
|
||||
// Randomize x and set y to one.
|
||||
bli_randv( &x );
|
||||
libblis_test_vobj_randomize( params, FALSE, &x );
|
||||
bli_setv( &BLIS_ONE, &y );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -159,7 +183,7 @@ void libblis_test_copyv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_copyv_check( &x, &y, resid );
|
||||
libblis_test_copyv_check( params, &x, &y, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -171,9 +195,12 @@ void libblis_test_copyv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_copyv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_copyv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -188,9 +215,13 @@ void libblis_test_copyv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_copyv_check( obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid )
|
||||
void libblis_test_copyv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *x );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_copyv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_copyv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,40 +46,57 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_dotaxpyv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_dotaxpyv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_dotaxpyv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_dotaxpyv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_dotaxpyv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* xt,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
obj_t* z,
|
||||
cntx_t* cntx );
|
||||
void libblis_test_dotaxpyv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* xt,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
obj_t* z,
|
||||
cntx_t* cntx
|
||||
);
|
||||
|
||||
void libblis_test_dotaxpyv_check( obj_t* alpha,
|
||||
obj_t* xt,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
obj_t* z,
|
||||
obj_t* z_orig,
|
||||
double* resid );
|
||||
void libblis_test_dotaxpyv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* xt,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
obj_t* z,
|
||||
obj_t* z_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotaxpyv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotaxpyv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -91,7 +108,11 @@ void libblis_test_dotaxpyv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotaxpyv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotaxpyv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -120,15 +141,18 @@ void libblis_test_dotaxpyv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotaxpyv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_dotaxpyv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -178,8 +202,8 @@ void libblis_test_dotaxpyv_experiment( test_params_t* params,
|
||||
}
|
||||
|
||||
// Randomize x and z, and save z.
|
||||
bli_randv( &x );
|
||||
bli_randv( &z );
|
||||
libblis_test_vobj_randomize( params, FALSE, &x );
|
||||
libblis_test_vobj_randomize( params, FALSE, &z );
|
||||
bli_copyv( &z, &z_save );
|
||||
|
||||
// Create an alias to x for xt. (Note that it doesn't actually need to be
|
||||
@@ -224,7 +248,7 @@ void libblis_test_dotaxpyv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( z ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_dotaxpyv_check( &alpha, &xt, &x, &y, &rho, &z, &z_save, resid );
|
||||
libblis_test_dotaxpyv_check( params, &alpha, &xt, &x, &y, &rho, &z, &z_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &z, perf, resid );
|
||||
@@ -241,14 +265,17 @@ void libblis_test_dotaxpyv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotaxpyv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* xt,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
obj_t* z,
|
||||
cntx_t* cntx )
|
||||
void libblis_test_dotaxpyv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* xt,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
obj_t* z,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -263,14 +290,18 @@ void libblis_test_dotaxpyv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotaxpyv_check( obj_t* alpha,
|
||||
obj_t* xt,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
obj_t* z,
|
||||
obj_t* z_orig,
|
||||
double* resid )
|
||||
void libblis_test_dotaxpyv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* xt,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
obj_t* z,
|
||||
obj_t* z_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *z );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *z );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_dotaxpyv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_dotaxpyv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,32 +46,49 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_dotv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_dotv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_dotv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_dotv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_dotv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho );
|
||||
void libblis_test_dotv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho
|
||||
);
|
||||
|
||||
void libblis_test_dotv_check( obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
double* resid );
|
||||
void libblis_test_dotv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -80,7 +97,11 @@ void libblis_test_dotv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -109,15 +130,18 @@ void libblis_test_dotv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_dotv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -147,7 +171,7 @@ void libblis_test_dotv_experiment( test_params_t* params,
|
||||
libblis_test_vobj_create( params, datatype, sc_str[1], m, &y );
|
||||
|
||||
// Randomize x.
|
||||
bli_randv( &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
|
||||
// Determine whether to make a copy of x with or without conjugation.
|
||||
//
|
||||
@@ -183,7 +207,7 @@ void libblis_test_dotv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_dotv_check( &x, &y, &rho, resid );
|
||||
libblis_test_dotv_check( params, &x, &y, &rho, resid );
|
||||
|
||||
// Zero out performance and residual if output scalar is empty.
|
||||
libblis_test_check_empty_problem( &rho, perf, resid );
|
||||
@@ -195,10 +219,13 @@ void libblis_test_dotv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho )
|
||||
void libblis_test_dotv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -213,10 +240,14 @@ void libblis_test_dotv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotv_check( obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
double* resid )
|
||||
void libblis_test_dotv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* rho,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_dotv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_dotv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,45 +46,62 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_dotxaxpyf_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_dotxaxpyf_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_dotxaxpyf_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_dotxaxpyf_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_dotxaxpyf_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* at,
|
||||
obj_t* a,
|
||||
obj_t* w,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
cntx_t* cntx );
|
||||
void libblis_test_dotxaxpyf_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* at,
|
||||
obj_t* a,
|
||||
obj_t* w,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
cntx_t* cntx
|
||||
);
|
||||
|
||||
void libblis_test_dotxaxpyf_check( obj_t* alpha,
|
||||
obj_t* at,
|
||||
obj_t* a,
|
||||
obj_t* w,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
obj_t* y_orig,
|
||||
obj_t* z_orig,
|
||||
double* resid );
|
||||
void libblis_test_dotxaxpyf_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* at,
|
||||
obj_t* a,
|
||||
obj_t* w,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
obj_t* y_orig,
|
||||
obj_t* z_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxaxpyf_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotxaxpyf_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -97,7 +114,11 @@ void libblis_test_dotxaxpyf_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxaxpyf( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotxaxpyf
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -126,15 +147,18 @@ void libblis_test_dotxaxpyf( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxaxpyf_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_dotxaxpyf_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -197,11 +221,11 @@ void libblis_test_dotxaxpyf_experiment( test_params_t* params,
|
||||
}
|
||||
|
||||
// Randomize A, w, x, y, and z, and save y and z.
|
||||
bli_randm( &a );
|
||||
bli_randv( &w );
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
bli_randv( &z );
|
||||
libblis_test_mobj_randomize( params, FALSE, &a );
|
||||
libblis_test_vobj_randomize( params, FALSE, &w );
|
||||
libblis_test_vobj_randomize( params, FALSE, &x );
|
||||
libblis_test_vobj_randomize( params, FALSE, &y );
|
||||
libblis_test_vobj_randomize( params, FALSE, &z );
|
||||
bli_copyv( &y, &y_save );
|
||||
bli_copyv( &z, &z_save );
|
||||
|
||||
@@ -236,7 +260,7 @@ void libblis_test_dotxaxpyf_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_dotxaxpyf_check( &alpha, &at, &a, &w, &x, &beta, &y, &z, &y_save, &z_save, resid );
|
||||
libblis_test_dotxaxpyf_check( params, &alpha, &at, &a, &w, &x, &beta, &y, &z, &y_save, &z_save, resid );
|
||||
|
||||
// Zero out performance and residual if either output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -257,16 +281,19 @@ void libblis_test_dotxaxpyf_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxaxpyf_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* at,
|
||||
obj_t* a,
|
||||
obj_t* w,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
cntx_t* cntx )
|
||||
void libblis_test_dotxaxpyf_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* at,
|
||||
obj_t* a,
|
||||
obj_t* w,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -281,17 +308,21 @@ void libblis_test_dotxaxpyf_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxaxpyf_check( obj_t* alpha,
|
||||
obj_t* at,
|
||||
obj_t* a,
|
||||
obj_t* w,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
obj_t* y_orig,
|
||||
obj_t* z_orig,
|
||||
double* resid )
|
||||
void libblis_test_dotxaxpyf_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* at,
|
||||
obj_t* a,
|
||||
obj_t* w,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* z,
|
||||
obj_t* y_orig,
|
||||
obj_t* z_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_dotxaxpyf( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_dotxaxpyf
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,38 +46,55 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_dotxf_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_dotxf_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_dotxf_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_dotxf_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_dotxf_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
cntx_t* cntx );
|
||||
void libblis_test_dotxf_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
cntx_t* cntx
|
||||
);
|
||||
|
||||
void libblis_test_dotxf_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid );
|
||||
void libblis_test_dotxf_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxf_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotxf_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -89,7 +106,11 @@ void libblis_test_dotxf_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxf( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotxf
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -118,15 +139,18 @@ void libblis_test_dotxf( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxf_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_dotxf_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -184,9 +208,9 @@ void libblis_test_dotxf_experiment( test_params_t* params,
|
||||
}
|
||||
|
||||
// Randomize A, x, and y, and save y.
|
||||
bli_randm( &a );
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_mobj_randomize( params, FALSE, &a );
|
||||
libblis_test_vobj_randomize( params, FALSE, &x );
|
||||
libblis_test_vobj_randomize( params, FALSE, &y );
|
||||
bli_copyv( &y, &y_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -212,7 +236,7 @@ void libblis_test_dotxf_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_dotxf_check( &alpha, &a, &x, &beta, &y, &y_save, resid );
|
||||
libblis_test_dotxf_check( params, &alpha, &a, &x, &beta, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -229,13 +253,16 @@ void libblis_test_dotxf_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxf_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
cntx_t* cntx )
|
||||
void libblis_test_dotxf_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -250,13 +277,17 @@ void libblis_test_dotxf_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxf_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_dotxf_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_dotxf( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_dotxf
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,37 +46,54 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_dotxv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_dotxv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_dotxv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_dotxv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_dotxv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* beta,
|
||||
obj_t* rho );
|
||||
void libblis_test_dotxv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* beta,
|
||||
obj_t* rho
|
||||
);
|
||||
|
||||
void libblis_test_dotxv_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* beta,
|
||||
obj_t* rho,
|
||||
obj_t* rho_orig,
|
||||
double* resid );
|
||||
void libblis_test_dotxv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* beta,
|
||||
obj_t* rho,
|
||||
obj_t* rho_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotxv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -85,7 +102,11 @@ void libblis_test_dotxv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_dotxv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -114,15 +135,18 @@ void libblis_test_dotxv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_dotxv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -156,13 +180,13 @@ void libblis_test_dotxv_experiment( test_params_t* params,
|
||||
libblis_test_vobj_create( params, datatype, sc_str[1], m, &y );
|
||||
|
||||
// Initialize alpha, beta, and rho.
|
||||
bli_copysc( &BLIS_TWO, &alpha );
|
||||
bli_copysc( &BLIS_ONE, &alpha );
|
||||
bli_copysc( &BLIS_ZERO, &beta );
|
||||
bli_copysc( &BLIS_MINUS_ONE, &rho );
|
||||
bli_copysc( &rho, &rho_save );
|
||||
|
||||
// Randomize x.
|
||||
bli_randv( &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
|
||||
// Determine whether to make a copy of x with or without conjugation.
|
||||
//
|
||||
@@ -198,7 +222,7 @@ void libblis_test_dotxv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_dotxv_check( &alpha, &x, &y, &beta, &rho, &rho_save, resid );
|
||||
libblis_test_dotxv_check( params, &alpha, &x, &y, &beta, &rho, &rho_save, resid );
|
||||
|
||||
// Zero out performance and residual if output scalar is empty.
|
||||
libblis_test_check_empty_problem( &rho, perf, resid );
|
||||
@@ -210,12 +234,15 @@ void libblis_test_dotxv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* beta,
|
||||
obj_t* rho )
|
||||
void libblis_test_dotxv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* beta,
|
||||
obj_t* rho
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -230,13 +257,17 @@ void libblis_test_dotxv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_dotxv_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* beta,
|
||||
obj_t* rho,
|
||||
obj_t* rho_orig,
|
||||
double* resid )
|
||||
void libblis_test_dotxv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* beta,
|
||||
obj_t* rho,
|
||||
obj_t* rho_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_dotxv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_dotxv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,37 +46,54 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_gemm_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_gemm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_gemm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_gemm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_gemm_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c );
|
||||
void libblis_test_gemm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
);
|
||||
|
||||
void libblis_test_gemm_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid );
|
||||
void libblis_test_gemm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_gemm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -91,7 +108,11 @@ void libblis_test_gemm_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_gemm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -120,15 +141,18 @@ void libblis_test_gemm( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_gemm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -141,7 +165,6 @@ void libblis_test_gemm_experiment( test_params_t* params,
|
||||
trans_t transa;
|
||||
trans_t transb;
|
||||
|
||||
obj_t kappa;
|
||||
obj_t alpha, a, b, beta, c;
|
||||
obj_t c_save;
|
||||
|
||||
@@ -156,7 +179,6 @@ void libblis_test_gemm_experiment( test_params_t* params,
|
||||
bli_param_map_char_to_blis_trans( pc_str[1], &transb );
|
||||
|
||||
// Create test scalars.
|
||||
bli_obj_scalar_init_detached( datatype, &kappa );
|
||||
bli_obj_scalar_init_detached( datatype, &alpha );
|
||||
bli_obj_scalar_init_detached( datatype, &beta );
|
||||
|
||||
@@ -183,16 +205,11 @@ void libblis_test_gemm_experiment( test_params_t* params,
|
||||
}
|
||||
|
||||
// Randomize A, B, and C, and save C.
|
||||
bli_randm( &a );
|
||||
bli_randm( &b );
|
||||
bli_randm( &c );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &b );
|
||||
libblis_test_mobj_randomize( params, TRUE, &c );
|
||||
bli_copym( &c, &c_save );
|
||||
|
||||
// Normalize by k.
|
||||
bli_setsc( 1.0/( double )k, 0.0, &kappa );
|
||||
bli_scalm( &kappa, &a );
|
||||
bli_scalm( &kappa, &b );
|
||||
|
||||
// Apply the parameters.
|
||||
bli_obj_set_conjtrans( transa, a );
|
||||
bli_obj_set_conjtrans( transb, b );
|
||||
@@ -214,7 +231,7 @@ void libblis_test_gemm_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( c ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_gemm_check( &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
libblis_test_gemm_check( params, &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &c, perf, resid );
|
||||
@@ -228,12 +245,15 @@ void libblis_test_gemm_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
void libblis_test_gemm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -250,13 +270,17 @@ void libblis_test_gemm_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid )
|
||||
void libblis_test_gemm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *c );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *c );
|
||||
@@ -265,7 +289,7 @@ void libblis_test_gemm_check( obj_t* alpha,
|
||||
dim_t n = bli_obj_width( *c );
|
||||
dim_t k = bli_obj_width_after_trans( *a );
|
||||
|
||||
obj_t kappa, norm;
|
||||
obj_t norm;
|
||||
obj_t t, v, w, z;
|
||||
|
||||
double junk;
|
||||
@@ -296,7 +320,6 @@ void libblis_test_gemm_check( obj_t* alpha,
|
||||
// = beta * C_orig * t + z
|
||||
//
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
|
||||
bli_obj_create( dt, n, 1, 0, 0, &t );
|
||||
@@ -304,9 +327,7 @@ void libblis_test_gemm_check( obj_t* alpha,
|
||||
bli_obj_create( dt, k, 1, 0, 0, &w );
|
||||
bli_obj_create( dt, m, 1, 0, 0, &z );
|
||||
|
||||
bli_randv( &t );
|
||||
bli_setsc( 1.0/( double )n, 0.0, &kappa );
|
||||
bli_scalv( &kappa, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_gemv( &BLIS_ONE, c, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_gemm( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_gemm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,38 +46,55 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_gemm_ukr_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_gemm_ukr_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_gemm_ukr_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_gemm_ukr_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_gemm_ukr_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
cntx_t* cntx );
|
||||
void libblis_test_gemm_ukr_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
cntx_t* cntx
|
||||
);
|
||||
|
||||
void libblis_test_gemm_ukr_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid );
|
||||
void libblis_test_gemm_ukr_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm_ukr_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_gemm_ukr_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -92,7 +109,11 @@ void libblis_test_gemm_ukr_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm_ukr( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_gemm_ukr
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -121,15 +142,18 @@ void libblis_test_gemm_ukr( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm_ukr_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_gemm_ukr_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -142,7 +166,6 @@ void libblis_test_gemm_ukr_experiment( test_params_t* params,
|
||||
char sc_a = 'c';
|
||||
char sc_b = 'r';
|
||||
|
||||
obj_t kappa;
|
||||
obj_t alpha, a, b, beta, c;
|
||||
obj_t ap, bp;
|
||||
obj_t c_save;
|
||||
@@ -165,7 +188,6 @@ void libblis_test_gemm_ukr_experiment( test_params_t* params,
|
||||
op->dim_aux[1] = n;
|
||||
|
||||
// Create test scalars.
|
||||
bli_obj_scalar_init_detached( datatype, &kappa );
|
||||
bli_obj_scalar_init_detached( datatype, &alpha );
|
||||
bli_obj_scalar_init_detached( datatype, &beta );
|
||||
|
||||
@@ -189,20 +211,15 @@ void libblis_test_gemm_ukr_experiment( test_params_t* params,
|
||||
else
|
||||
{
|
||||
bli_setsc( 1.2, 0.8, &alpha );
|
||||
bli_setsc( -1.0, 1.0, &beta );
|
||||
bli_setsc( -1.0, 0.5, &beta );
|
||||
}
|
||||
|
||||
// Randomize A, B, and C, and save C.
|
||||
bli_randm( &a );
|
||||
bli_randm( &b );
|
||||
bli_randm( &c );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &b );
|
||||
libblis_test_mobj_randomize( params, TRUE, &c );
|
||||
bli_copym( &c, &c_save );
|
||||
|
||||
// Normalize by k.
|
||||
bli_setsc( 1.0/( double )k, 0.0, &kappa );
|
||||
bli_scalm( &kappa, &a );
|
||||
bli_scalm( &kappa, &b );
|
||||
|
||||
// Initialize pack objects.
|
||||
bli_obj_init_pack( &ap );
|
||||
bli_obj_init_pack( &bp );
|
||||
@@ -247,7 +264,7 @@ void libblis_test_gemm_ukr_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( c ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_gemm_ukr_check( &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
libblis_test_gemm_ukr_check( params, &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &c, perf, resid );
|
||||
@@ -268,13 +285,16 @@ void libblis_test_gemm_ukr_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm_ukr_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
cntx_t* cntx )
|
||||
void libblis_test_gemm_ukr_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -289,13 +309,17 @@ void libblis_test_gemm_ukr_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemm_ukr_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid )
|
||||
void libblis_test_gemm_ukr_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *c );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *c );
|
||||
@@ -304,7 +328,7 @@ void libblis_test_gemm_ukr_check( obj_t* alpha,
|
||||
dim_t n = bli_obj_width( *c );
|
||||
dim_t k = bli_obj_width( *a );
|
||||
|
||||
obj_t kappa, norm;
|
||||
obj_t norm;
|
||||
obj_t t, v, w, z;
|
||||
|
||||
double junk;
|
||||
@@ -335,7 +359,6 @@ void libblis_test_gemm_ukr_check( obj_t* alpha,
|
||||
// = beta * C_orig * t + z
|
||||
//
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
|
||||
bli_obj_create( dt, n, 1, 0, 0, &t );
|
||||
@@ -343,9 +366,7 @@ void libblis_test_gemm_ukr_check( obj_t* alpha,
|
||||
bli_obj_create( dt, k, 1, 0, 0, &w );
|
||||
bli_obj_create( dt, m, 1, 0, 0, &z );
|
||||
|
||||
bli_randv( &t );
|
||||
bli_setsc( 1.0/( double )n, 0.0, &kappa );
|
||||
bli_scalv( &kappa, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_gemv( &BLIS_ONE, c, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_gemm_ukr( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_gemm_ukr
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,49 +46,69 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_gemmtrsm_ukr_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_gemmtrsm_ukr_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_gemmtrsm_ukr_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_gemmtrsm_ukr_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_gemmtrsm_ukr_impl( iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11,
|
||||
obj_t* c11,
|
||||
cntx_t* cntx );
|
||||
void libblis_test_gemmtrsm_ukr_impl
|
||||
(
|
||||
iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11,
|
||||
obj_t* c11,
|
||||
cntx_t* cntx
|
||||
);
|
||||
|
||||
void libblis_test_gemmtrsm_ukr_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11,
|
||||
obj_t* c11,
|
||||
obj_t* c11_save,
|
||||
double* resid );
|
||||
void libblis_test_gemmtrsm_ukr_check
|
||||
(
|
||||
test_params_t* params,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11,
|
||||
obj_t* c11,
|
||||
obj_t* c11_save,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void bli_gemmtrsm_ukr_make_subparts( dim_t k,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11 );
|
||||
void bli_gemmtrsm_ukr_make_subparts
|
||||
(
|
||||
dim_t k,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11
|
||||
);
|
||||
|
||||
|
||||
void libblis_test_gemmtrsm_ukr_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_gemmtrsm_ukr_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -104,7 +124,11 @@ void libblis_test_gemmtrsm_ukr_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemmtrsm_ukr( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_gemmtrsm_ukr
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -137,15 +161,18 @@ extern blksz_t* gemm_mr;
|
||||
extern blksz_t* gemm_nr;
|
||||
extern blksz_t* gemm_kr;
|
||||
|
||||
void libblis_test_gemmtrsm_ukr_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_gemmtrsm_ukr_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -161,7 +188,6 @@ void libblis_test_gemmtrsm_ukr_experiment( test_params_t* params,
|
||||
side_t side = BLIS_LEFT;
|
||||
uplo_t uploa;
|
||||
|
||||
obj_t kappa;
|
||||
obj_t alpha;
|
||||
obj_t a_big, a, b;
|
||||
obj_t b11, c11;
|
||||
@@ -190,7 +216,6 @@ void libblis_test_gemmtrsm_ukr_experiment( test_params_t* params,
|
||||
bli_param_map_char_to_blis_uplo( pc_str[0], &uploa );
|
||||
|
||||
// Create test scalars.
|
||||
bli_obj_scalar_init_detached( datatype, &kappa );
|
||||
bli_obj_scalar_init_detached( datatype, &alpha );
|
||||
|
||||
// Create test operands (vectors and/or matrices).
|
||||
@@ -218,12 +243,11 @@ void libblis_test_gemmtrsm_ukr_experiment( test_params_t* params,
|
||||
bli_obj_set_uplo( uploa, a_big );
|
||||
|
||||
// Randomize A and make it densely triangular.
|
||||
bli_randm( &a_big );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a_big );
|
||||
libblis_test_mobj_load_diag( params, &a_big );
|
||||
|
||||
// Normalize B and save.
|
||||
bli_randm( &b );
|
||||
bli_setsc( 1.0/( double )m, 0.0, &kappa );
|
||||
bli_scalm( &kappa, &b );
|
||||
libblis_test_mobj_randomize( params, TRUE, &b );
|
||||
|
||||
// Use the last m rows of A_big as A.
|
||||
bli_acquire_mpart_t2b( BLIS_SUBPART1, k, m, &a_big, &a );
|
||||
@@ -301,7 +325,7 @@ void libblis_test_gemmtrsm_ukr_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( b ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_gemmtrsm_ukr_check( side, &alpha,
|
||||
libblis_test_gemmtrsm_ukr_check( params, side, &alpha,
|
||||
&a1xp, &a11p, &bx1p, &b11p, &c11, &c11_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
@@ -323,15 +347,18 @@ void libblis_test_gemmtrsm_ukr_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemmtrsm_ukr_impl( iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11,
|
||||
obj_t* c11,
|
||||
cntx_t* cntx )
|
||||
void libblis_test_gemmtrsm_ukr_impl
|
||||
(
|
||||
iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11,
|
||||
obj_t* c11,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -346,15 +373,19 @@ void libblis_test_gemmtrsm_ukr_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemmtrsm_ukr_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11,
|
||||
obj_t* c11,
|
||||
obj_t* c11_orig,
|
||||
double* resid )
|
||||
void libblis_test_gemmtrsm_ukr_check
|
||||
(
|
||||
test_params_t* params,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11,
|
||||
obj_t* c11,
|
||||
obj_t* c11_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *b11 );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *b11 );
|
||||
@@ -363,7 +394,7 @@ void libblis_test_gemmtrsm_ukr_check( side_t side,
|
||||
dim_t n = bli_obj_width( *b11 );
|
||||
dim_t k = bli_obj_width( *a1x );
|
||||
|
||||
obj_t kappa, norm;
|
||||
obj_t norm;
|
||||
obj_t t, v, w, z;
|
||||
|
||||
double junk;
|
||||
@@ -391,7 +422,6 @@ void libblis_test_gemmtrsm_ukr_check( side_t side,
|
||||
// = inv(A11) * ( alpha * B11_orig * t - A1x * w )
|
||||
//
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
|
||||
if ( bli_is_left( side ) )
|
||||
@@ -407,9 +437,7 @@ void libblis_test_gemmtrsm_ukr_check( side_t side,
|
||||
bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED );
|
||||
}
|
||||
|
||||
bli_randv( &t );
|
||||
bli_setsc( 1.0/( double )n, 0.0, &kappa );
|
||||
bli_scalv( &kappa, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_gemv( &BLIS_ONE, b11, &t, &BLIS_ZERO, &v );
|
||||
|
||||
@@ -442,13 +470,16 @@ void libblis_test_gemmtrsm_ukr_check( side_t side,
|
||||
|
||||
|
||||
|
||||
void bli_gemmtrsm_ukr_make_subparts( dim_t k,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11 )
|
||||
void bli_gemmtrsm_ukr_make_subparts
|
||||
(
|
||||
dim_t k,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* a1x,
|
||||
obj_t* a11,
|
||||
obj_t* bx1,
|
||||
obj_t* b11
|
||||
)
|
||||
{
|
||||
dim_t mr = bli_obj_length( *a );
|
||||
dim_t nr = bli_obj_width( *b );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_gemmtrsm_ukr( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_gemmtrsm_ukr
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,38 +46,55 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_gemv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_gemv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_gemv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_gemv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_gemv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y );
|
||||
void libblis_test_gemv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_gemv_check( obj_t* kappa,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid );
|
||||
void libblis_test_gemv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* kappa,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_gemv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -88,7 +105,11 @@ void libblis_test_gemv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_gemv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -117,15 +138,18 @@ void libblis_test_gemv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_gemv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -184,8 +208,8 @@ void libblis_test_gemv_experiment( test_params_t* params,
|
||||
bli_setd( &kappa, &a );
|
||||
|
||||
// Randomize x and y, and save y.
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &y );
|
||||
bli_copyv( &y, &y_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -209,7 +233,7 @@ void libblis_test_gemv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_gemv_check( &kappa, &alpha, &a, &x, &beta, &y, &y_save, resid );
|
||||
libblis_test_gemv_check( params, &kappa, &alpha, &a, &x, &beta, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -223,12 +247,15 @@ void libblis_test_gemv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y )
|
||||
void libblis_test_gemv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -243,14 +270,18 @@ void libblis_test_gemv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_gemv_check( obj_t* kappa,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_gemv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* kappa,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_gemv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_gemv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,35 +46,52 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_ger_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_ger_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_ger_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_ger_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_ger_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a );
|
||||
void libblis_test_ger_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a
|
||||
);
|
||||
|
||||
void libblis_test_ger_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid );
|
||||
void libblis_test_ger_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_ger_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_ger_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -86,7 +103,11 @@ void libblis_test_ger_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_ger( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_ger
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -115,15 +136,18 @@ void libblis_test_ger( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_ger_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_ger_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -167,8 +191,8 @@ void libblis_test_ger_experiment( test_params_t* params,
|
||||
bli_setsc( -1.0, 1.0, &alpha );
|
||||
|
||||
// Randomize x and y.
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &y );
|
||||
|
||||
// Initialize A to identity and save.
|
||||
bli_setm( &BLIS_ZERO, &a );
|
||||
@@ -196,7 +220,7 @@ void libblis_test_ger_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( a ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_ger_check( &alpha, &x, &y, &a, &a_save, resid );
|
||||
libblis_test_ger_check( params, &alpha, &x, &y, &a, &a_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &a, perf, resid );
|
||||
@@ -210,11 +234,14 @@ void libblis_test_ger_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_ger_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a )
|
||||
void libblis_test_ger_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -229,12 +256,16 @@ void libblis_test_ger_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_ger_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid )
|
||||
void libblis_test_ger_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *a );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *a );
|
||||
@@ -243,7 +274,7 @@ void libblis_test_ger_check( obj_t* alpha,
|
||||
dim_t n_a = bli_obj_width( *a );
|
||||
|
||||
obj_t t, v, w;
|
||||
obj_t tau, rho, norm;
|
||||
obj_t rho, norm;
|
||||
|
||||
double junk;
|
||||
|
||||
@@ -273,7 +304,6 @@ void libblis_test_ger_check( obj_t* alpha,
|
||||
// = A_orig * t + w
|
||||
//
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &tau );
|
||||
bli_obj_scalar_init_detached( dt, &rho );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
|
||||
@@ -281,8 +311,7 @@ void libblis_test_ger_check( obj_t* alpha,
|
||||
bli_obj_create( dt, m_a, 1, 0, 0, &v );
|
||||
bli_obj_create( dt, m_a, 1, 0, 0, &w );
|
||||
|
||||
bli_setsc( 1.0/( double )n_a, -1.0/( double )n_a, &tau );
|
||||
bli_setv( &tau, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_gemv( &BLIS_ONE, a, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_ger( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_ger
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,39 +46,56 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_hemm_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_hemm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_hemm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_hemm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_hemm_impl( iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c );
|
||||
void libblis_test_hemm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
);
|
||||
|
||||
void libblis_test_hemm_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid );
|
||||
void libblis_test_hemm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemm_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_hemm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -94,7 +111,11 @@ void libblis_test_hemm_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemm( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_hemm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -123,15 +144,18 @@ void libblis_test_hemm( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_hemm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -147,7 +171,6 @@ void libblis_test_hemm_experiment( test_params_t* params,
|
||||
conj_t conja;
|
||||
trans_t transb;
|
||||
|
||||
obj_t kappa;
|
||||
obj_t alpha, a, b, beta, c;
|
||||
obj_t c_save;
|
||||
|
||||
@@ -163,7 +186,6 @@ void libblis_test_hemm_experiment( test_params_t* params,
|
||||
bli_param_map_char_to_blis_trans( pc_str[3], &transb );
|
||||
|
||||
// Create test scalars.
|
||||
bli_obj_scalar_init_detached( datatype, &kappa );
|
||||
bli_obj_scalar_init_detached( datatype, &alpha );
|
||||
bli_obj_scalar_init_detached( datatype, &beta );
|
||||
|
||||
@@ -196,19 +218,15 @@ void libblis_test_hemm_experiment( test_params_t* params,
|
||||
|
||||
// Randomize A, make it densely Hermitian, and zero the unstored triangle
|
||||
// to ensure the implementation reads only from the stored region.
|
||||
bli_randm( &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
bli_mkherm( &a );
|
||||
bli_mktrim( &a );
|
||||
|
||||
// Randomize B and C, and save C.
|
||||
bli_randm( &b );
|
||||
bli_randm( &c );
|
||||
libblis_test_mobj_randomize( params, TRUE, &b );
|
||||
libblis_test_mobj_randomize( params, TRUE, &c );
|
||||
bli_copym( &c, &c_save );
|
||||
|
||||
// Normalize by m.
|
||||
bli_setsc( 1.0/( double )m, 0.0, &kappa );
|
||||
bli_scalm( &kappa, &b );
|
||||
|
||||
// Apply the remaining parameters.
|
||||
bli_obj_set_conj( conja, a );
|
||||
bli_obj_set_conjtrans( transb, b );
|
||||
@@ -230,7 +248,7 @@ void libblis_test_hemm_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( c ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_hemm_check( side, &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
libblis_test_hemm_check( params, side, &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &c, perf, resid );
|
||||
@@ -244,13 +262,16 @@ void libblis_test_hemm_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemm_impl( iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
void libblis_test_hemm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -267,14 +288,18 @@ void libblis_test_hemm_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemm_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid )
|
||||
void libblis_test_hemm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *c );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *c );
|
||||
@@ -282,7 +307,7 @@ void libblis_test_hemm_check( side_t side,
|
||||
dim_t m = bli_obj_length( *c );
|
||||
dim_t n = bli_obj_width( *c );
|
||||
|
||||
obj_t kappa, norm;
|
||||
obj_t norm;
|
||||
obj_t t, v, w, z;
|
||||
|
||||
double junk;
|
||||
@@ -319,7 +344,6 @@ void libblis_test_hemm_check( side_t side,
|
||||
// = beta * C_orig * t + alpha * transb(B) * w
|
||||
// = beta * C_orig * t + z
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
|
||||
if ( bli_is_left( side ) )
|
||||
@@ -337,9 +361,7 @@ void libblis_test_hemm_check( side_t side,
|
||||
bli_obj_create( dt, m, 1, 0, 0, &z );
|
||||
}
|
||||
|
||||
bli_randv( &t );
|
||||
bli_setsc( 1.0/( double )n, 0.0, &kappa );
|
||||
bli_scalv( &kappa, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_gemv( &BLIS_ONE, c, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_hemm( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_hemm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,37 +46,54 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_hemv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_hemv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_hemv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_hemv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_hemv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y );
|
||||
void libblis_test_hemv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_hemv_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid );
|
||||
void libblis_test_hemv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_hemv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -89,7 +106,11 @@ void libblis_test_hemv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_hemv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -118,15 +139,18 @@ void libblis_test_hemv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_hemv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -140,7 +164,6 @@ void libblis_test_hemv_experiment( test_params_t* params,
|
||||
conj_t conja;
|
||||
conj_t conjx;
|
||||
|
||||
obj_t kappa;
|
||||
obj_t alpha, a, x, beta, y;
|
||||
obj_t y_save;
|
||||
|
||||
@@ -156,7 +179,6 @@ void libblis_test_hemv_experiment( test_params_t* params,
|
||||
// Create test scalars.
|
||||
bli_obj_scalar_init_detached( datatype, &alpha );
|
||||
bli_obj_scalar_init_detached( datatype, &beta );
|
||||
bli_obj_scalar_init_detached( datatype, &kappa );
|
||||
|
||||
// Create test operands (vectors and/or matrices).
|
||||
libblis_test_mobj_create( params, datatype, BLIS_NO_TRANSPOSE,
|
||||
@@ -176,8 +198,8 @@ void libblis_test_hemv_experiment( test_params_t* params,
|
||||
}
|
||||
else
|
||||
{
|
||||
bli_setsc( 0.0, 1.0, &alpha );
|
||||
bli_setsc( 0.0, -1.0, &beta );
|
||||
bli_setsc( 0.5, 0.5, &alpha );
|
||||
bli_setsc( -0.5, 0.5, &beta );
|
||||
}
|
||||
|
||||
// Set the structure and uplo properties of A.
|
||||
@@ -186,21 +208,15 @@ void libblis_test_hemv_experiment( test_params_t* params,
|
||||
|
||||
// Randomize A, make it densely Hermitian, and zero the unstored triangle
|
||||
// to ensure the implementation reads only from the stored region.
|
||||
bli_randm( &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
bli_mkherm( &a );
|
||||
bli_mktrim( &a );
|
||||
|
||||
// Randomize x and y, and save y.
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &y );
|
||||
bli_copyv( &y, &y_save );
|
||||
|
||||
// Normalize vectors by m.
|
||||
bli_setsc( 1.0/( double )m, 0.0, &kappa );
|
||||
bli_scalv( &kappa, &x );
|
||||
bli_scalv( &kappa, &y );
|
||||
bli_scalv( &kappa, &y_save );
|
||||
|
||||
// Apply the remaining parameters.
|
||||
bli_obj_set_conj( conja, a );
|
||||
bli_obj_set_conj( conjx, x );
|
||||
@@ -222,7 +238,7 @@ void libblis_test_hemv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_hemv_check( &alpha, &a, &x, &beta, &y, &y_save, resid );
|
||||
libblis_test_hemv_check( params, &alpha, &a, &x, &beta, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -236,12 +252,15 @@ void libblis_test_hemv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y )
|
||||
void libblis_test_hemv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -256,13 +275,17 @@ void libblis_test_hemv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_hemv_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_hemv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_hemv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_hemv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,33 +46,50 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_her_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_her_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_her_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_her_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_her_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a );
|
||||
void libblis_test_her_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a
|
||||
);
|
||||
|
||||
void libblis_test_her_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid );
|
||||
void libblis_test_her_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_her_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_her_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -86,7 +103,11 @@ void libblis_test_her_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_her( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_her
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -115,15 +136,18 @@ void libblis_test_her( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_her_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_her_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -163,7 +187,7 @@ void libblis_test_her_experiment( test_params_t* params,
|
||||
bli_setsc( -1.0, 0.0, &alpha );
|
||||
|
||||
// Randomize x.
|
||||
bli_randv( &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
|
||||
// Set the structure and uplo properties of A.
|
||||
bli_obj_set_struc( BLIS_HERMITIAN, a );
|
||||
@@ -171,7 +195,7 @@ void libblis_test_her_experiment( test_params_t* params,
|
||||
|
||||
// Randomize A, make it densely Hermitian, and zero the unstored triangle
|
||||
// to ensure the implementation is reads only from the stored region.
|
||||
bli_randm( &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
bli_mkherm( &a );
|
||||
bli_mktrim( &a );
|
||||
|
||||
@@ -200,7 +224,7 @@ void libblis_test_her_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( a ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_her_check( &alpha, &x, &a, &a_save, resid );
|
||||
libblis_test_her_check( params, &alpha, &x, &a, &a_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &a, perf, resid );
|
||||
@@ -213,10 +237,13 @@ void libblis_test_her_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_her_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a )
|
||||
void libblis_test_her_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -231,11 +258,15 @@ void libblis_test_her_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_her_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid )
|
||||
void libblis_test_her_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *a );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *a );
|
||||
@@ -243,7 +274,7 @@ void libblis_test_her_check( obj_t* alpha,
|
||||
dim_t m_a = bli_obj_length( *a );
|
||||
|
||||
obj_t xh, t, v, w;
|
||||
obj_t tau, rho, norm;
|
||||
obj_t rho, norm;
|
||||
|
||||
double junk;
|
||||
|
||||
@@ -278,7 +309,6 @@ void libblis_test_her_check( obj_t* alpha,
|
||||
bli_obj_set_uplo( BLIS_DENSE, *a );
|
||||
bli_obj_set_uplo( BLIS_DENSE, *a_orig );
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &tau );
|
||||
bli_obj_scalar_init_detached( dt, &rho );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
|
||||
@@ -288,8 +318,7 @@ void libblis_test_her_check( obj_t* alpha,
|
||||
|
||||
bli_obj_alias_with_conj( BLIS_CONJUGATE, *x, xh );
|
||||
|
||||
bli_setsc( 1.0/( double )m_a, -1.0/( double )m_a, &tau );
|
||||
bli_setv( &tau, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_gemv( &BLIS_ONE, a, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_her( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_her
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,35 +46,52 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_her2_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_her2_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_her2_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_her2_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_her2_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a );
|
||||
void libblis_test_her2_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a
|
||||
);
|
||||
|
||||
void libblis_test_her2_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid );
|
||||
void libblis_test_her2_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_her2_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -88,7 +105,11 @@ void libblis_test_her2_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_her2
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -117,15 +138,18 @@ void libblis_test_her2( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_her2_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -168,8 +192,8 @@ void libblis_test_her2_experiment( test_params_t* params,
|
||||
bli_setsc( -1.0, 1.0, &alpha );
|
||||
|
||||
// Randomize x and y.
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &y );
|
||||
|
||||
// Set the structure and uplo properties of A.
|
||||
bli_obj_set_struc( BLIS_HERMITIAN, a );
|
||||
@@ -177,7 +201,7 @@ void libblis_test_her2_experiment( test_params_t* params,
|
||||
|
||||
// Randomize A, make it densely Hermitian, and zero the unstored triangle
|
||||
// to ensure the implementation is reads only from the stored region.
|
||||
bli_randm( &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
bli_mkherm( &a );
|
||||
bli_mktrim( &a );
|
||||
|
||||
@@ -207,7 +231,7 @@ void libblis_test_her2_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( a ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_her2_check( &alpha, &x, &y, &a, &a_save, resid );
|
||||
libblis_test_her2_check( params, &alpha, &x, &y, &a, &a_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &a, perf, resid );
|
||||
@@ -221,11 +245,14 @@ void libblis_test_her2_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a )
|
||||
void libblis_test_her2_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -240,12 +267,16 @@ void libblis_test_her2_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid )
|
||||
void libblis_test_her2_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *a );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *a );
|
||||
@@ -254,7 +285,7 @@ void libblis_test_her2_check( obj_t* alpha,
|
||||
|
||||
obj_t xh, yh, alphac;
|
||||
obj_t t, v, w1, w2;
|
||||
obj_t tau, rho, norm;
|
||||
obj_t rho, norm;
|
||||
|
||||
double junk;
|
||||
|
||||
@@ -290,7 +321,6 @@ void libblis_test_her2_check( obj_t* alpha,
|
||||
bli_obj_set_uplo( BLIS_DENSE, *a );
|
||||
bli_obj_set_uplo( BLIS_DENSE, *a_orig );
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &tau );
|
||||
bli_obj_scalar_init_detached( dt, &rho );
|
||||
bli_obj_scalar_init_detached( dt, &alphac );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
@@ -304,8 +334,7 @@ void libblis_test_her2_check( obj_t* alpha,
|
||||
bli_obj_alias_with_conj( BLIS_CONJUGATE, *y, yh );
|
||||
bli_obj_alias_with_conj( BLIS_CONJUGATE, *alpha, alphac );
|
||||
|
||||
bli_setsc( 1.0/( double )m_a, -1.0/( double )m_a, &tau );
|
||||
bli_setv( &tau, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_gemv( &BLIS_ONE, a, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_her2( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_her2
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,37 +46,54 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_her2k_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_her2k_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_her2k_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_her2k_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_her2k_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c );
|
||||
void libblis_test_her2k_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
);
|
||||
|
||||
void libblis_test_her2k_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid );
|
||||
void libblis_test_her2k_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2k_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_her2k_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -92,7 +109,11 @@ void libblis_test_her2k_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2k( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_her2k
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -121,15 +142,18 @@ void libblis_test_her2k( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2k_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_her2k_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -142,7 +166,6 @@ void libblis_test_her2k_experiment( test_params_t* params,
|
||||
uplo_t uploc;
|
||||
trans_t transa, transb;
|
||||
|
||||
obj_t kappa;
|
||||
obj_t alpha, a, b, beta, c;
|
||||
obj_t c_save;
|
||||
|
||||
@@ -157,7 +180,6 @@ void libblis_test_her2k_experiment( test_params_t* params,
|
||||
bli_param_map_char_to_blis_trans( pc_str[2], &transb );
|
||||
|
||||
// Create test scalars.
|
||||
bli_obj_scalar_init_detached( datatype, &kappa );
|
||||
bli_obj_scalar_init_detached( datatype, &alpha );
|
||||
bli_obj_scalar_init_detached( datatype, &beta );
|
||||
|
||||
@@ -186,8 +208,8 @@ void libblis_test_her2k_experiment( test_params_t* params,
|
||||
}
|
||||
|
||||
// Randomize A and B.
|
||||
bli_randm( &a );
|
||||
bli_randm( &b );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &b );
|
||||
|
||||
// Set the structure and uplo properties of C.
|
||||
bli_obj_set_struc( BLIS_HERMITIAN, c );
|
||||
@@ -195,7 +217,7 @@ void libblis_test_her2k_experiment( test_params_t* params,
|
||||
|
||||
// Randomize A, make it densely Hermitian, and zero the unstored triangle
|
||||
// to ensure the implementation is reads only from the stored region.
|
||||
bli_randm( &c );
|
||||
libblis_test_mobj_randomize( params, TRUE, &c );
|
||||
bli_mkherm( &c );
|
||||
bli_mktrim( &c );
|
||||
|
||||
@@ -204,11 +226,6 @@ void libblis_test_her2k_experiment( test_params_t* params,
|
||||
bli_obj_set_uplo( uploc, c_save );
|
||||
bli_copym( &c, &c_save );
|
||||
|
||||
// Normalize by k.
|
||||
bli_setsc( 1.0/( double )k, 0.0, &kappa );
|
||||
bli_scalm( &kappa, &a );
|
||||
bli_scalm( &kappa, &b );
|
||||
|
||||
// Apply the remaining parameters.
|
||||
bli_obj_set_conjtrans( transa, a );
|
||||
bli_obj_set_conjtrans( transb, b );
|
||||
@@ -230,7 +247,7 @@ void libblis_test_her2k_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( c ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_her2k_check( &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
libblis_test_her2k_check( params, &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &c, perf, resid );
|
||||
@@ -244,12 +261,15 @@ void libblis_test_her2k_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2k_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
void libblis_test_her2k_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -266,13 +286,17 @@ void libblis_test_her2k_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_her2k_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid )
|
||||
void libblis_test_her2k_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *c );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *c );
|
||||
@@ -281,7 +305,7 @@ void libblis_test_her2k_check( obj_t* alpha,
|
||||
dim_t k = bli_obj_width_after_trans( *a );
|
||||
|
||||
obj_t alphac, ah, bh;
|
||||
obj_t kappa, norm;
|
||||
obj_t norm;
|
||||
obj_t t, v, w1, w2, z;
|
||||
|
||||
double junk;
|
||||
@@ -318,7 +342,6 @@ void libblis_test_her2k_check( obj_t* alpha,
|
||||
bli_obj_alias_with_trans( BLIS_CONJ_TRANSPOSE, *a, ah );
|
||||
bli_obj_alias_with_trans( BLIS_CONJ_TRANSPOSE, *b, bh );
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
bli_obj_scalar_init_detached_copy_of( dt, BLIS_CONJUGATE, alpha, &alphac );
|
||||
|
||||
@@ -328,9 +351,7 @@ void libblis_test_her2k_check( obj_t* alpha,
|
||||
bli_obj_create( dt, k, 1, 0, 0, &w2 );
|
||||
bli_obj_create( dt, m, 1, 0, 0, &z );
|
||||
|
||||
bli_randv( &t );
|
||||
bli_setsc( 1.0/( double )m, 0.0, &kappa );
|
||||
bli_scalv( &kappa, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_hemv( &BLIS_ONE, c, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_her2k( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_her2k
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,35 +46,52 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_herk_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_herk_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_herk_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_herk_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_herk_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* beta,
|
||||
obj_t* c );
|
||||
void libblis_test_herk_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
);
|
||||
|
||||
void libblis_test_herk_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid );
|
||||
void libblis_test_herk_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_herk_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_herk_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -90,7 +107,11 @@ void libblis_test_herk_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_herk( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_herk
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -119,15 +140,18 @@ void libblis_test_herk( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_herk_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_herk_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -140,7 +164,6 @@ void libblis_test_herk_experiment( test_params_t* params,
|
||||
uplo_t uploc;
|
||||
trans_t transa;
|
||||
|
||||
obj_t kappa;
|
||||
obj_t alpha, a, beta, c;
|
||||
obj_t c_save;
|
||||
|
||||
@@ -154,7 +177,6 @@ void libblis_test_herk_experiment( test_params_t* params,
|
||||
bli_param_map_char_to_blis_trans( pc_str[1], &transa );
|
||||
|
||||
// Create test scalars.
|
||||
bli_obj_scalar_init_detached( datatype, &kappa );
|
||||
bli_obj_scalar_init_detached( datatype, &alpha );
|
||||
bli_obj_scalar_init_detached( datatype, &beta );
|
||||
|
||||
@@ -181,7 +203,7 @@ void libblis_test_herk_experiment( test_params_t* params,
|
||||
}
|
||||
|
||||
// Randomize A.
|
||||
bli_randm( &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
|
||||
// Set the structure and uplo properties of C.
|
||||
bli_obj_set_struc( BLIS_HERMITIAN, c );
|
||||
@@ -189,7 +211,7 @@ void libblis_test_herk_experiment( test_params_t* params,
|
||||
|
||||
// Randomize A, make it densely Hermitian, and zero the unstored triangle
|
||||
// to ensure the implementation is reads only from the stored region.
|
||||
bli_randm( &c );
|
||||
libblis_test_mobj_randomize( params, TRUE, &c );
|
||||
bli_mkherm( &c );
|
||||
bli_mktrim( &c );
|
||||
|
||||
@@ -198,10 +220,6 @@ void libblis_test_herk_experiment( test_params_t* params,
|
||||
bli_obj_set_uplo( uploc, c_save );
|
||||
bli_copym( &c, &c_save );
|
||||
|
||||
// Normalize by k.
|
||||
bli_setsc( 1.0/( double )k, 0.0, &kappa );
|
||||
bli_scalm( &kappa, &a );
|
||||
|
||||
// Apply the remaining parameters.
|
||||
bli_obj_set_conjtrans( transa, a );
|
||||
|
||||
@@ -222,7 +240,7 @@ void libblis_test_herk_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( c ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_herk_check( &alpha, &a, &beta, &c, &c_save, resid );
|
||||
libblis_test_herk_check( params, &alpha, &a, &beta, &c, &c_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &c, perf, resid );
|
||||
@@ -235,11 +253,14 @@ void libblis_test_herk_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_herk_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
void libblis_test_herk_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -256,12 +277,16 @@ void libblis_test_herk_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_herk_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid )
|
||||
void libblis_test_herk_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *c );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *c );
|
||||
@@ -270,7 +295,7 @@ void libblis_test_herk_check( obj_t* alpha,
|
||||
dim_t k = bli_obj_width_after_trans( *a );
|
||||
|
||||
obj_t ah;
|
||||
obj_t kappa, norm;
|
||||
obj_t norm;
|
||||
obj_t t, v, w, z;
|
||||
|
||||
double junk;
|
||||
@@ -301,7 +326,6 @@ void libblis_test_herk_check( obj_t* alpha,
|
||||
|
||||
bli_obj_alias_with_trans( BLIS_CONJ_TRANSPOSE, *a, ah );
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
|
||||
bli_obj_create( dt, m, 1, 0, 0, &t );
|
||||
@@ -309,9 +333,7 @@ void libblis_test_herk_check( obj_t* alpha,
|
||||
bli_obj_create( dt, k, 1, 0, 0, &w );
|
||||
bli_obj_create( dt, m, 1, 0, 0, &z );
|
||||
|
||||
bli_randv( &t );
|
||||
bli_setsc( 1.0/( double )m, 0.0, &kappa );
|
||||
bli_scalv( &kappa, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_hemv( &BLIS_ONE, c, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_herk( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_herk
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -338,10 +338,21 @@ void libblis_test_read_params_file( char* input_filename, test_params_t* params
|
||||
libblis_test_read_next_line( buffer, input_stream );
|
||||
sscanf( buffer, "%u ", &(params->mix_all_storage) );
|
||||
|
||||
// Read whether to mix all storage combinations.
|
||||
// Read whether to perform all tests with aligned addresses and ldims.
|
||||
libblis_test_read_next_line( buffer, input_stream );
|
||||
sscanf( buffer, "%u ", &(params->alignment) );
|
||||
|
||||
// Read the randomization method.
|
||||
libblis_test_read_next_line( buffer, input_stream );
|
||||
sscanf( buffer, "%u ", &(params->rand_method) );
|
||||
|
||||
if ( params->rand_method != BLIS_TEST_RAND_REAL_VALUES &&
|
||||
params->rand_method != BLIS_TEST_RAND_NARROW_POW2 )
|
||||
{
|
||||
libblis_test_printf_error( "Invalid randomization method (%u) in input file.\n",
|
||||
params->rand_method );
|
||||
}
|
||||
|
||||
// Read the general stride "spacing".
|
||||
libblis_test_read_next_line( buffer, input_stream );
|
||||
sscanf( buffer, "%u ", &(params->gs_spacing) );
|
||||
@@ -921,6 +932,7 @@ void libblis_test_output_params_struct( FILE* os, test_params_t* params )
|
||||
libblis_test_fprintf_c( os, "storage[ vector ] %s\n", params->storage[ BLIS_TEST_VECTOR_OPERAND ] );
|
||||
libblis_test_fprintf_c( os, "mix all storage schemes? %u\n", params->mix_all_storage );
|
||||
libblis_test_fprintf_c( os, "test with aligned memory? %u\n", params->alignment );
|
||||
libblis_test_fprintf_c( os, "randomization method %u\n", params->rand_method );
|
||||
libblis_test_fprintf_c( os, "general stride spacing %u\n", params->gs_spacing );
|
||||
libblis_test_fprintf_c( os, "num datatypes %u\n", params->n_datatypes );
|
||||
libblis_test_fprintf_c( os, "datatype[0] %d (%c)\n", params->datatype[0],
|
||||
@@ -1903,6 +1915,109 @@ void libblis_test_vobj_create( test_params_t* params, num_t dt, char storage, di
|
||||
|
||||
|
||||
|
||||
void libblis_test_vobj_randomize( test_params_t* params, bool_t normalize, obj_t* x )
|
||||
{
|
||||
if ( params->rand_method == BLIS_TEST_RAND_REAL_VALUES )
|
||||
bli_randv( x );
|
||||
else // if ( params->rand_method == BLIS_TEST_RAND_NARROW_POW2 )
|
||||
bli_randnv( x );
|
||||
|
||||
if ( normalize )
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *x );
|
||||
num_t dt_r = bli_obj_datatype_proj_to_real( *x );
|
||||
obj_t kappa;
|
||||
obj_t kappa_r;
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
bli_obj_scalar_init_detached( dt_r, &kappa_r );
|
||||
|
||||
// Normalize vector elements.
|
||||
//bli_setsc( 1.0/( double )bli_obj_vector_dim( *x ), 0.0, &kappa );
|
||||
bli_normfv( x, &kappa_r );
|
||||
libblis_test_ceil_pow2( &kappa_r );
|
||||
bli_copysc( &kappa_r, &kappa );
|
||||
bli_invertsc( &kappa );
|
||||
bli_scalv( &kappa, x );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_mobj_randomize( test_params_t* params, bool_t normalize, obj_t* a )
|
||||
{
|
||||
if ( params->rand_method == BLIS_TEST_RAND_REAL_VALUES )
|
||||
bli_randm( a );
|
||||
else // if ( params->rand_method == BLIS_TEST_RAND_NARROW_POW2 )
|
||||
bli_randnm( a );
|
||||
|
||||
if ( normalize )
|
||||
{
|
||||
#if 0
|
||||
num_t dt = bli_obj_datatype( *a );
|
||||
dim_t max_m_n = bli_obj_max_dim( *a );
|
||||
obj_t kappa;
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
|
||||
// Normalize vector elements by maximum matrix dimension.
|
||||
bli_setsc( 1.0/( double )max_m_n, 0.0, &kappa );
|
||||
bli_scalm( &kappa, a );
|
||||
#endif
|
||||
num_t dt = bli_obj_datatype( *a );
|
||||
num_t dt_r = bli_obj_datatype_proj_to_real( *a );
|
||||
obj_t kappa;
|
||||
obj_t kappa_r;
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
bli_obj_scalar_init_detached( dt_r, &kappa_r );
|
||||
|
||||
// Normalize matrix elements.
|
||||
bli_norm1m( a, &kappa_r );
|
||||
libblis_test_ceil_pow2( &kappa_r );
|
||||
bli_copysc( &kappa_r, &kappa );
|
||||
bli_invertsc( &kappa );
|
||||
bli_scalm( &kappa, a );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_ceil_pow2( obj_t* alpha )
|
||||
{
|
||||
double alpha_r;
|
||||
double alpha_i;
|
||||
|
||||
bli_getsc( alpha, &alpha_r, &alpha_i );
|
||||
|
||||
alpha_r = pow( 2.0, ceil( log2( alpha_r ) ) );
|
||||
|
||||
bli_setsc( alpha_r, alpha_i, alpha );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_mobj_load_diag( test_params_t* params, obj_t* a )
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *a );
|
||||
dim_t m = bli_obj_length( *a );
|
||||
dim_t n = bli_obj_width( *a );
|
||||
|
||||
obj_t d;
|
||||
|
||||
// We assume that all elements of a were intialized on interval [-1,1].
|
||||
|
||||
bli_obj_create( dt, m, n, 0, 0, &d );
|
||||
|
||||
// Initialize the diagonal of d to 2.0 and then add the diagonal of a.
|
||||
bli_setd( &BLIS_TWO, &d );
|
||||
bli_addd( &d, a );
|
||||
|
||||
bli_obj_free( &d );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_init_strings( void )
|
||||
{
|
||||
strcpy( libblis_test_pass_string, BLIS_TEST_PASS_STRING );
|
||||
|
||||
@@ -145,6 +145,15 @@ typedef enum
|
||||
} iface_t;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BLIS_TEST_RAND_REAL_VALUES = 0,
|
||||
BLIS_TEST_RAND_NARROW_POW2 = 1,
|
||||
} rand_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -154,6 +163,7 @@ typedef struct
|
||||
char storage[ NUM_OPERAND_TYPES ][ MAX_NUM_MSTORAGE + 1 ];
|
||||
unsigned int mix_all_storage;
|
||||
unsigned int alignment;
|
||||
unsigned int rand_method;
|
||||
unsigned int gs_spacing;
|
||||
unsigned int n_datatypes;
|
||||
char datatype_char[ MAX_NUM_DATATYPES + 1 ];
|
||||
@@ -375,6 +385,13 @@ void libblis_test_mobj_create( test_params_t* params, num_t dt, trans_t trans, c
|
||||
void libblis_test_pobj_create( bszid_t bmult_id_m, bszid_t bmult_id_n, invdiag_t inv_diag, pack_t pack_schema, packbuf_t pack_buf, obj_t* a, obj_t* p, cntx_t* cntx );
|
||||
void libblis_test_vobj_create( test_params_t* params, num_t dt, char storage, dim_t m, obj_t* x );
|
||||
|
||||
// --- Randomize/initialize object ---
|
||||
|
||||
void libblis_test_vobj_randomize( test_params_t* params, bool_t normalize, obj_t* x );
|
||||
void libblis_test_mobj_randomize( test_params_t* params, bool_t normalize, obj_t* a );
|
||||
void libblis_test_mobj_load_diag( test_params_t* params, obj_t* a );
|
||||
void libblis_test_ceil_pow2( obj_t* alpha );
|
||||
|
||||
// --- Global string initialization ---
|
||||
|
||||
void libblis_test_init_strings( void );
|
||||
|
||||
@@ -46,38 +46,59 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_normfm_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_normfm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_normfm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_normfm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_normfm_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* norm );
|
||||
void libblis_test_normfm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* norm
|
||||
);
|
||||
|
||||
void libblis_test_normfm_check( obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* norm,
|
||||
double* resid );
|
||||
void libblis_test_normfm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* norm,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfm_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_normfm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_setm( params, &(op->ops->setm) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfm( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_normfm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -106,15 +127,18 @@ void libblis_test_normfm( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_normfm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -166,7 +190,7 @@ void libblis_test_normfm_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_normfm_check( &beta, &x, &norm, resid );
|
||||
libblis_test_normfm_check( params, &beta, &x, &norm, resid );
|
||||
|
||||
// Zero out performance and residual if input matrix is empty.
|
||||
libblis_test_check_empty_problem( &x, perf, resid );
|
||||
@@ -177,9 +201,12 @@ void libblis_test_normfm_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfm_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* norm )
|
||||
void libblis_test_normfm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* norm
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -194,10 +221,14 @@ void libblis_test_normfm_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfm_check( obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* norm,
|
||||
double* resid )
|
||||
void libblis_test_normfm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* norm,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *x );
|
||||
dim_t m = bli_obj_length( *x );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_normfm( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_normfm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,38 +46,59 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_normfv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_normfv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_normfv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_normfv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_normfv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* norm );
|
||||
void libblis_test_normfv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* norm
|
||||
);
|
||||
|
||||
void libblis_test_normfv_check( obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* norm,
|
||||
double* resid );
|
||||
void libblis_test_normfv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* norm,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_normfv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_setv( params, &(op->ops->setv) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_normfv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -106,15 +127,18 @@ void libblis_test_normfv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_normfv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -164,7 +188,7 @@ void libblis_test_normfv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_normfv_check( &beta, &x, &norm, resid );
|
||||
libblis_test_normfv_check( params, &beta, &x, &norm, resid );
|
||||
|
||||
// Zero out performance and residual if input vector is empty.
|
||||
libblis_test_check_empty_problem( &x, perf, resid );
|
||||
@@ -175,9 +199,12 @@ void libblis_test_normfv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* norm )
|
||||
void libblis_test_normfv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* norm
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -192,10 +219,14 @@ void libblis_test_normfv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_normfv_check( obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* norm,
|
||||
double* resid )
|
||||
void libblis_test_normfv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* norm,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *x );
|
||||
dim_t m = bli_obj_vector_dim( *x );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_normfv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_normfv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,35 +46,56 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_randm_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_randm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_randm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_randm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_randm_impl( iface_t iface,
|
||||
obj_t* x );
|
||||
void libblis_test_randm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x
|
||||
);
|
||||
|
||||
void libblis_test_randm_check( obj_t* x,
|
||||
double* resid );
|
||||
void libblis_test_randm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_randm_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_randm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
// No dependencies.
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_randm( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_randm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -103,15 +124,18 @@ void libblis_test_randm( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_randm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t dt,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_randm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t dt,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -157,7 +181,7 @@ void libblis_test_randm_experiment( test_params_t* params,
|
||||
// really say for sure what is "random" and what is not, so instead we
|
||||
// manually perform some checks that will fail under some scenarios whic
|
||||
// we consider to be likely.
|
||||
libblis_test_randm_check( &x, resid );
|
||||
libblis_test_randm_check( params, &x, resid );
|
||||
|
||||
// Zero out performance and residual if input matrix is empty.
|
||||
libblis_test_check_empty_problem( &x, perf, resid );
|
||||
@@ -168,8 +192,11 @@ void libblis_test_randm_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_randm_impl( iface_t iface,
|
||||
obj_t* x )
|
||||
void libblis_test_randm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -184,8 +211,12 @@ void libblis_test_randm_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_randm_check( obj_t* x,
|
||||
double* resid )
|
||||
void libblis_test_randm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *x );
|
||||
dim_t m_x = bli_obj_length( *x );
|
||||
@@ -236,8 +267,11 @@ typedef void (*FUNCPTR_T)(
|
||||
static FUNCPTR_T GENARRAY(ftypes,absumm);
|
||||
|
||||
|
||||
void bli_absumm( obj_t* x,
|
||||
obj_t* sum_x )
|
||||
void bli_absumm
|
||||
(
|
||||
obj_t* x,
|
||||
obj_t* sum_x
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *x );
|
||||
|
||||
|
||||
@@ -32,11 +32,18 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_randm( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_randm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
void bli_absumm( obj_t* x,
|
||||
obj_t* sum_x );
|
||||
void bli_absumm
|
||||
(
|
||||
obj_t* x,
|
||||
obj_t* sum_x
|
||||
);
|
||||
|
||||
#undef GENTPROTR
|
||||
#define GENTPROTR( ctype, ctype_r, ch, chr, varname ) \
|
||||
|
||||
@@ -46,35 +46,56 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_randv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_randv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_randv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_randv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_randv_impl( iface_t iface,
|
||||
obj_t* x );
|
||||
void libblis_test_randv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x
|
||||
);
|
||||
|
||||
void libblis_test_randv_check( obj_t* x,
|
||||
double* resid );
|
||||
void libblis_test_randv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_randv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_randv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
// No dependencies.
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_randv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_randv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -103,15 +124,18 @@ void libblis_test_randv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_randv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_randv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -157,7 +181,7 @@ void libblis_test_randv_experiment( test_params_t* params,
|
||||
// really say for sure what is "random" and what is not, so instead we
|
||||
// manually perform some checks that will fail under some scenarios whic
|
||||
// we consider to be likely.
|
||||
libblis_test_randv_check( &x, resid );
|
||||
libblis_test_randv_check( params, &x, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &x, perf, resid );
|
||||
@@ -168,8 +192,11 @@ void libblis_test_randv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_randv_impl( iface_t iface,
|
||||
obj_t* x )
|
||||
void libblis_test_randv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -184,8 +211,12 @@ void libblis_test_randv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_randv_check( obj_t* x,
|
||||
double* resid )
|
||||
void libblis_test_randv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* x,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *x );
|
||||
dim_t m_x = bli_obj_vector_dim( *x );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_randv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_randv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,33 +46,50 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_scal2m_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_scal2m_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_scal2m_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_scal2m_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_scal2m_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_scal2m_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_scal2m_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_save,
|
||||
double* resid );
|
||||
void libblis_test_scal2m_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_save,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2m_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_scal2m_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
libblis_test_normfm( params, &(op->ops->normfm) );
|
||||
@@ -83,7 +100,11 @@ void libblis_test_scal2m_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2m( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_scal2m
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -112,15 +133,18 @@ void libblis_test_scal2m( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2m_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_scal2m_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -161,7 +185,7 @@ void libblis_test_scal2m_experiment( test_params_t* params,
|
||||
bli_setsc( 0.0, -2.0, &alpha );
|
||||
|
||||
// Randomize and save y.
|
||||
bli_randm( &x );
|
||||
libblis_test_mobj_randomize( params, FALSE, &x );
|
||||
bli_setm( &BLIS_ONE, &y );
|
||||
bli_copym( &y, &y_save );
|
||||
|
||||
@@ -185,7 +209,7 @@ void libblis_test_scal2m_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_scal2m_check( &alpha, &x, &y, &y_save, resid );
|
||||
libblis_test_scal2m_check( params, &alpha, &x, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -198,10 +222,13 @@ void libblis_test_scal2m_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2m_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_scal2m_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -216,11 +243,15 @@ void libblis_test_scal2m_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2m_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_scal2m_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_scal2m( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_scal2m
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,33 +46,50 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_scal2v_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_scal2v_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_scal2v_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_scal2v_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_scal2v_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_scal2v_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_scal2v_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid );
|
||||
void libblis_test_scal2v_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2v_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_scal2v_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -83,7 +100,11 @@ void libblis_test_scal2v_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2v( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_scal2v
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -112,15 +133,18 @@ void libblis_test_scal2v( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2v_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_scal2v_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -159,8 +183,8 @@ void libblis_test_scal2v_experiment( test_params_t* params,
|
||||
bli_setsc( 0.0, -2.0, &alpha );
|
||||
|
||||
// Randomize x and y, and save y.
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_vobj_randomize( params, FALSE, &x );
|
||||
libblis_test_vobj_randomize( params, FALSE, &y );
|
||||
bli_copyv( &y, &y_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -183,7 +207,7 @@ void libblis_test_scal2v_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_scal2v_check( &alpha, &x, &y, &y_save, resid );
|
||||
libblis_test_scal2v_check( params, &alpha, &x, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -196,10 +220,13 @@ void libblis_test_scal2v_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2v_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_scal2v_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -214,11 +241,15 @@ void libblis_test_scal2v_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_scal2v_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_scal2v_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_scal2v( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_scal2v
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,31 +46,48 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_scalm_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_scalm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_scalm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_scalm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_scalm_impl( iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* y );
|
||||
void libblis_test_scalm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_scalm_check( obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_save,
|
||||
double* resid );
|
||||
void libblis_test_scalm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_save,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalm_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_scalm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
libblis_test_normfm( params, &(op->ops->normfm) );
|
||||
@@ -79,7 +96,11 @@ void libblis_test_scalm_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalm( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_scalm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -108,15 +129,18 @@ void libblis_test_scalm( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_scalm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -156,7 +180,7 @@ void libblis_test_scalm_experiment( test_params_t* params,
|
||||
bli_setsc( 0.0, -2.0, &beta );
|
||||
|
||||
// Randomize and save y.
|
||||
bli_randm( &y );
|
||||
libblis_test_mobj_randomize( params, FALSE, &y );
|
||||
bli_copym( &y, &y_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -179,7 +203,7 @@ void libblis_test_scalm_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 6.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_scalm_check( &beta, &y, &y_save, resid );
|
||||
libblis_test_scalm_check( params, &beta, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -191,9 +215,12 @@ void libblis_test_scalm_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalm_impl( iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* y )
|
||||
void libblis_test_scalm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -208,10 +235,14 @@ void libblis_test_scalm_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalm_check( obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_scalm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_scalm( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_scalm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,31 +46,48 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_scalv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_scalv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_scalv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_scalv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_scalv_impl( iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* y );
|
||||
void libblis_test_scalv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_scalv_check( obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid );
|
||||
void libblis_test_scalv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_scalv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -80,7 +97,11 @@ void libblis_test_scalv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_scalv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -109,15 +130,18 @@ void libblis_test_scalv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_scalv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -153,7 +177,7 @@ void libblis_test_scalv_experiment( test_params_t* params,
|
||||
bli_setsc( 0.0, -2.0, &beta );
|
||||
|
||||
// Randomize and save y.
|
||||
bli_randv( &y );
|
||||
libblis_test_vobj_randomize( params, FALSE, &y );
|
||||
bli_copyv( &y, &y_save );
|
||||
|
||||
// Apply the parameters.
|
||||
@@ -176,7 +200,7 @@ void libblis_test_scalv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 6.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_scalv_check( &beta, &y, &y_save, resid );
|
||||
libblis_test_scalv_check( params, &beta, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -188,9 +212,12 @@ void libblis_test_scalv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalv_impl( iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* y )
|
||||
void libblis_test_scalv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -205,10 +232,14 @@ void libblis_test_scalv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_scalv_check( obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_scalv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_scalv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_scalv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,37 +46,58 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_setm_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_setm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_setm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_setm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_setm_impl( iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* x );
|
||||
void libblis_test_setm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* x
|
||||
);
|
||||
|
||||
void libblis_test_setm_check( obj_t* beta,
|
||||
obj_t* x,
|
||||
double* resid );
|
||||
void libblis_test_setm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_setm_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_setm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randm) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_setm( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_setm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -105,15 +126,18 @@ void libblis_test_setm( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_setm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_setm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -145,7 +169,7 @@ void libblis_test_setm_experiment( test_params_t* params,
|
||||
bli_copysc( &BLIS_ONE, &beta );
|
||||
|
||||
// Randomize x.
|
||||
bli_randm( &x );
|
||||
libblis_test_mobj_randomize( params, FALSE, &x );
|
||||
|
||||
// Repeat the experiment n_repeats times and record results.
|
||||
for ( i = 0; i < n_repeats; ++i )
|
||||
@@ -162,7 +186,7 @@ void libblis_test_setm_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_setm_check( &beta, &x, resid );
|
||||
libblis_test_setm_check( params, &beta, &x, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &x, perf, resid );
|
||||
@@ -173,9 +197,12 @@ void libblis_test_setm_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_setm_impl( iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* x )
|
||||
void libblis_test_setm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* x
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -190,9 +217,13 @@ void libblis_test_setm_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_setm_check( obj_t* beta,
|
||||
obj_t* x,
|
||||
double* resid )
|
||||
void libblis_test_setm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_x = bli_obj_datatype( *x );
|
||||
dim_t m_x = bli_obj_length( *x );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_setm( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_setm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,37 +46,58 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_setv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_setv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_setv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_setv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_setv_impl( iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* x );
|
||||
void libblis_test_setv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* x
|
||||
);
|
||||
|
||||
void libblis_test_setv_check( obj_t* beta,
|
||||
obj_t* x,
|
||||
double* resid );
|
||||
void libblis_test_setv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_setv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_setv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void libblis_test_setv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_setv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -105,15 +126,18 @@ void libblis_test_setv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_setv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_setv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -143,7 +167,7 @@ void libblis_test_setv_experiment( test_params_t* params,
|
||||
bli_copysc( &BLIS_ONE, &beta );
|
||||
|
||||
// Randomize x.
|
||||
bli_randv( &x );
|
||||
libblis_test_vobj_randomize( params, FALSE, &x );
|
||||
|
||||
// Repeat the experiment n_repeats times and record results.
|
||||
for ( i = 0; i < n_repeats; ++i )
|
||||
@@ -160,7 +184,7 @@ void libblis_test_setv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_setv_check( &beta, &x, resid );
|
||||
libblis_test_setv_check( params, &beta, &x, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &x, perf, resid );
|
||||
@@ -171,9 +195,12 @@ void libblis_test_setv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_setv_impl( iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* x )
|
||||
void libblis_test_setv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* beta,
|
||||
obj_t* x
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -188,9 +215,13 @@ void libblis_test_setv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_setv_check( obj_t* beta,
|
||||
obj_t* x,
|
||||
double* resid )
|
||||
void libblis_test_setv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt_x = bli_obj_datatype( *x );
|
||||
dim_t m_x = bli_obj_vector_dim( *x );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_setv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_setv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,32 +46,49 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_subm_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_subm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_subm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_subm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_subm_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_subm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_subm_check( obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid );
|
||||
void libblis_test_subm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_subm_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_subm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_setm( params, &(op->ops->setm) );
|
||||
libblis_test_normfm( params, &(op->ops->normfm) );
|
||||
@@ -79,7 +96,11 @@ void libblis_test_subm_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_subm( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_subm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -108,15 +129,18 @@ void libblis_test_subm( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_subm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_subm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
double time_min = 1e9;
|
||||
double time;
|
||||
@@ -172,7 +196,7 @@ void libblis_test_subm_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_subm_check( &alpha, &beta, &x, &y, resid );
|
||||
libblis_test_subm_check( params, &alpha, &beta, &x, &y, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -184,9 +208,12 @@ void libblis_test_subm_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_subm_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_subm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -201,11 +228,15 @@ void libblis_test_subm_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_subm_check( obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid )
|
||||
void libblis_test_subm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_subm( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_subm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,32 +46,49 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_subv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_subv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_subv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_subv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_subv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y );
|
||||
void libblis_test_subv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_subv_check( obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid );
|
||||
void libblis_test_subv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_subv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_subv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_setv( params, &(op->ops->setv) );
|
||||
libblis_test_normfv( params, &(op->ops->normfv) );
|
||||
@@ -79,7 +96,11 @@ void libblis_test_subv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_subv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_subv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -108,15 +129,18 @@ void libblis_test_subv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_subv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_subv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
double time_min = 1e9;
|
||||
double time;
|
||||
@@ -169,7 +193,7 @@ void libblis_test_subv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( x ) ) *perf *= 2.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_subv_check( &alpha, &beta, &x, &y, resid );
|
||||
libblis_test_subv_check( params, &alpha, &beta, &x, &y, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -181,9 +205,12 @@ void libblis_test_subv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_subv_impl( iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y )
|
||||
void libblis_test_subv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* x,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -198,11 +225,15 @@ void libblis_test_subv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_subv_check( obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid )
|
||||
void libblis_test_subv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* beta,
|
||||
obj_t* x,
|
||||
obj_t* y,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *x );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *x );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_subv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_subv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,39 +46,56 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_symm_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_symm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_symm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_symm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_symm_impl( iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c );
|
||||
void libblis_test_symm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
);
|
||||
|
||||
void libblis_test_symm_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid );
|
||||
void libblis_test_symm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_symm_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_symm_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -94,7 +111,11 @@ void libblis_test_symm_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_symm( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_symm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -123,15 +144,18 @@ void libblis_test_symm( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_symm_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_symm_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -147,7 +171,6 @@ void libblis_test_symm_experiment( test_params_t* params,
|
||||
conj_t conja;
|
||||
trans_t transb;
|
||||
|
||||
obj_t kappa;
|
||||
obj_t alpha, a, b, beta, c;
|
||||
obj_t c_save;
|
||||
|
||||
@@ -163,7 +186,6 @@ void libblis_test_symm_experiment( test_params_t* params,
|
||||
bli_param_map_char_to_blis_trans( pc_str[3], &transb );
|
||||
|
||||
// Create test scalars.
|
||||
bli_obj_scalar_init_detached( datatype, &kappa );
|
||||
bli_obj_scalar_init_detached( datatype, &alpha );
|
||||
bli_obj_scalar_init_detached( datatype, &beta );
|
||||
|
||||
@@ -196,19 +218,15 @@ void libblis_test_symm_experiment( test_params_t* params,
|
||||
|
||||
// Randomize A, make it densely symmetric, and zero the unstored triangle
|
||||
// to ensure the implementation reads only from the stored region.
|
||||
bli_randm( &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
bli_mksymm( &a );
|
||||
bli_mktrim( &a );
|
||||
|
||||
// Randomize B and C, and save C.
|
||||
bli_randm( &b );
|
||||
bli_randm( &c );
|
||||
libblis_test_mobj_randomize( params, TRUE, &b );
|
||||
libblis_test_mobj_randomize( params, TRUE, &c );
|
||||
bli_copym( &c, &c_save );
|
||||
|
||||
// Normalize by m.
|
||||
bli_setsc( 1.0/( double )m, 0.0, &kappa );
|
||||
bli_scalm( &kappa, &b );
|
||||
|
||||
// Apply the remaining parameters.
|
||||
bli_obj_set_conj( conja, a );
|
||||
bli_obj_set_conjtrans( transb, b );
|
||||
@@ -230,7 +248,7 @@ void libblis_test_symm_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( c ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_symm_check( side, &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
libblis_test_symm_check( params, side, &alpha, &a, &b, &beta, &c, &c_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &c, perf, resid );
|
||||
@@ -244,13 +262,16 @@ void libblis_test_symm_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_symm_impl( iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
void libblis_test_symm_impl
|
||||
(
|
||||
iface_t iface,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -267,14 +288,18 @@ void libblis_test_symm_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_symm_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid )
|
||||
void libblis_test_symm_check
|
||||
(
|
||||
test_params_t* params,
|
||||
side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
obj_t* c_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *c );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *c );
|
||||
@@ -282,7 +307,7 @@ void libblis_test_symm_check( side_t side,
|
||||
dim_t m = bli_obj_length( *c );
|
||||
dim_t n = bli_obj_width( *c );
|
||||
|
||||
obj_t kappa, norm;
|
||||
obj_t norm;
|
||||
obj_t t, v, w, z;
|
||||
|
||||
double junk;
|
||||
@@ -319,7 +344,6 @@ void libblis_test_symm_check( side_t side,
|
||||
// = beta * C_orig * t + alpha * transb(B) * w
|
||||
// = beta * C_orig * t + z
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &kappa );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
|
||||
if ( bli_is_left( side ) )
|
||||
@@ -337,9 +361,7 @@ void libblis_test_symm_check( side_t side,
|
||||
bli_obj_create( dt, m, 1, 0, 0, &z );
|
||||
}
|
||||
|
||||
bli_randv( &t );
|
||||
bli_setsc( 1.0/( double )n, 0.0, &kappa );
|
||||
bli_scalv( &kappa, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_gemv( &BLIS_ONE, c, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_symm( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_symm
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,37 +46,54 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_symv_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_symv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_symv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_symv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_symv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y );
|
||||
void libblis_test_symv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
);
|
||||
|
||||
void libblis_test_symv_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid );
|
||||
void libblis_test_symv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_symv_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_symv_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -89,7 +106,11 @@ void libblis_test_symv_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_symv( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_symv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -118,15 +139,18 @@ void libblis_test_symv( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_symv_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_symv_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -140,7 +164,6 @@ void libblis_test_symv_experiment( test_params_t* params,
|
||||
conj_t conja;
|
||||
conj_t conjx;
|
||||
|
||||
obj_t kappa;
|
||||
obj_t alpha, a, x, beta, y;
|
||||
obj_t y_save;
|
||||
|
||||
@@ -156,7 +179,6 @@ void libblis_test_symv_experiment( test_params_t* params,
|
||||
// Create test scalars.
|
||||
bli_obj_scalar_init_detached( datatype, &alpha );
|
||||
bli_obj_scalar_init_detached( datatype, &beta );
|
||||
bli_obj_scalar_init_detached( datatype, &kappa );
|
||||
|
||||
// Create test operands (vectors and/or matrices).
|
||||
libblis_test_mobj_create( params, datatype, BLIS_NO_TRANSPOSE,
|
||||
@@ -176,8 +198,8 @@ void libblis_test_symv_experiment( test_params_t* params,
|
||||
}
|
||||
else
|
||||
{
|
||||
bli_setsc( 0.0, 1.0, &alpha );
|
||||
bli_setsc( 0.0, -1.0, &beta );
|
||||
bli_setsc( 0.5, 0.5, &alpha );
|
||||
bli_setsc( -0.5, 0.5, &beta );
|
||||
}
|
||||
|
||||
// Set the structure and uplo properties of A.
|
||||
@@ -186,21 +208,15 @@ void libblis_test_symv_experiment( test_params_t* params,
|
||||
|
||||
// Randomize A, make it densely symmetric, and zero the unstored triangle
|
||||
// to ensure the implementation reads only from the stored region.
|
||||
bli_randm( &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
bli_mksymm( &a );
|
||||
bli_mktrim( &a );
|
||||
|
||||
// Randomize x and y, and save y.
|
||||
bli_randv( &x );
|
||||
bli_randv( &y );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &y );
|
||||
bli_copyv( &y, &y_save );
|
||||
|
||||
// Normalize vectors by m.
|
||||
bli_setsc( 1.0/( double )m, 0.0, &kappa );
|
||||
bli_scalv( &kappa, &x );
|
||||
bli_scalv( &kappa, &y );
|
||||
bli_scalv( &kappa, &y_save );
|
||||
|
||||
// Apply the remaining parameters.
|
||||
bli_obj_set_conj( conja, a );
|
||||
bli_obj_set_conj( conjx, x );
|
||||
@@ -222,7 +238,7 @@ void libblis_test_symv_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( y ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_symv_check( &alpha, &a, &x, &beta, &y, &y_save, resid );
|
||||
libblis_test_symv_check( params, &alpha, &a, &x, &beta, &y, &y_save, resid );
|
||||
|
||||
// Zero out performance and residual if output vector is empty.
|
||||
libblis_test_check_empty_problem( &y, perf, resid );
|
||||
@@ -236,12 +252,15 @@ void libblis_test_symv_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_symv_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y )
|
||||
void libblis_test_symv_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -256,13 +275,17 @@ void libblis_test_symv_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_symv_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid )
|
||||
void libblis_test_symv_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* x,
|
||||
obj_t* beta,
|
||||
obj_t* y,
|
||||
obj_t* y_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *y );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *y );
|
||||
|
||||
@@ -32,5 +32,9 @@
|
||||
|
||||
*/
|
||||
|
||||
void libblis_test_symv( test_params_t* params, test_op_t* op );
|
||||
void libblis_test_symv
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
|
||||
@@ -46,33 +46,50 @@ static thresh_t thresh[BLIS_NUM_FP_TYPES] = { { 1e-04, 1e-05 }, // warn, pass
|
||||
{ 1e-13, 1e-14 } }; // warn, pass for z
|
||||
|
||||
// Local prototypes.
|
||||
void libblis_test_syr_deps( test_params_t* params,
|
||||
test_op_t* op );
|
||||
void libblis_test_syr_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
);
|
||||
|
||||
void libblis_test_syr_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid );
|
||||
void libblis_test_syr_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
);
|
||||
|
||||
void libblis_test_syr_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a );
|
||||
void libblis_test_syr_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a
|
||||
);
|
||||
|
||||
void libblis_test_syr_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid );
|
||||
void libblis_test_syr_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid
|
||||
);
|
||||
|
||||
|
||||
|
||||
void libblis_test_syr_deps( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_syr_deps
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
libblis_test_randv( params, &(op->ops->randv) );
|
||||
libblis_test_randm( params, &(op->ops->randm) );
|
||||
@@ -86,7 +103,11 @@ void libblis_test_syr_deps( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_syr( test_params_t* params, test_op_t* op )
|
||||
void libblis_test_syr
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op
|
||||
)
|
||||
{
|
||||
|
||||
// Return early if this test has already been done.
|
||||
@@ -115,15 +136,18 @@ void libblis_test_syr( test_params_t* params, test_op_t* op )
|
||||
|
||||
|
||||
|
||||
void libblis_test_syr_experiment( test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid )
|
||||
void libblis_test_syr_experiment
|
||||
(
|
||||
test_params_t* params,
|
||||
test_op_t* op,
|
||||
iface_t iface,
|
||||
num_t datatype,
|
||||
char* pc_str,
|
||||
char* sc_str,
|
||||
unsigned int p_cur,
|
||||
double* perf,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
unsigned int n_repeats = params->n_repeats;
|
||||
unsigned int i;
|
||||
@@ -160,10 +184,10 @@ void libblis_test_syr_experiment( test_params_t* params,
|
||||
|
||||
// Set alpha.
|
||||
//bli_copysc( &BLIS_MINUS_ONE, &alpha );
|
||||
bli_setsc( -1.0, 1.0, &alpha );
|
||||
bli_setsc( -1.0, 0.5, &alpha );
|
||||
|
||||
// Randomize x.
|
||||
bli_randv( &x );
|
||||
libblis_test_vobj_randomize( params, TRUE, &x );
|
||||
|
||||
// Set the structure and uplo properties of A.
|
||||
bli_obj_set_struc( BLIS_SYMMETRIC, a );
|
||||
@@ -171,7 +195,7 @@ void libblis_test_syr_experiment( test_params_t* params,
|
||||
|
||||
// Randomize A, make it densely symmetric, and zero the unstored triangle
|
||||
// to ensure the implementation is reads only from the stored region.
|
||||
bli_randm( &a );
|
||||
libblis_test_mobj_randomize( params, TRUE, &a );
|
||||
bli_mksymm( &a );
|
||||
bli_mktrim( &a );
|
||||
|
||||
@@ -199,7 +223,7 @@ void libblis_test_syr_experiment( test_params_t* params,
|
||||
if ( bli_obj_is_complex( a ) ) *perf *= 4.0;
|
||||
|
||||
// Perform checks.
|
||||
libblis_test_syr_check( &alpha, &x, &a, &a_save, resid );
|
||||
libblis_test_syr_check( params, &alpha, &x, &a, &a_save, resid );
|
||||
|
||||
// Zero out performance and residual if output matrix is empty.
|
||||
libblis_test_check_empty_problem( &a, perf, resid );
|
||||
@@ -212,10 +236,13 @@ void libblis_test_syr_experiment( test_params_t* params,
|
||||
|
||||
|
||||
|
||||
void libblis_test_syr_impl( iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a )
|
||||
void libblis_test_syr_impl
|
||||
(
|
||||
iface_t iface,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a
|
||||
)
|
||||
{
|
||||
switch ( iface )
|
||||
{
|
||||
@@ -230,11 +257,15 @@ void libblis_test_syr_impl( iface_t iface,
|
||||
|
||||
|
||||
|
||||
void libblis_test_syr_check( obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid )
|
||||
void libblis_test_syr_check
|
||||
(
|
||||
test_params_t* params,
|
||||
obj_t* alpha,
|
||||
obj_t* x,
|
||||
obj_t* a,
|
||||
obj_t* a_orig,
|
||||
double* resid
|
||||
)
|
||||
{
|
||||
num_t dt = bli_obj_datatype( *a );
|
||||
num_t dt_real = bli_obj_datatype_proj_to_real( *a );
|
||||
@@ -242,7 +273,7 @@ void libblis_test_syr_check( obj_t* alpha,
|
||||
dim_t m_a = bli_obj_length( *a );
|
||||
|
||||
obj_t xt, t, v, w;
|
||||
obj_t tau, rho, norm;
|
||||
obj_t rho, norm;
|
||||
|
||||
double junk;
|
||||
|
||||
@@ -278,7 +309,6 @@ void libblis_test_syr_check( obj_t* alpha,
|
||||
bli_obj_set_uplo( BLIS_DENSE, *a );
|
||||
bli_obj_set_uplo( BLIS_DENSE, *a_orig );
|
||||
|
||||
bli_obj_scalar_init_detached( dt, &tau );
|
||||
bli_obj_scalar_init_detached( dt, &rho );
|
||||
bli_obj_scalar_init_detached( dt_real, &norm );
|
||||
|
||||
@@ -288,8 +318,7 @@ void libblis_test_syr_check( obj_t* alpha,
|
||||
|
||||
bli_obj_alias_to( *x, xt );
|
||||
|
||||
bli_setsc( 1.0/( double )m_a, -1.0/( double )m_a, &tau );
|
||||
bli_setv( &tau, &t );
|
||||
libblis_test_vobj_randomize( params, TRUE, &t );
|
||||
|
||||
bli_gemv( &BLIS_ONE, a, &t, &BLIS_ZERO, &v );
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user