mirror of
https://github.com/amd/blis.git
synced 2026-05-11 17:50:00 +00:00
Minor changes to treatment of rs, cs in bli_obj.c.
Details:
- Applied a patch submitted by Devin Matthews that:
- implements subtle changes to handling of somewhat unusual cases of
row and column strides to accommodate certail tensor cases, which
includes adding dimension parameters to _is_col_tilted() and
_is_row_tilted() macros,
- simplifies how buffers are sized when requested BLIS-allocated
objects,
- re-consolidates bli_adjust_strides_*() into one function, and
- defines 'restrict' keyword as a "nothing" macro for C++ and pre-C99
environments.
This commit is contained in:
@@ -40,12 +40,16 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
// Language is C++; define restrict as nothing.
|
||||
#ifndef restrict
|
||||
#define restrict
|
||||
#endif
|
||||
#elif __STDC_VERSION__ >= 199901L
|
||||
// Language is C99 (or later); do nothing since restrict is recognized.
|
||||
#else
|
||||
// Language is pre-C99; define restrict as nothing.
|
||||
#ifndef restrict
|
||||
#define restrict
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -378,13 +378,15 @@
|
||||
( bli_abs( rs ) != 1 && \
|
||||
bli_abs( cs ) != 1 )
|
||||
|
||||
#define bli_is_row_tilted( rs, cs ) \
|
||||
#define bli_is_row_tilted( m, n, rs, cs ) \
|
||||
\
|
||||
( bli_abs( cs ) < bli_abs( rs ) )
|
||||
( bli_abs( cs ) == bli_abs( rs ) ? n < m \
|
||||
: bli_abs( cs ) < bli_abs( rs ) )
|
||||
|
||||
#define bli_is_col_tilted( rs, cs ) \
|
||||
#define bli_is_col_tilted( m, n, rs, cs ) \
|
||||
\
|
||||
( bli_abs( rs ) < bli_abs( cs ) )
|
||||
( bli_abs( rs ) == bli_abs( cs ) ? m < n \
|
||||
: bli_abs( rs ) < bli_abs( cs ) )
|
||||
|
||||
#define bli_has_nonunit_inc1( inc1 ) \
|
||||
\
|
||||
@@ -780,7 +782,7 @@
|
||||
uplo_eff = uploa; \
|
||||
diagoff_eff = diagoffa_use; \
|
||||
\
|
||||
if ( bli_is_row_tilted( inca, lda ) ) \
|
||||
if ( bli_is_row_tilted( n_elem_max, n_iter_max, inca, lda ) ) \
|
||||
{ \
|
||||
bli_swap_dims( n_iter_max, n_elem_max ); \
|
||||
bli_swap_incs( inca, lda ); \
|
||||
@@ -967,8 +969,8 @@
|
||||
bli_negate_diag_offset( diagoff_eff ); \
|
||||
} \
|
||||
\
|
||||
if ( bli_is_row_tilted( incb, ldb ) && \
|
||||
bli_is_row_tilted( inca, lda ) ) \
|
||||
if ( bli_is_row_tilted( n_elem_max, n_iter_max, incb, ldb ) && \
|
||||
bli_is_row_tilted( n_elem_max, n_iter_max, inca, lda ) ) \
|
||||
{ \
|
||||
bli_swap_dims( n_iter_max, n_elem_max ); \
|
||||
bli_swap_incs( inca, lda ); \
|
||||
|
||||
Reference in New Issue
Block a user