示例#1
0
void bli_axpy2v_kernel( obj_t*  alpha1,
                        obj_t*  alpha2,
                        obj_t*  x,
                        obj_t*  y,
                        obj_t*  z )
{
	num_t     dt_x      = bli_obj_datatype( *x );
	num_t     dt_y      = bli_obj_datatype( *y );

	conj_t    conjx     = bli_obj_conj_status( *x );
	conj_t    conjy     = bli_obj_conj_status( *y );
	dim_t     n         = bli_obj_vector_dim( *x );

	inc_t     inc_x     = bli_obj_vector_inc( *x );
	void*     buf_x     = bli_obj_buffer_at_off( *x );

	inc_t     inc_y     = bli_obj_vector_inc( *y );
	void*     buf_y     = bli_obj_buffer_at_off( *y );

	inc_t     inc_z     = bli_obj_vector_inc( *z );
	void*     buf_z     = bli_obj_buffer_at_off( *z );

	num_t     dt_alpha1;
	void*     buf_alpha1;

	num_t     dt_alpha2;
	void*     buf_alpha2;

	FUNCPTR_T f;

	// If alpha is a scalar constant, use dt_x to extract the address of the
	// corresponding constant value; otherwise, use the datatype encoded
	// within the alpha object and extract the buffer at the alpha offset.
	bli_set_scalar_dt_buffer( alpha1, dt_x, dt_alpha1, buf_alpha1 );
	bli_set_scalar_dt_buffer( alpha2, dt_x, dt_alpha2, buf_alpha2 );

	// Index into the type combination array to extract the correct
	// function pointer.
	f = ftypes[dt_alpha1][dt_x][dt_y];

	// Invoke the function.
	f( conjx,
	   conjy,
	   n,
	   buf_alpha1,
	   buf_alpha2,
	   buf_x, inc_x,
	   buf_y, inc_y,
	   buf_z, inc_z );
}
示例#2
0
void bli_normfsc_unb_var1( obj_t* chi,
                           obj_t* norm )
{
	num_t     dt_chi;
	num_t     dt_norm_c  = bli_obj_datatype_proj_to_complex( *norm );

	void*     buf_chi;

	void*     buf_norm   = bli_obj_buffer_at_off( *norm );

	FUNCPTR_T f;

	// If chi is a scalar constant, use dt_norm_c to extract the address of the
	// corresponding constant value; otherwise, use the datatype encoded
	// within the chi object and extract the buffer at the chi offset.
	bli_set_scalar_dt_buffer( chi, dt_norm_c, dt_chi, buf_chi );

	// Index into the type combination array to extract the correct
	// function pointer.
	f = ftypes[dt_chi];

	// Invoke the function.
	f( buf_chi,
	   buf_norm );
}
示例#3
0
void bli_copysc_unb_var1( obj_t*  chi,
                          obj_t*  psi )
{

	conj_t    conjchi   = bli_obj_conj_status( *chi );

	num_t     dt_psi    = bli_obj_datatype( *psi );
	void*     buf_psi   = bli_obj_buffer_at_off( *psi );

	num_t     dt_chi;
	void*     buf_chi;

	FUNCPTR_T f;

	// If chi is a scalar constant, use dt_psi to extract the address of the
	// corresponding constant value; otherwise, use the datatype encoded
	// within the chi object and extract the buffer at the chi offset.
	bli_set_scalar_dt_buffer( chi, dt_psi, dt_chi, buf_chi );

//printf( "copysc_unb_var1(): datatypes of chi (%u) and psi (%u)\n", dt_chi, dt_psi );
//return;

	// Index into the type combination array to extract the correct
	// function pointer.
	f = ftypes[dt_chi][dt_psi];

	// Invoke the function.
	f( conjchi,
	   buf_chi,
	   buf_psi );
}
示例#4
0
void bli_unzipsc_unb_var1( obj_t* beta,
                           obj_t* chi_r,
                           obj_t* chi_i )
{
	num_t     dt_beta;
	num_t     dt_chi_c   = bli_obj_datatype_proj_to_complex( *chi_r );

	void*     buf_beta;

	void*     buf_chi_r  = bli_obj_buffer_at_off( *chi_r );
	void*     buf_chi_i  = bli_obj_buffer_at_off( *chi_i );

	FUNCPTR_T f;

	// If beta is a scalar constant, use dt_chi_c to extract the address of the
	// corresponding constant value; otherwise, use the datatype encoded
	// within the beta object and extract the buffer at the beta offset.
	bli_set_scalar_dt_buffer( beta, dt_chi_c, dt_beta, buf_beta );

	// Index into the type combination array to extract the correct
	// function pointer.
	f = ftypes[dt_beta];

	// Invoke the function.
	f( buf_beta,
	   buf_chi_r,
	   buf_chi_i );
}
void bli_trsm_rl_ker_var2( obj_t*  alpha,
                           obj_t*  a,
                           obj_t*  b,
                           obj_t*  beta,
                           obj_t*  c,
                           trsm_t* cntl )
{
	num_t     dt_exec   = bli_obj_execution_datatype( *c );

	doff_t    diagoffb  = bli_obj_diag_offset( *b );

	dim_t     m         = bli_obj_length( *c );
	dim_t     n         = bli_obj_width( *c );
	dim_t     k         = bli_obj_width( *a );

	void*     buf_a     = bli_obj_buffer_at_off( *a );
	inc_t     rs_a      = bli_obj_row_stride( *a );
	inc_t     cs_a      = bli_obj_col_stride( *a );
	inc_t     ps_a      = bli_obj_panel_stride( *a );

	void*     buf_b     = bli_obj_buffer_at_off( *b );
	inc_t     rs_b      = bli_obj_row_stride( *b );
	inc_t     cs_b      = bli_obj_col_stride( *b );
	inc_t     ps_b      = bli_obj_panel_stride( *b );

	void*     buf_c     = bli_obj_buffer_at_off( *c );
	inc_t     rs_c      = bli_obj_row_stride( *c );
	inc_t     cs_c      = bli_obj_col_stride( *c );

	num_t     dt_alpha;
	void*     buf_alpha;

	FUNCPTR_T f;

	// If alpha is a scalar constant, use dt_exec to extract the address of the
	// corresponding constant value; otherwise, use the datatype encoded
	// within the alpha object and extract the buffer at the alpha offset.
	bli_set_scalar_dt_buffer( alpha, dt_exec, dt_alpha, buf_alpha );

	// Index into the type combination array to extract the correct
	// function pointer.
	f = ftypes[dt_exec];

	// Invoke the function.
	f( diagoffb,
	   m,
	   n,
	   k,
	   buf_alpha,
	   buf_a, rs_a, cs_a, ps_a,
	   buf_b, rs_b, cs_b, ps_b,
	   buf_c, rs_c, cs_c );
}
示例#6
0
void bli_axpym_unb_var1( obj_t*  alpha,
                         obj_t*  x,
                         obj_t*  y,
                         cntx_t* cntx )
{
	num_t     dt_x      = bli_obj_datatype( *x );
	num_t     dt_y      = bli_obj_datatype( *y );

	doff_t    diagoffx  = bli_obj_diag_offset( *x );
	diag_t    diagx     = bli_obj_diag( *x );
	uplo_t    uplox     = bli_obj_uplo( *x );
	trans_t   transx    = bli_obj_conjtrans_status( *x );

	dim_t     m         = bli_obj_length( *y );
	dim_t     n         = bli_obj_width( *y );

	inc_t     rs_x      = bli_obj_row_stride( *x );
	inc_t     cs_x      = bli_obj_col_stride( *x );
	void*     buf_x     = bli_obj_buffer_at_off( *x );

	inc_t     rs_y      = bli_obj_row_stride( *y );
	inc_t     cs_y      = bli_obj_col_stride( *y );
	void*     buf_y     = bli_obj_buffer_at_off( *y );

	num_t     dt_alpha;
	void*     buf_alpha;

	FUNCPTR_T f;

	// If alpha is a scalar constant, use dt_x to extract the address of the
	// corresponding constant value; otherwise, use the datatype encoded
	// within the alpha object and extract the buffer at the alpha offset.
	bli_set_scalar_dt_buffer( alpha, dt_x, dt_alpha, buf_alpha );

	// Index into the type combination array to extract the correct
	// function pointer.
	f = ftypes[dt_alpha][dt_x][dt_y];

	// Invoke the function.
	f( diagoffx,
	   diagx,
	   uplox,
	   transx,
	   m,
	   n,
	   buf_alpha,
	   buf_x, rs_x, cs_x,
	   buf_y, rs_y, cs_y );
}
示例#7
0
void bli_scald_unb_var1( obj_t*  beta,
                         obj_t*  x )
{
	num_t     dt_x      = bli_obj_datatype( *x );

	conj_t    conjbeta  = bli_obj_conj_status( *beta );

	doff_t    diagoffx  = bli_obj_diag_offset( *x );

	dim_t     m         = bli_obj_length( *x );
	dim_t     n         = bli_obj_width( *x );

	void*     buf_x     = bli_obj_buffer_at_off( *x );
	inc_t     rs_x      = bli_obj_row_stride( *x );
	inc_t     cs_x      = bli_obj_col_stride( *x );

	void*     buf_beta;
	num_t     dt_beta;

	FUNCPTR_T f;

	// If beta is a scalar constant, use dt_x to extract the address of the
	// corresponding constant value; otherwise, use the datatype encoded
	// within the beta object and extract the buffer at the beta offset.
	bli_set_scalar_dt_buffer( beta, dt_x, dt_beta, buf_beta );

	// Index into the type combination array to extract the correct
	// function pointer.
	f = ftypes[dt_beta][dt_x];

	// Invoke the function.
	f( conjbeta,
	   diagoffx,
	   m,
	   n,
	   buf_beta,
	   buf_x, rs_x, cs_x );
}
示例#8
0
void bli_scal2v_unb_var1( obj_t*  beta,
                          obj_t*  x,
                          obj_t*  y )
{
	num_t     dt_x      = bli_obj_datatype( *x );
	num_t     dt_y      = bli_obj_datatype( *y );

	conj_t    conjx     = bli_obj_conj_status( *x );
	dim_t     n         = bli_obj_vector_dim( *x );

	inc_t     inc_x     = bli_obj_vector_inc( *x );
	void*     buf_x     = bli_obj_buffer_at_off( *x );

	inc_t     inc_y     = bli_obj_vector_inc( *y );
	void*     buf_y     = bli_obj_buffer_at_off( *y );

	num_t     dt_beta;
	void*     buf_beta;

	FUNCPTR_T f;

	// If beta is a scalar constant, use dt_x to extract the address of the
	// corresponding constant value; otherwise, use the datatype encoded
	// within the beta object and extract the buffer at the beta offset.
	bli_set_scalar_dt_buffer( beta, dt_x, dt_beta, buf_beta );

	// Index into the type combination array to extract the correct
	// function pointer.
	f = ftypes[dt_beta][dt_x][dt_y];

	// Invoke the function.
	f( conjx,
	   n,
	   buf_beta,
	   buf_x, inc_x,
	   buf_y, inc_y );
}