mirror of
https://github.com/amd/blis.git
synced 2026-05-11 17:50:00 +00:00
Added initial support for imaginary stride.
Details:
- Added an imaginary stride field ("is") to obj_t.
- Renamed bli_obj_set_incs() macro to bli_obj_set_strides().
- Defined bli_obj_imag_stride() and bli_obj_set_imag_stride() and
added invocations in key locations.
- Added some basic error-checking related to imaginary stride.
- For now, imaginary stride will not be exposed into the most-used
BLIS APIs such as bli_obj_create(), and certainly not the
computational APIs such as bli_dgemm().
This commit is contained in:
@@ -602,6 +602,10 @@ bli_obj_width_stored( obj )
|
||||
\
|
||||
((obj).cs)
|
||||
|
||||
#define bli_obj_imag_stride( obj ) \
|
||||
\
|
||||
((obj).is)
|
||||
|
||||
#define bli_obj_row_stride_mag( obj ) \
|
||||
\
|
||||
( bli_abs( bli_obj_row_stride( obj ) ) )
|
||||
@@ -610,6 +614,10 @@ bli_obj_width_stored( obj )
|
||||
\
|
||||
( bli_abs( bli_obj_col_stride( obj ) ) )
|
||||
|
||||
#define bli_obj_imag_stride_mag( obj ) \
|
||||
\
|
||||
( bli_abs( bli_obj_imag_stride( obj ) ) )
|
||||
|
||||
//
|
||||
// NOTE: The following two macros differ from their non-obj counterparts
|
||||
// in that they do not identify m x 1 and 1 x n objects as row-stored and
|
||||
@@ -641,12 +649,17 @@ bli_obj_width_stored( obj )
|
||||
|
||||
// Stride/increment modification
|
||||
|
||||
#define bli_obj_set_incs( row_stride, col_stride, obj ) \
|
||||
#define bli_obj_set_strides( row_stride, col_stride, obj ) \
|
||||
{ \
|
||||
(obj).rs = row_stride; \
|
||||
(obj).cs = col_stride; \
|
||||
}
|
||||
|
||||
#define bli_obj_set_imag_stride( imag_stride, obj ) \
|
||||
{ \
|
||||
(obj).is = imag_stride; \
|
||||
}
|
||||
|
||||
|
||||
// Offset query
|
||||
|
||||
@@ -998,7 +1011,7 @@ bli_obj_width_stored( obj )
|
||||
doff_t diag_off = bli_obj_diag_offset( obj ); \
|
||||
\
|
||||
bli_obj_set_dims( n, m, obj ); \
|
||||
bli_obj_set_incs( cs, rs, obj ); \
|
||||
bli_obj_set_strides( cs, rs, obj ); \
|
||||
bli_obj_set_offs( offn, offm, obj ); \
|
||||
bli_obj_set_diag_offset( -diag_off, obj ); \
|
||||
\
|
||||
|
||||
@@ -581,6 +581,7 @@ typedef struct obj_s
|
||||
void* buffer;
|
||||
inc_t rs;
|
||||
inc_t cs;
|
||||
inc_t is;
|
||||
|
||||
// Bufferless scalar storage
|
||||
atom_t scalar;
|
||||
@@ -615,6 +616,7 @@ typedef struct obj_s
|
||||
(b).buffer = (a).buffer; \
|
||||
(b).rs = (a).rs; \
|
||||
(b).cs = (a).cs; \
|
||||
(b).is = (a).is; \
|
||||
\
|
||||
(b).scalar = (a).scalar; \
|
||||
\
|
||||
@@ -657,6 +659,7 @@ typedef struct obj_s
|
||||
(b).buffer = (a).buffer; \
|
||||
(b).rs = (a).rs; \
|
||||
(b).cs = (a).cs; \
|
||||
(b).is = (a).is; \
|
||||
\
|
||||
(b).scalar = (a).scalar; \
|
||||
\
|
||||
|
||||
Reference in New Issue
Block a user