diff --git a/frame/include/bli_type_defs.h b/frame/include/bli_type_defs.h index cba112256..566ad5f50 100644 --- a/frame/include/bli_type_defs.h +++ b/frame/include/bli_type_defs.h @@ -150,7 +150,7 @@ typedef uint32_t objbits_t; // object information bit field // interoperability with BLIS. #ifndef _DEFINED_SCOMPLEX #define _DEFINED_SCOMPLEX - typedef struct + typedef struct scomplex { float real; float imag; @@ -161,7 +161,7 @@ typedef uint32_t objbits_t; // object information bit field // interoperability with BLIS. #ifndef _DEFINED_DCOMPLEX #define _DEFINED_DCOMPLEX - typedef struct + typedef struct dcomplex { double real; double imag; @@ -1232,6 +1232,47 @@ typedef struct constdata_s // -- BLIS object type definitions --------------------------------------------- // +// Forward declarations for function pointer types +struct obj_s; +struct cntx_s; +struct rntm_s; +struct thrinfo_s; + +typedef void (*obj_pack_fn_t) + ( + mdim_t mat, + mem_t* mem, + struct obj_s* a, + struct obj_s* ap, + struct cntx_s* cntx, + struct rntm_s* rntm, + struct thrinfo_s* thread + ); + +typedef void (*obj_ker_fn_t) + ( + struct obj_s* a, + struct obj_s* b, + struct obj_s* c, + struct cntx_s* cntx, + struct rntm_s* rntm, + struct thrinfo_s* thread + ); + +typedef void (*obj_ukr_fn_t) + ( + dim_t m, + dim_t n, + dim_t k, + void* restrict alpha, + void* restrict a, + void* restrict b, + void* restrict beta, + void* restrict c, inc_t rs_c, inc_t cs_c, + auxinfo_t* restrict data, + struct cntx_s* restrict cntx + ); + typedef struct obj_s { // Basic fields @@ -1261,6 +1302,15 @@ typedef struct obj_s // usually MR or NR) dim_t m_panel; // m dimension of a "full" panel dim_t n_panel; // n dimension of a "full" panel + pack_t schema; // pack schema, which may be unpacked + + // User data pointer + void* user_data; + + // Function pointers + obj_pack_fn_t pack; + obj_ker_fn_t ker; + obj_ukr_fn_t ukr; } obj_t; // Pre-initializors. Things that must be set afterwards: @@ -1297,7 +1347,14 @@ typedef struct obj_s .ps = 0, \ .pd = 0, \ .m_panel = 0, \ - .n_panel = 0 \ + .n_panel = 0, \ + .schema = BLIS_NOT_PACKED, \ +\ + .user_data = NULL, \ +\ + .pack = NULL, \ + .ker = NULL, \ + .ukr = NULL \ } #define BLIS_OBJECT_INITIALIZER_1X1 \ @@ -1325,7 +1382,14 @@ typedef struct obj_s .ps = 0, \ .pd = 0, \ .m_panel = 0, \ - .n_panel = 0 \ + .n_panel = 0, \ + .schema = BLIS_NOT_PACKED, \ +\ + .user_data = NULL, \ +\ + .pack = NULL, \ + .ker = NULL, \ + .ukr = NULL \ } // Define these macros here since they must be updated if contents of @@ -1359,6 +1423,13 @@ BLIS_INLINE void bli_obj_init_full_shallow_copy_of( obj_t* a, obj_t* b ) b->pd = a->pd; b->m_panel = a->m_panel; b->n_panel = a->n_panel; + b->schema = a->schema; + + b->user_data = a->user_data; + + b->pack = a->pack; + b->ker = a->ker; + b->ukr = a->ukr; } BLIS_INLINE void bli_obj_init_subpart_from( obj_t* a, obj_t* b ) @@ -1392,6 +1463,13 @@ BLIS_INLINE void bli_obj_init_subpart_from( obj_t* a, obj_t* b ) b->pd = a->pd; b->m_panel = a->m_panel; b->n_panel = a->n_panel; + b->schema = a->schema; + + b->user_data = a->user_data; + + b->pack = a->pack; + b->ker = a->ker; + b->ukr = a->ukr; } // Initializors for global scalar constants.