diff --git a/frame/0/bli_l0.h b/frame/0/bli_l0.h index de3f263cf..05f243c27 100644 --- a/frame/0/bli_l0.h +++ b/frame/0/bli_l0.h @@ -36,6 +36,10 @@ #include "bli_l0_oapi.h" #include "bli_l0_tapi.h" +#include "bli_l0_ft.h" + +// Generate function pointer arrays for tapi functions. +#include "bli_l0_fpa.h" // copysc #include "bli_copysc.h" diff --git a/frame/0/bli_l0_fpa.c b/frame/0/bli_l0_fpa.c new file mode 100644 index 000000000..f157775f7 --- /dev/null +++ b/frame/0/bli_l0_fpa.c @@ -0,0 +1,75 @@ +/* + + 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. + +*/ + +#include "blis.h" + +// +// Define function pointer query interfaces. +// + +#undef GENFRONT +#define GENFRONT( opname ) \ +\ +GENARRAY_FPA( void*, opname ); \ +\ +PASTECH(opname,_vft) PASTEMAC(opname,_qfp)( num_t dt ) \ +{ \ + return PASTECH(opname,_fpa)[ dt ]; \ +} + +GENFRONT( absqsc ) +GENFRONT( normfsc ) +GENFRONT( addsc ) +GENFRONT( divsc ) +GENFRONT( mulsc ) +GENFRONT( subsc ) +GENFRONT( invertsc ) +GENFRONT( sqrtsc ) +GENFRONT( unzipsc ) +GENFRONT( zipsc ) + + +#undef GENFRONT +#define GENFRONT( opname ) \ +\ +GENARRAY_FPA_I( void*, opname ); \ +\ +PASTECH(opname,_vft) PASTEMAC(opname,_qfp)( num_t dt ) \ +{ \ + return PASTECH(opname,_fpa)[ dt ]; \ +} + +GENFRONT( getsc ) +GENFRONT( setsc ) + diff --git a/frame/0/bli_l0_fpa.h b/frame/0/bli_l0_fpa.h new file mode 100644 index 000000000..0a78911b2 --- /dev/null +++ b/frame/0/bli_l0_fpa.h @@ -0,0 +1,58 @@ +/* + + 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. + +*/ + +// +// Prototype function pointer query interface. +// + +#undef GENPROT +#define GENPROT( opname ) \ +\ +PASTECH(opname,_vft) \ +PASTEMAC(opname,_qfp)( num_t dt ); + +GENPROT( absqsc ) +GENPROT( normfsc ) +GENPROT( addsc ) +GENPROT( divsc ) +GENPROT( mulsc ) +GENPROT( subsc ) +GENPROT( invertsc ) +GENPROT( sqrtsc ) +GENPROT( unzipsc ) +GENPROT( zipsc ) + +GENPROT( getsc ) +GENPROT( setsc ) + diff --git a/frame/0/bli_l0_ft.h b/frame/0/bli_l0_ft.h new file mode 100644 index 000000000..1b14a5fab --- /dev/null +++ b/frame/0/bli_l0_ft.h @@ -0,0 +1,178 @@ +/* + + 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. + +*/ + + +// +// -- Level-0 function types --------------------------------------------------- +// + +// addsc, divsc, subsc + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + conj_t conjchi, \ + ctype* chi, \ + ctype* psi \ + ); + +INSERT_GENTDEF( addsc ) +INSERT_GENTDEF( divsc ) +INSERT_GENTDEF( subsc ) + +// invertsc + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + conj_t conjchi, \ + ctype* chi \ + ); + +INSERT_GENTDEF( invertsc ) + +// mulsc + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + conj_t conjchi, \ + ctype* chi, \ + ctype* psi \ + ); + +INSERT_GENTDEF( mulsc ) + +// absqsc + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + ctype* chi, \ + ctype_r* absq \ + ); + +INSERT_GENTDEFR( absqsc ) + +// normfsc + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + ctype* chi, \ + ctype_r* norm \ + ); + +INSERT_GENTDEFR( normfsc ) + +// sqrtsc + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + ctype* chi, \ + ctype* psi \ + ); + +INSERT_GENTDEF( sqrtsc ) + +// getsc + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + ctype* chi, \ + double* zeta_r, \ + double* zeta_i \ + ); + +INSERT_GENTDEF( getsc ) + +// setsc + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + double zeta_r, \ + double zeta_i, \ + ctype* chi \ + ); + +INSERT_GENTDEF( setsc ) + +// unzipsc + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + ctype* chi, \ + ctype_r* zeta_r, \ + ctype_r* zeta_i \ + ); + +INSERT_GENTDEFR( unzipsc ) + +// zipsc + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + ctype_r* zeta_r, \ + ctype_r* zeta_i, \ + ctype* chi \ + ); + +INSERT_GENTDEFR( zipsc ) + + diff --git a/frame/0/bli_l0_oapi.c b/frame/0/bli_l0_oapi.c index 51c3dabb2..2d4c59e3d 100644 --- a/frame/0/bli_l0_oapi.c +++ b/frame/0/bli_l0_oapi.c @@ -63,11 +63,12 @@ void PASTEMAC0(opname) \ within the chi object and extract the buffer at the chi offset. */ \ bli_obj_scalar_set_dt_buffer( chi, dt_absq_c, &dt_chi, &buf_chi ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_2 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = PASTEMAC(opname,_qfp)( dt_chi ); \ +\ + f \ ( \ - dt_chi, \ - opname, \ buf_chi, \ buf_absq \ ); \ @@ -98,11 +99,12 @@ void PASTEMAC0(opname) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( chi, psi ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_3 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = PASTEMAC(opname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ conjchi, \ buf_chi, \ buf_psi \ @@ -134,11 +136,12 @@ void PASTEMAC0(opname) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( chi ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_2 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = PASTEMAC(opname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ conjchi, \ buf_chi \ ); \ @@ -166,11 +169,12 @@ void PASTEMAC0(opname) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( chi, psi ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_2 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = PASTEMAC(opname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ buf_chi, \ buf_psi \ ); \ @@ -208,11 +212,12 @@ void PASTEMAC0(opname) \ if ( bli_is_constant( dt_chi ) ) dt_use = dt_def; \ else dt_use = dt_chi; \ \ - /* Invoke the typed function (with integer support). */ \ - bli_call_ft_3i \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = PASTEMAC(opname,_qfp)( dt_use ); \ +\ + f \ ( \ - dt_use, \ - opname, \ buf_chi, \ zeta_r, \ zeta_i \ @@ -241,11 +246,12 @@ void PASTEMAC0(opname) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( zeta_r, zeta_i, chi ); \ \ - /* Invoke the typed function (with integer support). */ \ - bli_call_ft_3i \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = PASTEMAC(opname,_qfp)( dt_chi ); \ +\ + f \ ( \ - dt_chi, \ - opname, \ zeta_r, \ zeta_i, \ buf_chi \ @@ -283,11 +289,12 @@ void PASTEMAC0(opname) \ within the chi object and extract the buffer at the chi offset. */ \ bli_obj_scalar_set_dt_buffer( chi, dt_zeta_c, &dt_chi, &buf_chi ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_3 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = PASTEMAC(opname,_qfp)( dt_chi ); \ +\ + f \ ( \ - dt_chi, \ - opname, \ buf_chi, \ buf_zeta_r, \ buf_zeta_i \ @@ -319,11 +326,12 @@ void PASTEMAC0(opname) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( chi, zeta_r, zeta_i ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_3 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = PASTEMAC(opname,_qfp)( dt_chi ); \ +\ + f \ ( \ - dt_chi, \ - opname, \ buf_zeta_i, \ buf_zeta_r, \ buf_chi \ diff --git a/frame/1/bli_l1v.h b/frame/1/bli_l1v.h index a6a62e0f6..b7dca6b49 100644 --- a/frame/1/bli_l1v.h +++ b/frame/1/bli_l1v.h @@ -34,19 +34,28 @@ #include "bli_l1v_check.h" -#include "bli_l1v_ft.h" +// Define kernel function types. +//#include "bli_l1v_ft_ex.h" +#include "bli_l1v_ft_ker.h" // Prototype object APIs (expert and non-expert). #include "bli_oapi_ex.h" #include "bli_l1v_oapi.h" + #include "bli_oapi_ba.h" #include "bli_l1v_oapi.h" // Prototype typed APIs (expert and non-expert). #include "bli_tapi_ex.h" #include "bli_l1v_tapi.h" +#include "bli_l1v_ft.h" + #include "bli_tapi_ba.h" #include "bli_l1v_tapi.h" +#include "bli_l1v_ft.h" + +// Generate function pointer arrays for tapi functions (expert only). +#include "bli_l1v_fpa.h" // Pack-related // NOTE: packv and unpackv are temporarily disabled. @@ -58,6 +67,3 @@ //#include "bli_scalv_cntl.h" //#include "bli_scalv_int.h" -// Reference kernel headers -//#include "bli_l1v_ref.h" - diff --git a/frame/1/bli_l1v_fpa.c b/frame/1/bli_l1v_fpa.c new file mode 100644 index 000000000..0d08a8156 --- /dev/null +++ b/frame/1/bli_l1v_fpa.c @@ -0,0 +1,68 @@ +/* + + 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. + +*/ + +#include "blis.h" + +// +// Define function pointer query interfaces. +// + +#undef GENFRONT +#define GENFRONT( opname ) \ +\ +GENARRAY_FPA( PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft), \ + PASTECH(opname,BLIS_TAPI_EX_SUF) ); \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ) \ +{ \ + return PASTECH2(opname,BLIS_TAPI_EX_SUF,_fpa)[ dt ]; \ +} + +GENFRONT( addv ) +GENFRONT( copyv ) +GENFRONT( subv ) +GENFRONT( amaxv ) +GENFRONT( axpbyv ) +GENFRONT( axpyv ) +GENFRONT( scal2v ) +GENFRONT( dotv ) +GENFRONT( dotxv ) +GENFRONT( invertv ) +GENFRONT( scalv ) +GENFRONT( setv ) +GENFRONT( swapv ) +GENFRONT( xpbyv ) + + diff --git a/frame/1/bli_l1v_fpa.h b/frame/1/bli_l1v_fpa.h new file mode 100644 index 000000000..9d8e6b525 --- /dev/null +++ b/frame/1/bli_l1v_fpa.h @@ -0,0 +1,59 @@ +/* + + 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. + +*/ + +// +// Prototype function pointer query interface. +// + +#undef GENPROT +#define GENPROT( opname ) \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ); + +GENPROT( addv ) +GENPROT( copyv ) +GENPROT( subv ) +GENPROT( amaxv ) +GENPROT( axpbyv ) +GENPROT( axpyv ) +GENPROT( scal2v ) +GENPROT( dotv ) +GENPROT( dotxv ) +GENPROT( invertv ) +GENPROT( scalv ) +GENPROT( setv ) +GENPROT( swapv ) +GENPROT( xpbyv ) + diff --git a/frame/1/bli_l1v_ft.h b/frame/1/bli_l1v_ft.h index b2b80e016..6306fed6c 100644 --- a/frame/1/bli_l1v_ft.h +++ b/frame/1/bli_l1v_ft.h @@ -32,9 +32,6 @@ */ -#ifndef BLIS_L1V_FT_H -#define BLIS_L1V_FT_H - // // -- Level-1v function types -------------------------------------------------- @@ -45,13 +42,13 @@ #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjx, \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ + conj_t conjx, \ + dim_t n, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( addv ) @@ -63,12 +60,12 @@ INSERT_GENTDEF( subv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - dim_t* restrict index, \ - cntx_t* cntx \ + dim_t n, \ + ctype* x, inc_t incx, \ + dim_t* index \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( amaxv ) @@ -78,15 +75,15 @@ INSERT_GENTDEF( amaxv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjx, \ - dim_t n, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict beta, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ + conj_t conjx, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t incx, \ + ctype* beta, \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( axpbyv ) @@ -96,14 +93,14 @@ INSERT_GENTDEF( axpbyv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjx, \ - dim_t n, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ + conj_t conjx, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( axpyv ) @@ -114,15 +111,15 @@ INSERT_GENTDEF( scal2v ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict rho, \ - cntx_t* cntx \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy, \ + ctype* rho \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( dotv ) @@ -132,17 +129,17 @@ INSERT_GENTDEF( dotv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict beta, \ - ctype* restrict rho, \ - cntx_t* cntx \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy, \ + ctype* beta, \ + ctype* rho \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( dotxv ) @@ -152,11 +149,11 @@ INSERT_GENTDEF( dotxv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - cntx_t* cntx \ + dim_t n, \ + ctype* x, inc_t incx \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( invertv ) @@ -166,13 +163,13 @@ INSERT_GENTDEF( invertv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjalpha, \ - dim_t n, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - cntx_t* cntx \ + conj_t conjalpha, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t incx \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( scalv ) @@ -183,12 +180,12 @@ INSERT_GENTDEF( setv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ + dim_t n, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( swapv ) @@ -198,18 +195,16 @@ INSERT_GENTDEF( swapv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjx, \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict beta, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ + conj_t conjx, \ + dim_t n, \ + ctype* x, inc_t incx, \ + ctype* beta, \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( xpbyv ) -#endif - diff --git a/frame/1/bli_l1v_ft_ker.h b/frame/1/bli_l1v_ft_ker.h new file mode 100644 index 000000000..d5f68db54 --- /dev/null +++ b/frame/1/bli_l1v_ft_ker.h @@ -0,0 +1,215 @@ +/* + + 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_L1V_FT_KER_H +#define BLIS_L1V_FT_KER_H + + +// +// -- Level-1v kernel function types ------------------------------------------- +// + +// addv, copyv, subv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( addv ) +INSERT_GENTDEF( copyv ) +INSERT_GENTDEF( subv ) + +// amaxv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + dim_t* restrict index, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( amaxv ) + +// axpbyv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict beta, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( axpbyv ) + +// axpyv, scal2v + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( axpyv ) +INSERT_GENTDEF( scal2v ) + +// dotv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict rho, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( dotv ) + +// dotxv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict beta, \ + ctype* restrict rho, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( dotxv ) + +// invertv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( invertv ) + +// scalv, setv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjalpha, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( scalv ) +INSERT_GENTDEF( setv ) + +// swapv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( swapv ) + +// xpybv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict beta, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( xpbyv ) + + +#endif + diff --git a/frame/1/bli_l1v_oapi.c b/frame/1/bli_l1v_oapi.c index 1dac1957f..8e7800ee9 100644 --- a/frame/1/bli_l1v_oapi.c +++ b/frame/1/bli_l1v_oapi.c @@ -66,17 +66,19 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, y ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_8 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ - conjx, \ - n, \ - buf_x, inc_x, \ - buf_y, inc_y, \ - cntx, \ - rntm \ + conjx, \ + n, \ + buf_x, inc_x, \ + buf_y, inc_y, \ + cntx, \ + rntm \ ); \ } @@ -110,11 +112,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, index ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_6 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ n, \ buf_x, incx, \ buf_index, \ @@ -169,11 +173,13 @@ void PASTEMAC(opname,EX_SUF) \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ buf_beta = bli_obj_buffer_for_1x1( dt, &beta_local ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_10 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjx, \ n, \ buf_alpha, \ @@ -225,11 +231,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_9 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjx, \ n, \ buf_alpha, \ @@ -273,11 +281,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, y, rho ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_10 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjx, \ conjy, \ n, \ @@ -338,11 +348,13 @@ void PASTEMAC(opname,EX_SUF) \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ buf_beta = bli_obj_buffer_for_1x1( dt, &beta_local ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_12 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjx, \ conjy, \ n, \ @@ -381,11 +393,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_5 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ n, \ buf_x, inc_x, \ cntx, \ @@ -430,11 +444,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_7 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ BLIS_NO_CONJUGATE, /* internal conjugation applied during copy-cast. */ \ n, \ buf_alpha, \ @@ -473,11 +489,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, y ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_7 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ n, \ buf_x, inc_x, \ buf_y, inc_y, \ @@ -526,11 +544,13 @@ void PASTEMAC(opname,EX_SUF) \ beta, &beta_local ); \ buf_beta = bli_obj_buffer_for_1x1( dt, &beta_local ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_9 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjx, \ n, \ buf_x, inc_x, \ diff --git a/frame/1/bli_l1v_tapi.c b/frame/1/bli_l1v_tapi.c index 752348cdf..b6722958c 100644 --- a/frame/1/bli_l1v_tapi.c +++ b/frame/1/bli_l1v_tapi.c @@ -61,7 +61,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -98,7 +98,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -135,7 +135,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -175,7 +175,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) \ cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -215,7 +215,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -257,7 +257,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -295,7 +295,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -329,7 +329,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -365,7 +365,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -400,7 +400,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ diff --git a/frame/1/other/packv/bli_packv_cntl.h b/frame/1/other/packv/bli_packv_cntl.h index 1fc265338..23a5cc562 100644 --- a/frame/1/other/packv/bli_packv_cntl.h +++ b/frame/1/other/packv/bli_packv_cntl.h @@ -35,7 +35,7 @@ struct packv_params_s { uint64_t size - packv_voft* var_func; + packv_var_oft* var_func; bszid_t bmid; pack_t pack_schema; }; diff --git a/frame/1/other/packv/bli_packv_int.c b/frame/1/other/packv/bli_packv_int.c index 0ad670bb8..74d791eb1 100644 --- a/frame/1/other/packv/bli_packv_int.c +++ b/frame/1/other/packv/bli_packv_int.c @@ -59,10 +59,10 @@ void bli_packv_int varnum_t n; impl_t i; #endif - packv_voft f; + packv_var_oft f; // !!! -// DEFINE packv_voft type. +// DEFINE packv_var_oft type. // !!! // Check parameters. diff --git a/frame/1d/bli_l1d.h b/frame/1d/bli_l1d.h index 3f95b457b..ba1730a63 100644 --- a/frame/1d/bli_l1d.h +++ b/frame/1d/bli_l1d.h @@ -37,13 +37,19 @@ // Prototype object APIs (expert and non-expert). #include "bli_oapi_ex.h" #include "bli_l1d_oapi.h" + #include "bli_oapi_ba.h" #include "bli_l1d_oapi.h" // Prototype typed APIs (expert and non-expert). #include "bli_tapi_ex.h" #include "bli_l1d_tapi.h" +#include "bli_l1d_ft.h" + #include "bli_tapi_ba.h" #include "bli_l1d_tapi.h" +#include "bli_l1d_ft.h" +// Generate function pointer arrays for tapi functions (expert only). +#include "bli_l1d_fpa.h" diff --git a/frame/3/bli_l3_var_oft.h b/frame/1d/bli_l1d_fpa.c similarity index 74% rename from frame/3/bli_l3_var_oft.h rename to frame/1d/bli_l1d_fpa.c index ef48d5e85..1cede8e01 100644 --- a/frame/3/bli_l3_var_oft.h +++ b/frame/1d/bli_l1d_fpa.c @@ -32,46 +32,31 @@ */ -#ifndef BLIS_L3_VAR_OFT_H -#define BLIS_L3_VAR_OFT_H - +#include "blis.h" // -// -- Level-3 variant function types ------------------------------------------- +// Define function pointer query interfaces. // -#undef GENTDEF -#define GENTDEF( opname ) \ +#undef GENFRONT +#define GENFRONT( opname ) \ \ -typedef void (*PASTECH(opname,_voft)) \ -( \ - obj_t* a, \ - obj_t* b, \ - obj_t* c, \ - cntx_t* cntx, \ - gemm_t* cntl, \ - thrinfo_t* thread \ -); - -GENTDEF( gemm ) - - -#undef GENTDEF -#define GENTDEF( opname ) \ +GENARRAY_FPA( PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft), \ + PASTECH(opname,BLIS_TAPI_EX_SUF) ); \ \ -typedef void (*PASTECH(opname,_voft)) \ -( \ - obj_t* a, \ - obj_t* b, \ - obj_t* c, \ - cntx_t* cntx, \ - trsm_t* cntl, \ - thrinfo_t* thread \ -); +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ) \ +{ \ + return PASTECH2(opname,BLIS_TAPI_EX_SUF,_fpa)[ dt ]; \ +} -GENTDEF( trsm ) - - - -#endif +GENFRONT( addd ) +GENFRONT( copyd ) +GENFRONT( subd ) +GENFRONT( axpyd ) +GENFRONT( scal2d ) +GENFRONT( invertd ) +GENFRONT( scald ) +GENFRONT( setd ) +GENFRONT( setid ) diff --git a/frame/1d/bli_l1d_fpa.h b/frame/1d/bli_l1d_fpa.h new file mode 100644 index 000000000..36edaeccb --- /dev/null +++ b/frame/1d/bli_l1d_fpa.h @@ -0,0 +1,53 @@ +/* + + 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. + +*/ + +// +// Prototype function pointer query interface. +// + +#undef GENPROT +#define GENPROT( opname ) \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ); + +GENPROT( addd ) +GENPROT( copyd ) +GENPROT( subd ) +GENPROT( axpyd ) +GENPROT( scal2d ) +GENPROT( invertd ) +GENPROT( scald ) +GENPROT( setd ) +GENPROT( setid ) diff --git a/frame/1d/bli_l1d_ft.h b/frame/1d/bli_l1d_ft.h new file mode 100644 index 000000000..d3f9c123a --- /dev/null +++ b/frame/1d/bli_l1d_ft.h @@ -0,0 +1,151 @@ +/* + + 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. + +*/ + + +// +// -- Level-1d function types -------------------------------------------------- +// + +// addd, copyd, subd + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + doff_t diagoffx, \ + diag_t diagx, \ + trans_t transx, \ + dim_t m, \ + dim_t n, \ + ctype* x, inc_t rs_x, inc_t cs_x, \ + ctype* y, inc_t rs_y, inc_t cs_y \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEF( addd ) +INSERT_GENTDEF( copyd ) +INSERT_GENTDEF( subd ) + +// axpyd, scal2d + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + doff_t diagoffx, \ + diag_t diagx, \ + trans_t transx, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t rs_x, inc_t cs_x, \ + ctype* y, inc_t rs_y, inc_t cs_y \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEF( axpyd ) +INSERT_GENTDEF( scal2d ) + +// axpyv, scal2v + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEF( axpyv ) +INSERT_GENTDEF( scal2v ) + +// invertd + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + doff_t diagoffx, \ + dim_t m, \ + dim_t n, \ + ctype* x, inc_t rs_x, inc_t cs_x \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEF( invertd ) + +// scald, setd + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + conj_t conjalpha, \ + doff_t diagoffx, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t rs_x, inc_t cs_x \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEF( scald ) +INSERT_GENTDEF( setd ) + +// setid + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + doff_t diagoffx, \ + dim_t m, \ + dim_t n, \ + ctype_r* alpha, \ + ctype* x, inc_t rs_x, inc_t cs_x \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEFR( setid ) + diff --git a/frame/1d/bli_l1d_oapi.c b/frame/1d/bli_l1d_oapi.c index 53b46770d..9a6a8e66f 100644 --- a/frame/1d/bli_l1d_oapi.c +++ b/frame/1d/bli_l1d_oapi.c @@ -71,11 +71,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, y ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_13 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ diagoffx, \ diagx, \ transx, \ @@ -135,11 +137,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_14 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ diagoffx, \ diagx, \ transx, \ @@ -182,11 +186,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_8 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ diagoffx, \ m, \ n, \ @@ -236,11 +242,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_10 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ BLIS_NO_CONJUGATE, /* internal conjugation applied during copy-cast. */ \ diagoffx, \ m, \ @@ -284,11 +292,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( alpha, x ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_9 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ diagoffx, \ m, \ n, \ diff --git a/frame/1d/bli_l1d_tapi.c b/frame/1d/bli_l1d_tapi.c index 33d7f70e8..2e82f88de 100644 --- a/frame/1d/bli_l1d_tapi.c +++ b/frame/1d/bli_l1d_tapi.c @@ -101,7 +101,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ @@ -180,7 +180,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ @@ -239,7 +239,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ @@ -296,7 +296,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ @@ -372,7 +372,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(chr,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt_r, kerid, cntx ); \ + PASTECH2(chr,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt_r, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ diff --git a/frame/1f/bli_l1f.h b/frame/1f/bli_l1f.h index 8642a3023..378ba696d 100644 --- a/frame/1f/bli_l1f.h +++ b/frame/1f/bli_l1f.h @@ -34,20 +34,25 @@ #include "bli_l1f_check.h" -#include "bli_l1f_ft.h" +// Define kernel function types. +#include "bli_l1f_ft_ker.h" // Prototype object APIs (expert and non-expert). #include "bli_oapi_ex.h" #include "bli_l1f_oapi.h" + #include "bli_oapi_ba.h" #include "bli_l1f_oapi.h" // Prototype typed APIs (expert and non-expert). #include "bli_tapi_ex.h" #include "bli_l1f_tapi.h" +#include "bli_l1f_ft.h" + #include "bli_tapi_ba.h" #include "bli_l1f_tapi.h" +#include "bli_l1f_ft.h" -// Reference kernel headers -//#include "bli_l1f_ref.h" +// Generate function pointer arrays for tapi functions (expert only). +#include "bli_l1f_fpa.h" diff --git a/frame/1f/bli_l1f_fpa.c b/frame/1f/bli_l1f_fpa.c new file mode 100644 index 000000000..ec4ad69e5 --- /dev/null +++ b/frame/1f/bli_l1f_fpa.c @@ -0,0 +1,58 @@ +/* + + 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. + +*/ + +#include "blis.h" + +// +// Define function pointer query interfaces. +// + +#undef GENFRONT +#define GENFRONT( opname ) \ +\ +GENARRAY_FPA( PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft), \ + PASTECH(opname,BLIS_TAPI_EX_SUF) ); \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ) \ +{ \ + return PASTECH2(opname,BLIS_TAPI_EX_SUF,_fpa)[ dt ]; \ +} + +GENFRONT( axpy2v ) +GENFRONT( axpyf ) +GENFRONT( dotaxpyv ) +GENFRONT( dotxaxpyf ) +GENFRONT( dotxf ) + diff --git a/frame/1f/bli_l1f_fpa.h b/frame/1f/bli_l1f_fpa.h new file mode 100644 index 000000000..914d964ce --- /dev/null +++ b/frame/1f/bli_l1f_fpa.h @@ -0,0 +1,50 @@ +/* + + 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. + +*/ + +// +// Prototype function pointer query interface. +// + +#undef GENPROT +#define GENPROT( opname ) \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ); + +GENPROT( axpy2v ) +GENPROT( axpyf ) +GENPROT( dotaxpyv ) +GENPROT( dotxaxpyf ) +GENPROT( dotxf ) + diff --git a/frame/1f/bli_l1f_ft.h b/frame/1f/bli_l1f_ft.h index 5fa688b5d..0006cb1b3 100644 --- a/frame/1f/bli_l1f_ft.h +++ b/frame/1f/bli_l1f_ft.h @@ -32,9 +32,6 @@ */ -#ifndef BLIS_L1F_FT_H -#define BLIS_L1F_FT_H - // // -- Level-1f function types -------------------------------------------------- @@ -45,17 +42,17 @@ #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype* restrict alpha1, \ - ctype* restrict alpha2, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict z, inc_t incz, \ - cntx_t* cntx \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* alpha1, \ + ctype* alpha2, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy, \ + ctype* z, inc_t incz \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( axpy2v ) @@ -65,17 +62,17 @@ INSERT_GENTDEF( axpy2v ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conja, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype* restrict alpha, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ + conj_t conja, \ + conj_t conjx, \ + dim_t m, \ + dim_t b_n, \ + ctype* alpha, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( axpyf ) @@ -85,18 +82,18 @@ INSERT_GENTDEF( axpyf ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjxt, \ - conj_t conjx, \ - conj_t conjy, \ - dim_t m, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict rho, \ - ctype* restrict z, inc_t incz, \ - cntx_t* cntx \ + conj_t conjxt, \ + conj_t conjx, \ + conj_t conjy, \ + dim_t m, \ + ctype* alpha, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy, \ + ctype* rho, \ + ctype* z, inc_t incz \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( dotaxpyv ) @@ -106,18 +103,18 @@ INSERT_GENTDEF( dotaxpyv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjat, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype* restrict alpha, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict beta, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ + conj_t conjat, \ + conj_t conjx, \ + dim_t m, \ + dim_t b_n, \ + ctype* alpha, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* x, inc_t incx, \ + ctype* beta, \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( dotxf ) @@ -127,27 +124,24 @@ INSERT_GENTDEF( dotxf ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjat, \ - conj_t conja, \ - conj_t conjw, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype* restrict alpha, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict w, inc_t incw, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict beta, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict z, inc_t incz, \ - cntx_t* cntx \ + conj_t conjat, \ + conj_t conja, \ + conj_t conjw, \ + conj_t conjx, \ + dim_t m, \ + dim_t b_n, \ + ctype* alpha, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* w, inc_t incw, \ + ctype* x, inc_t incx, \ + ctype* beta, \ + ctype* y, inc_t incy, \ + ctype* z, inc_t incz \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( dotxaxpyf ) - -#endif - diff --git a/frame/1f/bli_l1f_ft_ker.h b/frame/1f/bli_l1f_ft_ker.h new file mode 100644 index 000000000..ddcfac73e --- /dev/null +++ b/frame/1f/bli_l1f_ft_ker.h @@ -0,0 +1,153 @@ +/* + + 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_L1F_FT_KER_H +#define BLIS_L1F_FT_KER_H + + +// +// -- Level-1f kernel function types ------------------------------------------- +// + +// axpy2v + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* restrict alpha1, \ + ctype* restrict alpha2, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict z, inc_t incz, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( axpy2v ) + +// axpyf + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conja, \ + conj_t conjx, \ + dim_t m, \ + dim_t b_n, \ + ctype* restrict alpha, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( axpyf ) + +// dotaxpyv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjxt, \ + conj_t conjx, \ + conj_t conjy, \ + dim_t m, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict rho, \ + ctype* restrict z, inc_t incz, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( dotaxpyv ) + +// dotxf + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjat, \ + conj_t conjx, \ + dim_t m, \ + dim_t b_n, \ + ctype* restrict alpha, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict beta, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( dotxf ) + +// dotxaxpyf + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjat, \ + conj_t conja, \ + conj_t conjw, \ + conj_t conjx, \ + dim_t m, \ + dim_t b_n, \ + ctype* restrict alpha, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict w, inc_t incw, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict beta, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict z, inc_t incz, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( dotxaxpyf ) + + + +#endif + diff --git a/frame/1f/bli_l1f_oapi.c b/frame/1f/bli_l1f_oapi.c index d1cfab5c6..897b6dbec 100644 --- a/frame/1f/bli_l1f_oapi.c +++ b/frame/1f/bli_l1f_oapi.c @@ -87,11 +87,13 @@ void PASTEMAC(opname,EX_SUF) \ buf_alphax = bli_obj_buffer_for_1x1( dt, &alphax_local ); \ buf_alphay = bli_obj_buffer_for_1x1( dt, &alphay_local ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_13 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjx, \ conjy, \ n, \ @@ -154,11 +156,13 @@ void PASTEMAC(opname,EX_SUF) \ /* Support cases where matrix A requires a transposition. */ \ if ( bli_obj_has_trans( a ) ) { bli_swap_incs( &rs_a, &cs_a ); } \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_14 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conja, \ conjx, \ m, \ @@ -220,11 +224,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_14 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjxt, \ conjx, \ conjy, \ @@ -303,11 +309,13 @@ void PASTEMAC(opname,EX_SUF) \ /* Support cases where matrix A requires a transposition. */ \ if ( bli_obj_has_trans( a ) ) { bli_swap_incs( &rs_a, &cs_a ); } \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_21 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjat, \ conja, \ conjw, \ @@ -381,11 +389,13 @@ void PASTEMAC(opname,EX_SUF) \ /* Support cases where matrix A requires a transposition. */ \ if ( bli_obj_has_trans( a ) ) { bli_swap_incs( &rs_a, &cs_a ); } \ \ - /* Invoke the void pointer-based function. */ \ - bli_call_ft_15 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjat, \ conjx, \ m, \ diff --git a/frame/1f/bli_l1f_tapi.c b/frame/1f/bli_l1f_tapi.c index 6c8057ec6..389433b44 100644 --- a/frame/1f/bli_l1f_tapi.c +++ b/frame/1f/bli_l1f_tapi.c @@ -65,7 +65,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -109,7 +109,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -154,7 +154,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -204,7 +204,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -254,7 +254,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ /* Obtain a valid context from the gks if necessary. */ \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,opname,_ker_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ diff --git a/frame/1m/bli_l1m.h b/frame/1m/bli_l1m.h index 9fb7f194f..0aa053e15 100644 --- a/frame/1m/bli_l1m.h +++ b/frame/1m/bli_l1m.h @@ -34,21 +34,32 @@ #include "bli_l1m_check.h" -#include "bli_l1m_ft.h" -#include "bli_l1m_voft.h" +// Define kernel function types. +#include "bli_l1m_ft_ker.h" + +// Define object function types for variants. +#include "bli_l1m_oft_var.h" // Prototype object APIs (expert and non-expert). #include "bli_oapi_ex.h" #include "bli_l1m_oapi.h" + #include "bli_oapi_ba.h" #include "bli_l1m_oapi.h" // Prototype typed APIs (expert and non-expert). #include "bli_tapi_ex.h" #include "bli_l1m_tapi.h" +#include "bli_l1m_ft.h" + #include "bli_tapi_ba.h" #include "bli_l1m_tapi.h" +#include "bli_l1m_ft.h" +// Generate function pointer arrays for tapi functions (expert only). +#include "bli_l1m_fpa.h" + +// Prototype level-1m implementations. #include "bli_l1m_unb_var1.h" // Pack-related diff --git a/frame/1m/bli_l1m_fpa.c b/frame/1m/bli_l1m_fpa.c new file mode 100644 index 000000000..c5b1654dd --- /dev/null +++ b/frame/1m/bli_l1m_fpa.c @@ -0,0 +1,60 @@ +/* + + 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. + +*/ + +#include "blis.h" + +// +// Define function pointer query interfaces. +// + +#undef GENFRONT +#define GENFRONT( opname ) \ +\ +GENARRAY_FPA( PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft), \ + PASTECH(opname,BLIS_TAPI_EX_SUF) ); \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ) \ +{ \ + return PASTECH2(opname,BLIS_TAPI_EX_SUF,_fpa)[ dt ]; \ +} + +GENFRONT( addm ) +GENFRONT( copym ) +GENFRONT( subm ) +GENFRONT( axpym ) +GENFRONT( scal2m ) +GENFRONT( scalm ) +GENFRONT( setm ) + diff --git a/frame/1m/bli_l1m_fpa.h b/frame/1m/bli_l1m_fpa.h new file mode 100644 index 000000000..aae78c9df --- /dev/null +++ b/frame/1m/bli_l1m_fpa.h @@ -0,0 +1,52 @@ +/* + + 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. + +*/ + +// +// Prototype function pointer query interface. +// + +#undef GENPROT +#define GENPROT( opname ) \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ); + +GENPROT( addm ) +GENPROT( copym ) +GENPROT( subm ) +GENPROT( axpym ) +GENPROT( scal2m ) +GENPROT( scalm ) +GENPROT( setm ) + diff --git a/frame/1m/bli_l1m_ft.h b/frame/1m/bli_l1m_ft.h index f15bc0c6d..8926442b5 100644 --- a/frame/1m/bli_l1m_ft.h +++ b/frame/1m/bli_l1m_ft.h @@ -32,129 +32,112 @@ */ -#ifndef BLIS_L1M_FT_H -#define BLIS_L1M_FT_H - // -// -- Level-1m function types -------------------------------------------------- +// -- Level-1v function types -------------------------------------------------- // -// packm - -// NOTE: This is the function type for the structure-aware "kernel". +// addm, subm #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - struc_t strucc, \ - doff_t diagoffc, \ - diag_t diagc, \ - uplo_t uploc, \ - conj_t conjc, \ - pack_t schema, \ - bool_t invdiag, \ - dim_t m_panel, \ - dim_t n_panel, \ - dim_t m_panel_max, \ - dim_t n_panel_max, \ - ctype* restrict kappa, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - ctype* restrict p, inc_t rs_p, inc_t cs_p, \ - inc_t is_p, \ - cntx_t* cntx \ + doff_t diagoffx, \ + diag_t diagx, \ + uplo_t uplox, \ + trans_t transx, \ + dim_t m, \ + dim_t n, \ + ctype* x, inc_t rs_x, inc_t cs_x, \ + ctype* y, inc_t rs_y, inc_t cs_y \ + BLIS_TAPI_EX_PARAMS \ ); -INSERT_GENTDEF( packm ) +INSERT_GENTDEF( addm ) +INSERT_GENTDEF( subm ) - -// NOTE: the following macros generate packm kernel function type definitions -// that are "ctyped" and void-typed, for each of the floating-point datatypes. -// However, we will only make use of the void-typed definitions because the -// functions such as bli_?packm_cxk() (currently) use arrays of function -// pointers to store and access the function pointers for various unrolling -// (register blocksize) values, and therefore they must all be of the same -// type (hence the use of void* for kappa, a, and p). - -// packm_ker +// copym #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conja, \ - dim_t n, \ - ctype* restrict kappa, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict p, inc_t ldp, \ - cntx_t* restrict cntx \ + doff_t diagoffx, \ + diag_t diagx, \ + uplo_t uplox, \ + trans_t transx, \ + dim_t m, \ + dim_t n, \ + ctype* x, inc_t rs_x, inc_t cs_x, \ + ctype* y, inc_t rs_y, inc_t cs_y \ + BLIS_TAPI_EX_PARAMS \ ); -INSERT_GENTDEF( packm_cxk_ker ) +INSERT_GENTDEF( copym ) -// unpackm_ker +// axpym #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conjp, \ - dim_t n, \ - ctype* restrict kappa, \ - ctype* restrict p, inc_t ldp, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - cntx_t* restrict cntx \ + doff_t diagoffx, \ + diag_t diagx, \ + uplo_t uplox, \ + trans_t transx, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t rs_x, inc_t cs_x, \ + ctype* y, inc_t rs_y, inc_t cs_y \ + BLIS_TAPI_EX_PARAMS \ ); -INSERT_GENTDEF( unpackm_cxk_ker ) +INSERT_GENTDEF( axpym ) -// packm_3mis_ker -// packm_4mi_ker +// scal2m #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conja, \ - dim_t n, \ - ctype* restrict kappa, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict p, inc_t is_p, inc_t ldp, \ - cntx_t* restrict cntx \ + doff_t diagoffx, \ + diag_t diagx, \ + uplo_t uplox, \ + trans_t transx, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t rs_x, inc_t cs_x, \ + ctype* y, inc_t rs_y, inc_t cs_y \ + BLIS_TAPI_EX_PARAMS \ ); -INSERT_GENTDEF( packm_cxk_3mis_ker ) -INSERT_GENTDEF( packm_cxk_4mi_ker ) +INSERT_GENTDEF( scal2m ) - -// packm_rih_ker -// packm_1er_ker +// scalm, setm #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - ctype* restrict kappa, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict p, inc_t ldp, \ - cntx_t* restrict cntx \ + conj_t conjalpha, \ + doff_t diagoffx, \ + diag_t diagx, \ + uplo_t uplox, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t rs_x, inc_t cs_x \ + BLIS_TAPI_EX_PARAMS \ ); -INSERT_GENTDEF( packm_cxk_rih_ker ) -INSERT_GENTDEF( packm_cxk_1er_ker ) - - - - - -#endif +INSERT_GENTDEF( scalm ) +INSERT_GENTDEF( setm ) diff --git a/frame/1m/bli_l1m_ft_ker.h b/frame/1m/bli_l1m_ft_ker.h new file mode 100644 index 000000000..8bc58fb2f --- /dev/null +++ b/frame/1m/bli_l1m_ft_ker.h @@ -0,0 +1,160 @@ +/* + + 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_L1M_FT_KER_H +#define BLIS_L1M_FT_KER_H + + +// +// -- Level-1m kernel function types ------------------------------------------- +// + +// packm + +// NOTE: This is the function type for the structure-aware "kernel". + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + struc_t strucc, \ + doff_t diagoffc, \ + diag_t diagc, \ + uplo_t uploc, \ + conj_t conjc, \ + pack_t schema, \ + bool_t invdiag, \ + dim_t m_panel, \ + dim_t n_panel, \ + dim_t m_panel_max, \ + dim_t n_panel_max, \ + ctype* restrict kappa, \ + ctype* restrict c, inc_t rs_c, inc_t cs_c, \ + ctype* restrict p, inc_t rs_p, inc_t cs_p, \ + inc_t is_p, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( packm ) + + +// NOTE: the following macros generate packm kernel function type definitions +// that are "ctyped" and void-typed, for each of the floating-point datatypes. +// However, we will only make use of the void-typed definitions because the +// functions such as bli_?packm_cxk() (currently) use arrays of function +// pointers to store and access the function pointers for various unrolling +// (register blocksize) values, and therefore they must all be of the same +// type (hence the use of void* for kappa, a, and p). + +// packm_ker + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conja, \ + dim_t n, \ + ctype* restrict kappa, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ); + +INSERT_GENTDEF( packm_cxk ) + +// unpackm_ker + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conjp, \ + dim_t n, \ + ctype* restrict kappa, \ + ctype* restrict p, inc_t ldp, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ + ); + +INSERT_GENTDEF( unpackm_cxk ) + +// packm_3mis_ker +// packm_4mi_ker + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conja, \ + dim_t n, \ + ctype* restrict kappa, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ + ); + +INSERT_GENTDEF( packm_cxk_3mis ) +INSERT_GENTDEF( packm_cxk_4mi ) + + +// packm_rih_ker +// packm_1er_ker + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ker,tsuf)) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + ctype* restrict kappa, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ); + +INSERT_GENTDEF( packm_cxk_rih ) +INSERT_GENTDEF( packm_cxk_1er ) + + + + + +#endif + diff --git a/frame/1m/bli_l1m_oapi.c b/frame/1m/bli_l1m_oapi.c index a1b8ca060..d2ca24685 100644 --- a/frame/1m/bli_l1m_oapi.c +++ b/frame/1m/bli_l1m_oapi.c @@ -72,11 +72,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, y ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_14 \ - ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ + ( \ diagoffx, \ diagx, \ uplox, \ @@ -138,11 +140,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_15 \ - ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ + ( \ diagoffx, \ diagx, \ uplox, \ @@ -213,11 +217,13 @@ void PASTEMAC(opname,EX_SUF) \ attached to x. */ \ buf_alpha = bli_obj_internal_scalar_buffer( &x_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_12 \ - ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ + ( \ BLIS_NO_CONJUGATE, /* internal conjugation applied during copy-cast. */ \ diagoffx, \ diagx, \ @@ -273,11 +279,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_12 \ - ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ + ( \ BLIS_NO_CONJUGATE, /* internal conjugation applied during copy-cast. */ \ diagoffx, \ diagx, \ diff --git a/frame/1m/bli_l1m_voft.h b/frame/1m/bli_l1m_oft_var.h similarity index 93% rename from frame/1m/bli_l1m_voft.h rename to frame/1m/bli_l1m_oft_var.h index f5fdf5b65..6d7e80c78 100644 --- a/frame/1m/bli_l1m_voft.h +++ b/frame/1m/bli_l1m_oft_var.h @@ -32,8 +32,8 @@ */ -#ifndef BLIS_L1M_VAR_OFT_H -#define BLIS_L1M_VAR_OFT_H +#ifndef BLIS_L1M_OFT_VAR_H +#define BLIS_L1M_OFT_VAR_H // @@ -43,7 +43,7 @@ #undef GENTDEF #define GENTDEF( opname ) \ \ -typedef void (*PASTECH(opname,_voft)) \ +typedef void (*PASTECH(opname,_var_oft)) \ ( \ obj_t* a, \ obj_t* p, \ @@ -58,7 +58,7 @@ GENTDEF( packm ) #undef GENTDEF #define GENTDEF( opname ) \ \ -typedef void (*PASTECH(opname,_voft)) \ +typedef void (*PASTECH(opname,_var_oft)) \ ( \ obj_t* p, \ obj_t* a, \ diff --git a/frame/1m/bli_l1m_unb_var1.c b/frame/1m/bli_l1m_unb_var1.c index af7219c1b..9d90acdff 100644 --- a/frame/1m/bli_l1m_unb_var1.c +++ b/frame/1m/bli_l1m_unb_var1.c @@ -83,7 +83,7 @@ void PASTEMAC(ch,opname) \ conjx = bli_extract_conj( transx ); \ \ /* Query the kernel needed for this operation. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Handle dense and upper/lower storage cases separately. */ \ if ( bli_is_dense( uplox_eff ) ) \ @@ -200,7 +200,7 @@ void PASTEMAC(ch,opname) \ conjx = bli_extract_conj( transx ); \ \ /* Query the kernel needed for this operation. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Handle dense and upper/lower storage cases separately. */ \ if ( bli_is_dense( uplox_eff ) ) \ @@ -312,7 +312,7 @@ void PASTEMAC(ch,opname) \ if ( bli_is_zeros( uplox_eff ) ) return; \ \ /* Query the kernel needed for this operation. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ + PASTECH2(ch,kername,_ker_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Handle dense and upper/lower storage cases separately. */ \ if ( bli_is_dense( uplox_eff ) ) \ diff --git a/frame/1m/packm/bli_packm_blk_var1.c b/frame/1m/packm/bli_packm_blk_var1.c index 5151727de..8668b82de 100644 --- a/frame/1m/packm/bli_packm_blk_var1.c +++ b/frame/1m/packm/bli_packm_blk_var1.c @@ -289,7 +289,7 @@ void PASTEMAC(ch,varname) \ thrinfo_t* thread \ ) \ { \ - PASTECH2(ch,opname,_ft) packm_ker_cast = packm_ker; \ + PASTECH2(ch,opname,_ker_ft) packm_ker_cast = packm_ker; \ \ ctype* restrict kappa_cast = kappa; \ ctype* restrict c_cast = c; \ diff --git a/frame/1m/packm/bli_packm_cntl.h b/frame/1m/packm/bli_packm_cntl.h index 15ac1320e..e9f1e2ccc 100644 --- a/frame/1m/packm/bli_packm_cntl.h +++ b/frame/1m/packm/bli_packm_cntl.h @@ -34,19 +34,19 @@ struct packm_params_s { - uint64_t size; // size field must be present and come first. - packm_voft var_func; - bszid_t bmid_m; - bszid_t bmid_n; - bool_t does_invert_diag; - bool_t rev_iter_if_upper; - bool_t rev_iter_if_lower; - pack_t pack_schema; - packbuf_t pack_buf_type; + uint64_t size; // size field must be present and come first. + packm_var_oft var_func; + bszid_t bmid_m; + bszid_t bmid_n; + bool_t does_invert_diag; + bool_t rev_iter_if_upper; + bool_t rev_iter_if_lower; + pack_t pack_schema; + packbuf_t pack_buf_type; }; typedef struct packm_params_s packm_params_t; -static packm_voft bli_cntl_packm_params_var_func( cntl_t* cntl ) +static packm_var_oft bli_cntl_packm_params_var_func( cntl_t* cntl ) { packm_params_t* ppp = ( packm_params_t* )cntl->params; return ppp->var_func; } diff --git a/frame/1m/packm/bli_packm_int.c b/frame/1m/packm/bli_packm_int.c index de762c902..6ea3fc3a7 100644 --- a/frame/1m/packm/bli_packm_int.c +++ b/frame/1m/packm/bli_packm_int.c @@ -45,7 +45,7 @@ void bli_packm_int { bli_init_once(); - packm_voft f; + packm_var_oft f; // Check parameters. if ( bli_error_checking_is_enabled() ) diff --git a/frame/1m/unpackm/bli_unpackm_cntl.h b/frame/1m/unpackm/bli_unpackm_cntl.h index 96278d406..1855c62a0 100644 --- a/frame/1m/unpackm/bli_unpackm_cntl.h +++ b/frame/1m/unpackm/bli_unpackm_cntl.h @@ -34,8 +34,8 @@ struct unpackm_params_s { - uint64_t size; // size field must be present and come first. - unpackm_voft var_func; + uint64_t size; // size field must be present and come first. + unpackm_var_oft var_func; }; typedef struct unpackm_params_s unpackm_params_t; diff --git a/frame/1m/unpackm/bli_unpackm_int.c b/frame/1m/unpackm/bli_unpackm_int.c index 3a687c0f8..25f3d10eb 100644 --- a/frame/1m/unpackm/bli_unpackm_int.c +++ b/frame/1m/unpackm/bli_unpackm_int.c @@ -45,7 +45,7 @@ void bli_unpackm_int { bli_init_once(); - unpackm_voft f; + unpackm_var_oft f; // Check parameters. if ( bli_error_checking_is_enabled() ) diff --git a/frame/2/bli_l2.h b/frame/2/bli_l2.h index e0094b16a..916d8b99a 100644 --- a/frame/2/bli_l2.h +++ b/frame/2/bli_l2.h @@ -34,19 +34,27 @@ #include "bli_l2_check.h" -#include "bli_l2_ft.h" +// Define function types. +#include "bli_l2_ft_unb.h" // Prototype object APIs (expert and non-expert). #include "bli_oapi_ex.h" #include "bli_l2_oapi.h" + #include "bli_oapi_ba.h" #include "bli_l2_oapi.h" // Prototype typed APIs (expert and non-expert). #include "bli_tapi_ex.h" #include "bli_l2_tapi.h" +#include "bli_l2_ft.h" + #include "bli_tapi_ba.h" #include "bli_l2_tapi.h" +#include "bli_l2_ft.h" + +// Generate function pointer arrays for tapi functions (expert only). +#include "bli_l2_fpa.h" // Operation-specific headers #include "bli_gemv.h" @@ -59,3 +67,4 @@ #include "bli_syr2.h" #include "bli_trmv.h" #include "bli_trsv.h" + diff --git a/frame/2/bli_l2_fpa.c b/frame/2/bli_l2_fpa.c new file mode 100644 index 000000000..41f4a9768 --- /dev/null +++ b/frame/2/bli_l2_fpa.c @@ -0,0 +1,116 @@ +/* + + 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. + +*/ + +#include "blis.h" + +// +// Define function pointer query interfaces. +// + +#undef GENFRONT +#define GENFRONT( opname ) \ +\ +GENARRAY_FPA( PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft), \ + PASTECH(opname,BLIS_TAPI_EX_SUF) ); \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ) \ +{ \ + return PASTECH2(opname,BLIS_TAPI_EX_SUF,_fpa)[ dt ]; \ +} + +GENFRONT( gemv ) +GENFRONT( ger ) +GENFRONT( hemv ) +GENFRONT( symv ) +GENFRONT( her ) +GENFRONT( syr ) +GENFRONT( her2 ) +GENFRONT( syr2 ) +GENFRONT( trmv ) +GENFRONT( trsv ) + +// +// Define function pointer query interfaces for level-2 implementations. +// + +#undef GENFRONT +#define GENFRONT( opname, varname ) \ +\ +GENARRAY_FPA( PASTECH2(opname,_unb,_vft), \ + varname ); \ +\ +PASTECH2(opname,_unb,_vft) \ +PASTEMAC(varname,_qfp)( num_t dt ) \ +{ \ + return PASTECH(varname,_fpa)[ dt ]; \ +} + +GENFRONT( gemv, gemv_unb_var1 ) +GENFRONT( gemv, gemv_unb_var2 ) +GENFRONT( gemv, gemv_unf_var1 ) +GENFRONT( gemv, gemv_unf_var2 ) + +GENFRONT( ger, ger_unb_var1 ) +GENFRONT( ger, ger_unb_var2 ) + +GENFRONT( hemv, hemv_unb_var1 ) +GENFRONT( hemv, hemv_unb_var2 ) +GENFRONT( hemv, hemv_unb_var3 ) +GENFRONT( hemv, hemv_unb_var4 ) +GENFRONT( hemv, hemv_unf_var1 ) +GENFRONT( hemv, hemv_unf_var3 ) +GENFRONT( hemv, hemv_unf_var1a ) +GENFRONT( hemv, hemv_unf_var3a ) + +GENFRONT( her, her_unb_var1 ) +GENFRONT( her, her_unb_var2 ) + +GENFRONT( her2, her2_unb_var1 ) +GENFRONT( her2, her2_unb_var2 ) +GENFRONT( her2, her2_unb_var3 ) +GENFRONT( her2, her2_unb_var4 ) +GENFRONT( her2, her2_unf_var1 ) +GENFRONT( her2, her2_unf_var4 ) + +GENFRONT( trmv, trmv_unb_var1 ) +GENFRONT( trmv, trmv_unb_var2 ) +GENFRONT( trmv, trmv_unf_var1 ) +GENFRONT( trmv, trmv_unf_var2 ) + +GENFRONT( trsv, trsv_unb_var1 ) +GENFRONT( trsv, trsv_unb_var2 ) +GENFRONT( trsv, trsv_unf_var1 ) +GENFRONT( trsv, trsv_unf_var2 ) + diff --git a/frame/2/bli_l2_fpa.h b/frame/2/bli_l2_fpa.h new file mode 100644 index 000000000..28134ce55 --- /dev/null +++ b/frame/2/bli_l2_fpa.h @@ -0,0 +1,102 @@ +/* + + 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. + +*/ + +// +// Prototype function pointer query interface. +// + +#undef GENPROT +#define GENPROT( opname ) \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ); + +GENPROT( gemv ) +GENPROT( ger ) +GENPROT( hemv ) +GENPROT( symv ) +GENPROT( her ) +GENPROT( syr ) +GENPROT( her2 ) +GENPROT( syr2 ) +GENPROT( trmv ) +GENPROT( trsv ) + +// +// Prototype function pointer query interfaces for level-2 implementations. +// + +#undef GENPROT +#define GENPROT( opname, varname ) \ +\ +PASTECH2(opname,_unb,_vft) \ +PASTEMAC(varname,_qfp)( num_t dt ); + +GENPROT( gemv, gemv_unb_var1 ) +GENPROT( gemv, gemv_unb_var2 ) +GENPROT( gemv, gemv_unf_var1 ) +GENPROT( gemv, gemv_unf_var2 ) + +GENPROT( ger, ger_unb_var1 ) +GENPROT( ger, ger_unb_var2 ) + +GENPROT( hemv, hemv_unb_var1 ) +GENPROT( hemv, hemv_unb_var2 ) +GENPROT( hemv, hemv_unb_var3 ) +GENPROT( hemv, hemv_unb_var4 ) +GENPROT( hemv, hemv_unf_var1 ) +GENPROT( hemv, hemv_unf_var3 ) +GENPROT( hemv, hemv_unf_var1a ) +GENPROT( hemv, hemv_unf_var3a ) + +GENPROT( her, her_unb_var1 ) +GENPROT( her, her_unb_var2 ) + +GENPROT( her2, her2_unb_var1 ) +GENPROT( her2, her2_unb_var2 ) +GENPROT( her2, her2_unb_var3 ) +GENPROT( her2, her2_unb_var4 ) +GENPROT( her2, her2_unf_var1 ) +GENPROT( her2, her2_unf_var4 ) + +GENPROT( trmv, trmv_unb_var1 ) +GENPROT( trmv, trmv_unb_var2 ) +GENPROT( trmv, trmv_unf_var1 ) +GENPROT( trmv, trmv_unf_var2 ) + +GENPROT( trsv, trsv_unb_var1 ) +GENPROT( trsv, trsv_unb_var2 ) +GENPROT( trsv, trsv_unf_var1 ) +GENPROT( trsv, trsv_unf_var2 ) + diff --git a/frame/2/bli_l2_ft.h b/frame/2/bli_l2_ft.h index a20a3a3eb..46d07c7d7 100644 --- a/frame/2/bli_l2_ft.h +++ b/frame/2/bli_l2_ft.h @@ -32,9 +32,6 @@ */ -#ifndef BLIS_L2_FT_H -#define BLIS_L2_FT_H - // // -- Level-2 function types --------------------------------------------------- @@ -45,7 +42,7 @@ #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ trans_t transa, \ conj_t conjx, \ @@ -55,8 +52,8 @@ typedef void (*PASTECH2(ch,opname,tsuf)) \ ctype* a, inc_t rs_a, inc_t cs_a, \ ctype* x, inc_t incx, \ ctype* beta, \ - ctype* y, inc_t incy, \ - cntx_t* cntx \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( gemv ) @@ -66,7 +63,7 @@ INSERT_GENTDEF( gemv ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ conj_t conjx, \ conj_t conjy, \ @@ -75,80 +72,97 @@ typedef void (*PASTECH2(ch,opname,tsuf)) \ ctype* alpha, \ ctype* x, inc_t incx, \ ctype* y, inc_t incy, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - cntx_t* cntx \ + ctype* a, inc_t rs_a, inc_t cs_a \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( ger ) -// hemv (and symv) +// hemv, symv #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ uplo_t uploa, \ conj_t conja, \ conj_t conjx, \ - conj_t conjh, \ dim_t m, \ ctype* alpha, \ ctype* a, inc_t rs_a, inc_t cs_a, \ ctype* x, inc_t incx, \ ctype* beta, \ - ctype* y, inc_t incy, \ - cntx_t* cntx \ + ctype* y, inc_t incy \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( hemv ) +INSERT_GENTDEF( symv ) -// her (and syr) +// her #undef GENTDEFR #define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ uplo_t uploa, \ conj_t conjx, \ - conj_t conjh, \ dim_t m, \ - ctype* alpha, /* complex alpha allows her variants to also perform syr. */ \ + ctype_r* alpha, \ ctype* x, inc_t incx, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - cntx_t* cntx \ + ctype* a, inc_t rs_a, inc_t cs_a \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEFR( her ) -// her2 (and syr2) +// syr #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + uplo_t uploa, \ + conj_t conjx, \ + dim_t m, \ + ctype* alpha, \ + ctype* x, inc_t incx, \ + ctype* a, inc_t rs_a, inc_t cs_a \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEF( syr ) + +// her2, syr2 + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ uplo_t uploa, \ conj_t conjx, \ conj_t conjy, \ - conj_t conjh, \ dim_t m, \ ctype* alpha, \ ctype* x, inc_t incx, \ ctype* y, inc_t incy, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - cntx_t* cntx \ + ctype* a, inc_t rs_a, inc_t cs_a \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( her2 ) +INSERT_GENTDEF( syr2 ) -// trmv (and trsv) +// trmv, trsv #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ ( \ uplo_t uploa, \ trans_t transa, \ @@ -156,11 +170,10 @@ typedef void (*PASTECH2(ch,opname,tsuf)) \ dim_t m, \ ctype* alpha, \ ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* x, inc_t incx, \ - cntx_t* cntx \ + ctype* x, inc_t incx \ + BLIS_TAPI_EX_PARAMS \ ); INSERT_GENTDEF( trmv ) +INSERT_GENTDEF( trsv ) - -#endif diff --git a/frame/2/bli_l2_ft_unb.h b/frame/2/bli_l2_ft_unb.h new file mode 100644 index 000000000..2ac3a722e --- /dev/null +++ b/frame/2/bli_l2_ft_unb.h @@ -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_L2_FT_UNB_H +#define BLIS_L2_FT_UNB_H + + +// +// -- Level-2 function types --------------------------------------------------- +// + +// gemv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_unb,tsuf)) \ + ( \ + trans_t transa, \ + conj_t conjx, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* x, inc_t incx, \ + ctype* beta, \ + ctype* y, inc_t incy, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( gemv ) + +// ger + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_unb,tsuf)) \ + ( \ + conj_t conjx, \ + conj_t conjy, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( ger ) + +// hemv (and symv) + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_unb,tsuf)) \ + ( \ + uplo_t uploa, \ + conj_t conja, \ + conj_t conjx, \ + conj_t conjh, \ + dim_t m, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* x, inc_t incx, \ + ctype* beta, \ + ctype* y, inc_t incy, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( hemv ) + +// her (and syr) + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_unb,tsuf)) \ + ( \ + uplo_t uploa, \ + conj_t conjx, \ + conj_t conjh, \ + dim_t m, \ + ctype* alpha, /* complex alpha allows her variants to also perform syr. */ \ + ctype* x, inc_t incx, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEFR( her ) + +// her2 (and syr2) + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_unb,tsuf)) \ + ( \ + uplo_t uploa, \ + conj_t conjx, \ + conj_t conjy, \ + conj_t conjh, \ + dim_t m, \ + ctype* alpha, \ + ctype* x, inc_t incx, \ + ctype* y, inc_t incy, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( her2 ) + +// trmv (and trsv) + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_unb,tsuf)) \ + ( \ + uplo_t uploa, \ + trans_t transa, \ + diag_t diaga, \ + dim_t m, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* x, inc_t incx, \ + cntx_t* cntx \ + ); + +INSERT_GENTDEF( trmv ) +INSERT_GENTDEF( trsv ) + + +#endif diff --git a/frame/2/bli_l2_oapi.c b/frame/2/bli_l2_oapi.c index 77a88046e..1a764e900 100644 --- a/frame/2/bli_l2_oapi.c +++ b/frame/2/bli_l2_oapi.c @@ -89,11 +89,13 @@ void PASTEMAC(opname,EX_SUF) \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ buf_beta = bli_obj_buffer_for_1x1( dt, &beta_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_15 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ transa, \ conjx, \ m, \ @@ -154,11 +156,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_14 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ conjx, \ conjy, \ m, \ @@ -224,11 +228,13 @@ void PASTEMAC(opname,EX_SUF) \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ buf_beta = bli_obj_buffer_for_1x1( dt, &beta_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_15 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ uploa, \ conja, \ conjx, \ @@ -286,11 +292,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_11 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ uploa, \ conjx, \ m, \ @@ -349,11 +357,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_14 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ uploa, \ conjx, \ conjy, \ @@ -411,11 +421,13 @@ void PASTEMAC(opname,EX_SUF) \ alpha, &alpha_local ); \ buf_alpha = bli_obj_buffer_for_1x1( dt, &alpha_local ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_12 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ uploa, \ transa, \ diaga, \ diff --git a/frame/2/bli_l2_tapi.c b/frame/2/bli_l2_tapi.c index bb38d661a..9b040b48f 100644 --- a/frame/2/bli_l2_tapi.c +++ b/frame/2/bli_l2_tapi.c @@ -89,7 +89,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ } \ \ /* Declare a void function pointer for the current operation. */ \ - PASTECH2(ch,ftname,_ft) f; \ + PASTECH2(ch,ftname,_unb_ft) f; \ \ /* Choose the underlying implementation. */ \ if ( bli_does_notrans( transa ) ) \ @@ -105,18 +105,19 @@ void PASTEMAC2(ch,opname,EX_SUF) \ \ /* Invoke the variant chosen above, which loops over a level-1v or level-1f kernel to implement the current operation. */ \ - f( \ - transa, \ - conjx, \ - m, \ - n, \ - alpha, \ - a, rs_a, cs_a, \ - x, incx, \ - beta, \ - y, incy, \ - cntx \ - ); \ + f \ + ( \ + transa, \ + conjx, \ + m, \ + n, \ + alpha, \ + a, rs_a, cs_a, \ + x, incx, \ + beta, \ + y, incy, \ + cntx \ + ); \ } INSERT_GENTFUNC_BASIC3( gemv, gemv, gemv_unf_var1, gemv_unf_var2 ) @@ -149,7 +150,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Declare a void function pointer for the current operation. */ \ - PASTECH2(ch,ftname,_ft) f; \ + PASTECH2(ch,ftname,_unb_ft) f; \ \ /* Choose the underlying implementation. */ \ if ( bli_is_row_stored( rs_a, cs_a ) ) f = PASTEMAC(ch,rvarname); \ @@ -157,17 +158,18 @@ void PASTEMAC2(ch,opname,EX_SUF) \ \ /* Invoke the variant chosen above, which loops over a level-1v or level-1f kernel to implement the current operation. */ \ - f( \ - conjx, \ - conjy, \ - m, \ - n, \ - alpha, \ - x, incx, \ - y, incy, \ - a, rs_a, cs_a, \ - cntx \ - ); \ + f \ + ( \ + conjx, \ + conjy, \ + m, \ + n, \ + alpha, \ + x, incx, \ + y, incy, \ + a, rs_a, cs_a, \ + cntx \ + ); \ } INSERT_GENTFUNC_BASIC3( ger, ger, ger_unb_var1, ger_unb_var2 ) @@ -214,7 +216,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ } \ \ /* Declare a void function pointer for the current operation. */ \ - PASTECH2(ch,ftname,_ft) f; \ + PASTECH2(ch,ftname,_unb_ft) f; \ \ /* Choose the underlying implementation. */ \ if ( bli_is_lower( uploa ) ) \ @@ -230,19 +232,20 @@ void PASTEMAC2(ch,opname,EX_SUF) \ \ /* Invoke the variant chosen above, which loops over a level-1v or level-1f kernel to implement the current operation. */ \ - f( \ - uploa, \ - conja, \ - conjx, \ - conjh, /* used by variants to distinguish hemv from symv */ \ - m, \ - alpha, \ - a, rs_a, cs_a, \ - x, incx, \ - beta, \ - y, incy, \ - cntx \ - ); \ + f \ + ( \ + uploa, \ + conja, \ + conjx, \ + conjh, /* used by variants to distinguish hemv from symv */ \ + m, \ + alpha, \ + a, rs_a, cs_a, \ + x, incx, \ + beta, \ + y, incy, \ + cntx \ + ); \ } INSERT_GENTFUNC_BASIC4( hemv, hemv, BLIS_CONJUGATE, hemv_unf_var1, hemv_unf_var3 ) @@ -281,7 +284,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Declare a void function pointer for the current operation. */ \ - PASTECH2(ch,ftname,_ft) f; \ + PASTECH2(ch,ftname,_unb_ft) f; \ \ /* Choose the underlying implementation. */ \ if ( bli_is_lower( uploa ) ) \ @@ -297,16 +300,17 @@ void PASTEMAC2(ch,opname,EX_SUF) \ \ /* Invoke the variant chosen above, which loops over a level-1v or level-1f kernel to implement the current operation. */ \ - f( \ - uploa, \ - conjx, \ - conjh, /* used by variants to distinguish her from syr */ \ - m, \ - &alpha_local, \ - x, incx, \ - a, rs_a, cs_a, \ - cntx \ - ); \ + f \ + ( \ + uploa, \ + conjx, \ + conjh, /* used by variants to distinguish her from syr */ \ + m, \ + &alpha_local, \ + x, incx, \ + a, rs_a, cs_a, \ + cntx \ + ); \ } INSERT_GENTFUNCR_BASIC4( her, her, BLIS_CONJUGATE, her_unb_var1, her_unb_var2 ) @@ -337,7 +341,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Declare a void function pointer for the current operation. */ \ - PASTECH2(ch,ftname,_ft) f; \ + PASTECH2(ch,ftname,_unb_ft) f; \ \ /* Choose the underlying implementation. */ \ if ( bli_is_lower( uploa ) ) \ @@ -353,16 +357,17 @@ void PASTEMAC2(ch,opname,EX_SUF) \ \ /* Invoke the variant chosen above, which loops over a level-1v or level-1f kernel to implement the current operation. */ \ - f( \ - uploa, \ - conjx, \ - conjh, /* used by variants to distinguish her2 from syr2 */ \ - m, \ - alpha, \ - x, incx, \ - a, rs_a, cs_a, \ - cntx \ - ); \ + f \ + ( \ + uploa, \ + conjx, \ + conjh, /* used by variants to distinguish her2 from syr2 */ \ + m, \ + alpha, \ + x, incx, \ + a, rs_a, cs_a, \ + cntx \ + ); \ } INSERT_GENTFUNC_BASIC4( syr, her, BLIS_NO_CONJUGATE, her_unb_var1, her_unb_var2 ) @@ -395,7 +400,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Declare a void function pointer for the current operation. */ \ - PASTECH2(ch,ftname,_ft) f; \ + PASTECH2(ch,ftname,_unb_ft) f; \ \ /* Choose the underlying implementation. */ \ if ( bli_is_lower( uploa ) ) \ @@ -411,18 +416,19 @@ void PASTEMAC2(ch,opname,EX_SUF) \ \ /* Invoke the variant chosen above, which loops over a level-1v or level-1f kernel to implement the current operation. */ \ - f( \ - uploa, \ - conjx, \ - conjy, \ - conjh, \ - m, \ - alpha, \ - x, incx, \ - y, incy, \ - a, rs_a, cs_a, \ - cntx \ - ); \ + f \ + ( \ + uploa, \ + conjx, \ + conjy, \ + conjh, \ + m, \ + alpha, \ + x, incx, \ + y, incy, \ + a, rs_a, cs_a, \ + cntx \ + ); \ } INSERT_GENTFUNC_BASIC4( her2, her2, BLIS_CONJUGATE, her2_unf_var1, her2_unf_var4 ) @@ -470,7 +476,7 @@ void PASTEMAC2(ch,opname,EX_SUF) \ } \ \ /* Declare a void function pointer for the current operation. */ \ - PASTECH2(ch,ftname,_ft) f; \ + PASTECH2(ch,ftname,_unb_ft) f; \ \ /* Choose the underlying implementation. */ \ if ( bli_does_notrans( transa ) ) \ @@ -486,16 +492,17 @@ void PASTEMAC2(ch,opname,EX_SUF) \ \ /* Invoke the variant chosen above, which loops over a level-1v or level-1f kernel to implement the current operation. */ \ - f( \ - uploa, \ - transa, \ - diaga, \ - m, \ - alpha, \ - a, rs_a, cs_a, \ - x, incx, \ - cntx \ - ); \ + f \ + ( \ + uploa, \ + transa, \ + diaga, \ + m, \ + alpha, \ + a, rs_a, cs_a, \ + x, incx, \ + cntx \ + ); \ } INSERT_GENTFUNC_BASIC3( trmv, trmv, trmv_unf_var1, trmv_unf_var2 ) diff --git a/frame/2/gemv/bli_gemv_unb_var1.c b/frame/2/gemv/bli_gemv_unb_var1.c index 5b147dc50..b721a0b6c 100644 --- a/frame/2/gemv/bli_gemv_unb_var1.c +++ b/frame/2/gemv/bli_gemv_unb_var1.c @@ -67,7 +67,7 @@ void PASTEMAC(ch,varname) \ \ conja = bli_extract_conj( transa ); \ \ - PASTECH(ch,dotxv_ft) kfp_dv; \ + PASTECH(ch,dotxv_ker_ft) kfp_dv; \ \ /* Query the context for the kernel function pointer. */ \ kfp_dv = bli_cntx_get_l1v_ker_dt( dt, BLIS_DOTXV_KER, cntx ); \ diff --git a/frame/2/gemv/bli_gemv_unb_var2.c b/frame/2/gemv/bli_gemv_unb_var2.c index 6a51d5b57..7df7e06b5 100644 --- a/frame/2/gemv/bli_gemv_unb_var2.c +++ b/frame/2/gemv/bli_gemv_unb_var2.c @@ -97,7 +97,7 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/gemv/bli_gemv_unf_var1.c b/frame/2/gemv/bli_gemv_unf_var1.c index 89904597c..3448061c1 100644 --- a/frame/2/gemv/bli_gemv_unf_var1.c +++ b/frame/2/gemv/bli_gemv_unf_var1.c @@ -68,7 +68,7 @@ void PASTEMAC(ch,varname) \ \ conja = bli_extract_conj( transa ); \ \ - PASTECH(ch,dotxf_ft) kfp_df; \ + PASTECH(ch,dotxf_ker_ft) kfp_df; \ \ /* Query the context for the kernel function pointer and fusing factor. */ \ kfp_df = bli_cntx_get_l1f_ker_dt( dt, BLIS_DOTXF_KER, cntx ); \ diff --git a/frame/2/gemv/bli_gemv_unf_var2.c b/frame/2/gemv/bli_gemv_unf_var2.c index 9ebe52c78..b99c479be 100644 --- a/frame/2/gemv/bli_gemv_unf_var2.c +++ b/frame/2/gemv/bli_gemv_unf_var2.c @@ -97,7 +97,7 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,axpyf_ft) kfp_af; \ + PASTECH(ch,axpyf_ker_ft) kfp_af; \ \ /* Query the context for the kernel function pointer and fusing factor. */ \ kfp_af = bli_cntx_get_l1f_ker_dt( dt, BLIS_AXPYF_KER, cntx ); \ diff --git a/frame/2/gemv/bli_gemv_var_oapi.c b/frame/2/gemv/bli_gemv_var_oapi.c index 322181f03..54b7fab2f 100644 --- a/frame/2/gemv/bli_gemv_var_oapi.c +++ b/frame/2/gemv/bli_gemv_var_oapi.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENFRONT -#define GENFRONT( opname ) \ +#define GENFRONT( opname, varname ) \ \ -void PASTEMAC0(opname) \ +void PASTEMAC0(varname) \ ( \ obj_t* alpha, \ obj_t* a, \ @@ -71,11 +71,13 @@ void PASTEMAC0(opname) \ void* buf_alpha = bli_obj_buffer_for_1x1( dt, alpha ); \ void* buf_beta = bli_obj_buffer_for_1x1( dt, beta ); \ \ - /* Invoke the void pointer-based function for the given datatype. */ \ - bli_call_ft_14 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,_unb,_vft) f = \ + PASTEMAC(varname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ transa, \ conjx, \ m, \ @@ -89,9 +91,9 @@ void PASTEMAC0(opname) \ ); \ } \ -GENFRONT( gemv_unb_var1 ) -GENFRONT( gemv_unb_var2 ) +GENFRONT( gemv, gemv_unb_var1 ) +GENFRONT( gemv, gemv_unb_var2 ) -GENFRONT( gemv_unf_var1 ) -GENFRONT( gemv_unf_var2 ) +GENFRONT( gemv, gemv_unf_var1 ) +GENFRONT( gemv, gemv_unf_var2 ) diff --git a/frame/2/ger/bli_ger_unb_var1.c b/frame/2/ger/bli_ger_unb_var1.c index 1dee4ce83..50bcaf065 100644 --- a/frame/2/ger/bli_ger_unb_var1.c +++ b/frame/2/ger/bli_ger_unb_var1.c @@ -58,7 +58,7 @@ void PASTEMAC(ch,varname) \ ctype alpha_chi1; \ dim_t i; \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/ger/bli_ger_unb_var2.c b/frame/2/ger/bli_ger_unb_var2.c index afdbd363d..cc3e1a5a0 100644 --- a/frame/2/ger/bli_ger_unb_var2.c +++ b/frame/2/ger/bli_ger_unb_var2.c @@ -58,7 +58,7 @@ void PASTEMAC(ch,varname) \ ctype alpha_psi1; \ dim_t j; \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/ger/bli_ger_var_oapi.c b/frame/2/ger/bli_ger_var_oapi.c index f04b74838..949dc37d1 100644 --- a/frame/2/ger/bli_ger_var_oapi.c +++ b/frame/2/ger/bli_ger_var_oapi.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENFRONT -#define GENFRONT( opname ) \ +#define GENFRONT( opname, varname ) \ \ -void PASTEMAC0(opname) \ +void PASTEMAC0(varname) \ ( \ obj_t* alpha, \ obj_t* x, \ @@ -69,11 +69,13 @@ void PASTEMAC0(opname) \ \ void* buf_alpha = bli_obj_buffer_for_1x1( dt, alpha ); \ \ - /* Invoke the void pointer-based function for the given datatype. */ \ - bli_call_ft_13 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,_unb,_vft) f = \ + PASTEMAC(varname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ conjx, \ conjy, \ m, \ @@ -86,6 +88,6 @@ void PASTEMAC0(opname) \ ); \ } \ -GENFRONT( ger_unb_var1 ) -GENFRONT( ger_unb_var2 ) +GENFRONT( ger, ger_unb_var1 ) +GENFRONT( ger, ger_unb_var2 ) diff --git a/frame/2/hemv/bli_hemv_unb_var1.c b/frame/2/hemv/bli_hemv_unb_var1.c index 949a2a8a4..e9f24c1e9 100644 --- a/frame/2/hemv/bli_hemv_unb_var1.c +++ b/frame/2/hemv/bli_hemv_unb_var1.c @@ -118,8 +118,8 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ - PASTECH(ch,dotxv_ft) kfp_dv; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ + PASTECH(ch,dotxv_ker_ft) kfp_dv; \ \ /* Query the context for the kernel function pointers. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/hemv/bli_hemv_unb_var2.c b/frame/2/hemv/bli_hemv_unb_var2.c index 917b2cd43..a9e55f007 100644 --- a/frame/2/hemv/bli_hemv_unb_var2.c +++ b/frame/2/hemv/bli_hemv_unb_var2.c @@ -120,7 +120,7 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,dotxv_ft) kfp_dv; \ + PASTECH(ch,dotxv_ker_ft) kfp_dv; \ \ /* Query the context for the kernel function pointer. */ \ kfp_dv = bli_cntx_get_l1v_ker_dt( dt, BLIS_DOTXV_KER, cntx ); \ diff --git a/frame/2/hemv/bli_hemv_unb_var3.c b/frame/2/hemv/bli_hemv_unb_var3.c index 8c25a806c..b16e2ed60 100644 --- a/frame/2/hemv/bli_hemv_unb_var3.c +++ b/frame/2/hemv/bli_hemv_unb_var3.c @@ -118,8 +118,8 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ - PASTECH(ch,dotxv_ft) kfp_dv; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ + PASTECH(ch,dotxv_ker_ft) kfp_dv; \ \ /* Query the context for the kernel function pointers. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/hemv/bli_hemv_unb_var4.c b/frame/2/hemv/bli_hemv_unb_var4.c index 6d7ebac14..23ab6efa6 100644 --- a/frame/2/hemv/bli_hemv_unb_var4.c +++ b/frame/2/hemv/bli_hemv_unb_var4.c @@ -119,7 +119,7 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointers. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/hemv/bli_hemv_unf_var1.c b/frame/2/hemv/bli_hemv_unf_var1.c index 5086d1c28..5033a0b46 100644 --- a/frame/2/hemv/bli_hemv_unf_var1.c +++ b/frame/2/hemv/bli_hemv_unf_var1.c @@ -127,7 +127,7 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,dotxaxpyf_ft) kfp_xf; \ + PASTECH(ch,dotxaxpyf_ker_ft) kfp_xf; \ \ /* Query the context for the kernel function pointer and fusing factor. */ \ kfp_xf = bli_cntx_get_l1f_ker_dt( dt, BLIS_DOTXAXPYF_KER, cntx ); \ diff --git a/frame/2/hemv/bli_hemv_unf_var1a.c b/frame/2/hemv/bli_hemv_unf_var1a.c index a87ff00ad..e1c812c54 100644 --- a/frame/2/hemv/bli_hemv_unf_var1a.c +++ b/frame/2/hemv/bli_hemv_unf_var1a.c @@ -118,7 +118,7 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,dotaxpyv_ft) kfp_vf; \ + PASTECH(ch,dotaxpyv_ker_ft) kfp_vf; \ \ /* Query the context for the kernel function pointer. */ \ kfp_vf = bli_cntx_get_l1f_ker_dt( dt, BLIS_DOTAXPYV_KER, cntx ); \ diff --git a/frame/2/hemv/bli_hemv_unf_var3.c b/frame/2/hemv/bli_hemv_unf_var3.c index 72a2611da..977fe4aeb 100644 --- a/frame/2/hemv/bli_hemv_unf_var3.c +++ b/frame/2/hemv/bli_hemv_unf_var3.c @@ -127,7 +127,7 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,dotxaxpyf_ft) kfp_xf; \ + PASTECH(ch,dotxaxpyf_ker_ft) kfp_xf; \ \ /* Query the context for the kernel function pointer and fusing factor. */ \ kfp_xf = bli_cntx_get_l1f_ker_dt( dt, BLIS_DOTXAXPYF_KER, cntx ); \ diff --git a/frame/2/hemv/bli_hemv_unf_var3a.c b/frame/2/hemv/bli_hemv_unf_var3a.c index 7787c4e13..7ac607c74 100644 --- a/frame/2/hemv/bli_hemv_unf_var3a.c +++ b/frame/2/hemv/bli_hemv_unf_var3a.c @@ -118,7 +118,7 @@ void PASTEMAC(ch,varname) \ ); \ } \ \ - PASTECH(ch,dotaxpyv_ft) kfp_vf; \ + PASTECH(ch,dotaxpyv_ker_ft) kfp_vf; \ \ /* Query the context for the kernel function pointer. */ \ kfp_vf = bli_cntx_get_l1f_ker_dt( dt, BLIS_DOTAXPYV_KER, cntx ); \ diff --git a/frame/2/hemv/bli_hemv_var_oapi.c b/frame/2/hemv/bli_hemv_var_oapi.c index e5a1bd2f3..9c591ccd5 100644 --- a/frame/2/hemv/bli_hemv_var_oapi.c +++ b/frame/2/hemv/bli_hemv_var_oapi.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENFRONT -#define GENFRONT( opname ) \ +#define GENFRONT( opname, varname ) \ \ -void PASTEMAC0(opname) \ +void PASTEMAC0(varname) \ ( \ conj_t conjh, \ obj_t* alpha, \ @@ -72,11 +72,13 @@ void PASTEMAC0(opname) \ void* buf_alpha = bli_obj_buffer_for_1x1( dt, alpha ); \ void* buf_beta = bli_obj_buffer_for_1x1( dt, beta ); \ \ - /* Invoke the void pointer-based function for the given datatype. */ \ - bli_call_ft_15 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,_unb,_vft) f = \ + PASTEMAC(varname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ uplo, \ conja, \ conjx, \ @@ -91,13 +93,13 @@ void PASTEMAC0(opname) \ ); \ } \ -GENFRONT( hemv_unb_var1 ) -GENFRONT( hemv_unb_var2 ) -GENFRONT( hemv_unb_var3 ) -GENFRONT( hemv_unb_var4 ) +GENFRONT( hemv, hemv_unb_var1 ) +GENFRONT( hemv, hemv_unb_var2 ) +GENFRONT( hemv, hemv_unb_var3 ) +GENFRONT( hemv, hemv_unb_var4 ) -GENFRONT( hemv_unf_var1 ) -GENFRONT( hemv_unf_var3 ) -GENFRONT( hemv_unf_var1a ) -GENFRONT( hemv_unf_var3a ) +GENFRONT( hemv, hemv_unf_var1 ) +GENFRONT( hemv, hemv_unf_var3 ) +GENFRONT( hemv, hemv_unf_var1a ) +GENFRONT( hemv, hemv_unf_var3a ) diff --git a/frame/2/her/bli_her_unb_var1.c b/frame/2/her/bli_her_unb_var1.c index 63216caea..2eea6bd7e 100644 --- a/frame/2/her/bli_her_unb_var1.c +++ b/frame/2/her/bli_her_unb_var1.c @@ -100,7 +100,7 @@ void PASTEMAC(ch,varname) \ conj0 = conjx; \ conj1 = bli_apply_conj( conjh, conjx ); \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/her/bli_her_unb_var2.c b/frame/2/her/bli_her_unb_var2.c index 4967f4df5..802d50581 100644 --- a/frame/2/her/bli_her_unb_var2.c +++ b/frame/2/her/bli_her_unb_var2.c @@ -100,7 +100,7 @@ void PASTEMAC(ch,varname) \ conj0 = bli_apply_conj( conjh, conjx ); \ conj1 = conjx; \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/her/bli_her_var_oapi.c b/frame/2/her/bli_her_var_oapi.c index 6cbc401d3..d1f66da62 100644 --- a/frame/2/her/bli_her_var_oapi.c +++ b/frame/2/her/bli_her_var_oapi.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENFRONT -#define GENFRONT( opname ) \ +#define GENFRONT( opname, varname ) \ \ -void PASTEMAC0(opname) \ +void PASTEMAC0(varname) \ ( \ conj_t conjh, \ obj_t* alpha, \ @@ -65,11 +65,13 @@ void PASTEMAC0(opname) \ \ void* buf_alpha = bli_obj_buffer_for_1x1( dt, alpha ); \ \ - /* Invoke the void pointer-based function for the given datatype. */ \ - bli_call_ft_11 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,_unb,_vft) f = \ + PASTEMAC(varname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ uplo, \ conjx, \ conjh, \ @@ -81,6 +83,6 @@ void PASTEMAC0(opname) \ ); \ } \ -GENFRONT( her_unb_var1 ) -GENFRONT( her_unb_var2 ) +GENFRONT( her, her_unb_var1 ) +GENFRONT( her, her_unb_var2 ) diff --git a/frame/2/her2/bli_her2_unb_var1.c b/frame/2/her2/bli_her2_unb_var1.c index e686f3b39..99be4f38f 100644 --- a/frame/2/her2/bli_her2_unb_var1.c +++ b/frame/2/her2/bli_her2_unb_var1.c @@ -103,7 +103,7 @@ void PASTEMAC(ch,varname) \ conj0 = bli_apply_conj( conjh, conjy ); \ conj1 = bli_apply_conj( conjh, conjx ); \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/her2/bli_her2_unb_var2.c b/frame/2/her2/bli_her2_unb_var2.c index d61a41240..eb09da21d 100644 --- a/frame/2/her2/bli_her2_unb_var2.c +++ b/frame/2/her2/bli_her2_unb_var2.c @@ -110,7 +110,7 @@ void PASTEMAC(ch,varname) \ conj1 = bli_apply_conj( conjh, conjx ); \ conjh_conjy = bli_apply_conj( conjh, conjy ); \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/her2/bli_her2_unb_var3.c b/frame/2/her2/bli_her2_unb_var3.c index 8ffe8ab17..1c391ac47 100644 --- a/frame/2/her2/bli_her2_unb_var3.c +++ b/frame/2/her2/bli_her2_unb_var3.c @@ -110,7 +110,7 @@ void PASTEMAC(ch,varname) \ conj1 = conjy; \ conjh_conjx = bli_apply_conj( conjh, conjx ); \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/her2/bli_her2_unb_var4.c b/frame/2/her2/bli_her2_unb_var4.c index aa862835c..89436b42b 100644 --- a/frame/2/her2/bli_her2_unb_var4.c +++ b/frame/2/her2/bli_her2_unb_var4.c @@ -111,7 +111,7 @@ void PASTEMAC(ch,varname) \ conjh_conjx = bli_apply_conj( conjh, conjx ); \ conjh_conjy = bli_apply_conj( conjh, conjy ); \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/her2/bli_her2_unf_var1.c b/frame/2/her2/bli_her2_unf_var1.c index bbf72dda4..f531086db 100644 --- a/frame/2/her2/bli_her2_unf_var1.c +++ b/frame/2/her2/bli_her2_unf_var1.c @@ -103,7 +103,7 @@ void PASTEMAC(ch,varname) \ conj0 = bli_apply_conj( conjh, conjy ); \ conj1 = bli_apply_conj( conjh, conjx ); \ \ - PASTECH(ch,axpy2v_ft) kfp_2v; \ + PASTECH(ch,axpy2v_ker_ft) kfp_2v; \ \ /* Query the context for the kernel function pointer. */ \ kfp_2v = bli_cntx_get_l1f_ker_dt( dt, BLIS_AXPY2V_KER, cntx ); \ diff --git a/frame/2/her2/bli_her2_unf_var4.c b/frame/2/her2/bli_her2_unf_var4.c index 8aed732cb..7ad5e3c05 100644 --- a/frame/2/her2/bli_her2_unf_var4.c +++ b/frame/2/her2/bli_her2_unf_var4.c @@ -111,7 +111,7 @@ void PASTEMAC(ch,varname) \ conjh_conjx = bli_apply_conj( conjh, conjx ); \ conjh_conjy = bli_apply_conj( conjh, conjy ); \ \ - PASTECH(ch,axpy2v_ft) kfp_2v; \ + PASTECH(ch,axpy2v_ker_ft) kfp_2v; \ \ /* Query the context for the kernel function pointer. */ \ kfp_2v = bli_cntx_get_l1f_ker_dt( dt, BLIS_AXPY2V_KER, cntx ); \ diff --git a/frame/2/her2/bli_her2_var_oapi.c b/frame/2/her2/bli_her2_var_oapi.c index d8d193a84..8afc9ff48 100644 --- a/frame/2/her2/bli_her2_var_oapi.c +++ b/frame/2/her2/bli_her2_var_oapi.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENFRONT -#define GENFRONT( opname ) \ +#define GENFRONT( opname, varname ) \ \ -void PASTEMAC0(opname) \ +void PASTEMAC0(varname) \ ( \ conj_t conjh, \ obj_t* alpha, \ @@ -71,11 +71,13 @@ void PASTEMAC0(opname) \ \ void* buf_alpha = bli_obj_buffer_for_1x1( dt, alpha ); \ \ - /* Invoke the void pointer-based function for the given datatype. */ \ - bli_call_ft_14 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,_unb,_vft) f = \ + PASTEMAC(varname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ uplo, \ conjx, \ conjy, \ @@ -89,11 +91,11 @@ void PASTEMAC0(opname) \ ); \ } \ -GENFRONT( her2_unb_var1 ) -GENFRONT( her2_unb_var2 ) -GENFRONT( her2_unb_var3 ) -GENFRONT( her2_unb_var4 ) +GENFRONT( her2, her2_unb_var1 ) +GENFRONT( her2, her2_unb_var2 ) +GENFRONT( her2, her2_unb_var3 ) +GENFRONT( her2, her2_unb_var4 ) -GENFRONT( her2_unf_var1 ) -GENFRONT( her2_unf_var4 ) +GENFRONT( her2, her2_unf_var1 ) +GENFRONT( her2, her2_unf_var4 ) diff --git a/frame/2/trmv/bli_trmv_unb_var1.c b/frame/2/trmv/bli_trmv_unb_var1.c index 89df4f86e..a8bcb258c 100644 --- a/frame/2/trmv/bli_trmv_unb_var1.c +++ b/frame/2/trmv/bli_trmv_unb_var1.c @@ -80,7 +80,7 @@ void PASTEMAC(ch,varname) \ \ conja = bli_extract_conj( transa ); \ \ - PASTECH(ch,dotv_ft) kfp_dv; \ + PASTECH(ch,dotv_ker_ft) kfp_dv; \ \ /* Query the context for the kernel function pointer. */ \ kfp_dv = bli_cntx_get_l1v_ker_dt( dt, BLIS_DOTV_KER, cntx ); \ diff --git a/frame/2/trmv/bli_trmv_unb_var2.c b/frame/2/trmv/bli_trmv_unb_var2.c index 06d39b485..c350d044c 100644 --- a/frame/2/trmv/bli_trmv_unb_var2.c +++ b/frame/2/trmv/bli_trmv_unb_var2.c @@ -80,7 +80,7 @@ void PASTEMAC(ch,varname) \ \ conja = bli_extract_conj( transa ); \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/trmv/bli_trmv_unf_var1.c b/frame/2/trmv/bli_trmv_unf_var1.c index fa60afa6f..aa3a453e4 100644 --- a/frame/2/trmv/bli_trmv_unf_var1.c +++ b/frame/2/trmv/bli_trmv_unf_var1.c @@ -88,7 +88,7 @@ void PASTEMAC(ch,varname) \ \ conja = bli_extract_conj( transa ); \ \ - PASTECH(ch,dotxf_ft) kfp_df; \ + PASTECH(ch,dotxf_ker_ft) kfp_df; \ \ /* Query the context for the kernel function pointer and fusing factor. */ \ kfp_df = bli_cntx_get_l1f_ker_dt( dt, BLIS_DOTXF_KER, cntx ); \ diff --git a/frame/2/trmv/bli_trmv_unf_var2.c b/frame/2/trmv/bli_trmv_unf_var2.c index 42e8587b8..f1a547844 100644 --- a/frame/2/trmv/bli_trmv_unf_var2.c +++ b/frame/2/trmv/bli_trmv_unf_var2.c @@ -87,7 +87,7 @@ void PASTEMAC(ch,varname) \ \ conja = bli_extract_conj( transa ); \ \ - PASTECH(ch,axpyf_ft) kfp_af; \ + PASTECH(ch,axpyf_ker_ft) kfp_af; \ \ /* Query the context for the kernel function pointer and fusing factor. */ \ kfp_af = bli_cntx_get_l1f_ker_dt( dt, BLIS_AXPYF_KER, cntx ); \ diff --git a/frame/2/trmv/bli_trmv_var_oapi.c b/frame/2/trmv/bli_trmv_var_oapi.c index c6b76bc88..040130b45 100644 --- a/frame/2/trmv/bli_trmv_var_oapi.c +++ b/frame/2/trmv/bli_trmv_var_oapi.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENFRONT -#define GENFRONT( opname ) \ +#define GENFRONT( opname, varname ) \ \ -void PASTEMAC0(opname) \ +void PASTEMAC0(varname) \ ( \ obj_t* alpha, \ obj_t* a, \ @@ -65,11 +65,13 @@ void PASTEMAC0(opname) \ \ void* buf_alpha = bli_obj_buffer_for_1x1( dt, alpha ); \ \ - /* Invoke the void pointer-based function for the given datatype. */ \ - bli_call_ft_11 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,_unb,_vft) f = \ + PASTEMAC(varname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ uploa, \ transa, \ diaga, \ @@ -81,9 +83,9 @@ void PASTEMAC0(opname) \ ); \ } \ -GENFRONT( trmv_unb_var1 ) -GENFRONT( trmv_unb_var2 ) +GENFRONT( trmv, trmv_unb_var1 ) +GENFRONT( trmv, trmv_unb_var2 ) -GENFRONT( trmv_unf_var1 ) -GENFRONT( trmv_unf_var2 ) +GENFRONT( trmv, trmv_unf_var1 ) +GENFRONT( trmv, trmv_unf_var2 ) diff --git a/frame/2/trsv/bli_trsv_unb_var1.c b/frame/2/trsv/bli_trsv_unb_var1.c index 67f1a3335..bceaca12a 100644 --- a/frame/2/trsv/bli_trsv_unb_var1.c +++ b/frame/2/trsv/bli_trsv_unb_var1.c @@ -91,7 +91,7 @@ void PASTEMAC(ch,varname) \ NULL \ ); \ \ - PASTECH(ch,dotv_ft) kfp_tv; \ + PASTECH(ch,dotv_ker_ft) kfp_tv; \ \ /* Query the context for the kernel function pointer. */ \ kfp_tv = bli_cntx_get_l1v_ker_dt( dt, BLIS_DOTV_KER, cntx ); \ diff --git a/frame/2/trsv/bli_trsv_unb_var2.c b/frame/2/trsv/bli_trsv_unb_var2.c index 8b42809a8..372211511 100644 --- a/frame/2/trsv/bli_trsv_unb_var2.c +++ b/frame/2/trsv/bli_trsv_unb_var2.c @@ -91,7 +91,7 @@ void PASTEMAC(ch,varname) \ NULL \ ); \ \ - PASTECH(ch,axpyv_ft) kfp_av; \ + PASTECH(ch,axpyv_ker_ft) kfp_av; \ \ /* Query the context for the kernel function pointer. */ \ kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ diff --git a/frame/2/trsv/bli_trsv_unf_var1.c b/frame/2/trsv/bli_trsv_unf_var1.c index 40991f990..423d564ee 100644 --- a/frame/2/trsv/bli_trsv_unf_var1.c +++ b/frame/2/trsv/bli_trsv_unf_var1.c @@ -100,7 +100,7 @@ void PASTEMAC(ch,varname) \ \ conja = bli_extract_conj( transa ); \ \ - PASTECH(ch,dotxf_ft) kfp_df; \ + PASTECH(ch,dotxf_ker_ft) kfp_df; \ \ /* Query the context for the kernel function pointer and fusing factor. */ \ kfp_df = bli_cntx_get_l1f_ker_dt( dt, BLIS_DOTXF_KER, cntx ); \ diff --git a/frame/2/trsv/bli_trsv_unf_var2.c b/frame/2/trsv/bli_trsv_unf_var2.c index 0c661816e..a674a359b 100644 --- a/frame/2/trsv/bli_trsv_unf_var2.c +++ b/frame/2/trsv/bli_trsv_unf_var2.c @@ -99,7 +99,7 @@ void PASTEMAC(ch,varname) \ \ conja = bli_extract_conj( transa ); \ \ - PASTECH(ch,axpyf_ft) kfp_af; \ + PASTECH(ch,axpyf_ker_ft) kfp_af; \ \ /* Query the context for the kernel function pointer and fusing factor. */ \ kfp_af = bli_cntx_get_l1f_ker_dt( dt, BLIS_AXPYF_KER, cntx ); \ diff --git a/frame/2/trsv/bli_trsv_var_oapi.c b/frame/2/trsv/bli_trsv_var_oapi.c index 64b6e6a1b..9e708e8e6 100644 --- a/frame/2/trsv/bli_trsv_var_oapi.c +++ b/frame/2/trsv/bli_trsv_var_oapi.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENFRONT -#define GENFRONT( opname ) \ +#define GENFRONT( opname, varname ) \ \ -void PASTEMAC0(opname) \ +void PASTEMAC0(varname) \ ( \ obj_t* alpha, \ obj_t* a, \ @@ -65,11 +65,13 @@ void PASTEMAC0(opname) \ \ void* buf_alpha = bli_obj_buffer_for_1x1( dt, alpha ); \ \ - /* Invoke the void pointer-based function for the given datatype. */ \ - bli_call_ft_11 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,_unb,_vft) f = \ + PASTEMAC(varname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ uploa, \ transa, \ diaga, \ @@ -81,9 +83,9 @@ void PASTEMAC0(opname) \ ); \ } \ -GENFRONT( trsv_unb_var1 ) -GENFRONT( trsv_unb_var2 ) +GENFRONT( trsv, trsv_unb_var1 ) +GENFRONT( trsv, trsv_unb_var2 ) -GENFRONT( trsv_unf_var1 ) -GENFRONT( trsv_unf_var2 ) +GENFRONT( trsv, trsv_unf_var1 ) +GENFRONT( trsv, trsv_unf_var2 ) diff --git a/frame/3/bli_l3.h b/frame/3/bli_l3.h index f8a55201a..3fa28baad 100644 --- a/frame/3/bli_l3.h +++ b/frame/3/bli_l3.h @@ -35,9 +35,11 @@ #include "bli_l3_cntl.h" #include "bli_l3_check.h" -#include "bli_l3_ft.h" +// Define function types. +#include "bli_l3_ft_ex.h" +#include "bli_l3_ft_ukr.h" #include "bli_l3_oft.h" -#include "bli_l3_voft.h" +#include "bli_l3_oft_var.h" #include "bli_l3_blocksize.h" #include "bli_l3_direct.h" @@ -47,20 +49,23 @@ // Prototype object APIs (expert and non-expert). #include "bli_oapi_ex.h" #include "bli_l3_oapi.h" + #include "bli_oapi_ba.h" #include "bli_l3_oapi.h" // Prototype typed APIs (expert and non-expert). #include "bli_tapi_ex.h" #include "bli_l3_tapi.h" + #include "bli_tapi_ba.h" #include "bli_l3_tapi.h" +// Prototype microkernel wrapper APIs #include "bli_l3_ukr_oapi.h" #include "bli_l3_ukr_tapi.h" -// Prototype reference micro-kernels. -//#include "bli_l3_ref.h" +// Generate function pointer arrays for tapi microkernel functions. +#include "bli_l3_ukr_fpa.h" // Operation-specific headers #include "bli_gemm.h" diff --git a/frame/3/bli_l3_ft_ex.h b/frame/3/bli_l3_ft_ex.h new file mode 100644 index 000000000..46fff86ef --- /dev/null +++ b/frame/3/bli_l3_ft_ex.h @@ -0,0 +1,236 @@ +/* + + 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_L3_FT_EX_H +#define BLIS_L3_FT_EX_H + + +// +// -- Level-3 expert function types -------------------------------------------- +// + +// gemm + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,BLIS_TAPI_EX_SUF,tsuf)) \ + ( \ + trans_t transa, \ + trans_t transb, \ + dim_t m, \ + dim_t n, \ + dim_t k, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* b, inc_t rs_b, inc_t cs_b, \ + ctype* beta, \ + ctype* c, inc_t rs_c, inc_t cs_c, \ + cntx_t* cntx, \ + rntm_t* rntm \ + ); + +INSERT_GENTDEF( gemm ) + + +// hemm, symm + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,BLIS_TAPI_EX_SUF,tsuf)) \ + ( \ + side_t side, \ + uplo_t uploa, \ + conj_t conja, \ + trans_t transb, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* b, inc_t rs_b, inc_t cs_b, \ + ctype* beta, \ + ctype* c, inc_t rs_c, inc_t cs_c, \ + cntx_t* cntx, \ + rntm_t* rntm \ + ); + +INSERT_GENTDEF( hemm ) +INSERT_GENTDEF( symm ) + + +// herk + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,BLIS_TAPI_EX_SUF,tsuf)) \ + ( \ + uplo_t uploc, \ + trans_t transa, \ + dim_t m, \ + dim_t k, \ + ctype_r* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype_r* beta, \ + ctype* c, inc_t rs_c, inc_t cs_c, \ + cntx_t* cntx, \ + rntm_t* rntm \ + ); + +INSERT_GENTDEFR( herk ) + + +// her2k + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,BLIS_TAPI_EX_SUF,tsuf)) \ + ( \ + uplo_t uploc, \ + trans_t transa, \ + trans_t transb, \ + dim_t m, \ + dim_t k, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* b, inc_t rs_b, inc_t cs_b, \ + ctype_r* beta, \ + ctype* c, inc_t rs_c, inc_t cs_c, \ + cntx_t* cntx, \ + rntm_t* rntm \ + ); + +INSERT_GENTDEFR( her2k ) + + +// syrk + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,BLIS_TAPI_EX_SUF,tsuf)) \ + ( \ + uplo_t uploc, \ + trans_t transa, \ + dim_t m, \ + dim_t k, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* beta, \ + ctype* c, inc_t rs_c, inc_t cs_c, \ + cntx_t* cntx, \ + rntm_t* rntm \ + ); + +INSERT_GENTDEFR( syrk ) + + +// syr2k + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,BLIS_TAPI_EX_SUF,tsuf)) \ + ( \ + uplo_t uploc, \ + trans_t transa, \ + trans_t transb, \ + dim_t m, \ + dim_t k, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* b, inc_t rs_b, inc_t cs_b, \ + ctype* beta, \ + ctype* c, inc_t rs_c, inc_t cs_c, \ + cntx_t* cntx, \ + rntm_t* rntm \ + ); + +INSERT_GENTDEF( syr2k ) + + +// trmm3 + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,BLIS_TAPI_EX_SUF,tsuf)) \ + ( \ + side_t side, \ + uplo_t uploa, \ + trans_t transa, \ + diag_t diaga, \ + trans_t transb, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* b, inc_t rs_b, inc_t cs_b, \ + ctype* beta, \ + ctype* c, inc_t rs_c, inc_t cs_c, \ + cntx_t* cntx, \ + rntm_t* rntm \ + ); + +INSERT_GENTDEF( trmm3 ) + + +// trmm + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,BLIS_TAPI_EX_SUF,tsuf)) \ + ( \ + side_t side, \ + uplo_t uploa, \ + trans_t transa, \ + diag_t diaga, \ + dim_t m, \ + dim_t n, \ + ctype* alpha, \ + ctype* a, inc_t rs_a, inc_t cs_a, \ + ctype* b, inc_t rs_b, inc_t cs_b, \ + cntx_t* cntx, \ + rntm_t* rntm \ + ); + +INSERT_GENTDEF( trmm ) +INSERT_GENTDEF( trsm ) + + +#endif + diff --git a/frame/3/bli_l3_ft.h b/frame/3/bli_l3_ft_ukr.h similarity index 89% rename from frame/3/bli_l3_ft.h rename to frame/3/bli_l3_ft_ukr.h index 5ca8c4475..8370db8e0 100644 --- a/frame/3/bli_l3_ft.h +++ b/frame/3/bli_l3_ft_ukr.h @@ -32,12 +32,12 @@ */ -#ifndef BLIS_L3_FT_H -#define BLIS_L3_FT_H +#ifndef BLIS_L3_FT_UKR_H +#define BLIS_L3_FT_UKR_H // -// -- Level-3 micro-kernel types ----------------------------------------------- +// -- Level-3 micro-kernel function types -------------------------------------- // // gemm @@ -45,7 +45,7 @@ #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,_ukr,tsuf)) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -57,24 +57,7 @@ typedef void (*PASTECH2(ch,opname,tsuf)) \ cntx_t* restrict cntx \ ); -INSERT_GENTDEF( gemm_ukr ) - - -// trsm_[lu] - -#undef GENTDEF -#define GENTDEF( ctype, ch, opname, tsuf ) \ -\ -typedef void (*PASTECH2(ch,opname,tsuf)) \ - ( \ - ctype* restrict a, \ - ctype* restrict b, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* restrict data, \ - cntx_t* restrict cntx \ - ); - -INSERT_GENTDEF( trsm_ukr ) +INSERT_GENTDEF( gemm ) // gemmtrsm_[lu] @@ -82,7 +65,7 @@ INSERT_GENTDEF( trsm_ukr ) #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ -typedef void (*PASTECH2(ch,opname,tsuf)) \ +typedef void (*PASTECH3(ch,opname,_ukr,tsuf)) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -95,11 +78,24 @@ typedef void (*PASTECH2(ch,opname,tsuf)) \ cntx_t* restrict cntx \ ); -INSERT_GENTDEF( gemmtrsm_ukr ) +INSERT_GENTDEF( gemmtrsm ) +// trsm_[lu] +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,_ukr,tsuf)) \ + ( \ + ctype* restrict a, \ + ctype* restrict b, \ + ctype* restrict c, inc_t rs_c, inc_t cs_c, \ + auxinfo_t* restrict data, \ + cntx_t* restrict cntx \ + ); +INSERT_GENTDEF( trsm ) #endif diff --git a/frame/3/bli_l3_voft.h b/frame/3/bli_l3_oft_var.h similarity index 93% rename from frame/3/bli_l3_voft.h rename to frame/3/bli_l3_oft_var.h index 57c8cc6e1..f60806cff 100644 --- a/frame/3/bli_l3_voft.h +++ b/frame/3/bli_l3_oft_var.h @@ -32,8 +32,8 @@ */ -#ifndef BLIS_L3_VAR_OFT_H -#define BLIS_L3_VAR_OFT_H +#ifndef BLIS_L3_OFT_VAR_H +#define BLIS_L3_OFT_VAR_H // @@ -43,7 +43,7 @@ #undef GENTDEF #define GENTDEF( opname ) \ \ -typedef void (*PASTECH(opname,_voft)) \ +typedef void (*PASTECH(opname,_var_oft)) \ ( \ obj_t* a, \ obj_t* b, \ @@ -57,9 +57,10 @@ typedef void (*PASTECH(opname,_voft)) \ GENTDEF( gemm ) +#undef GENTDEF #define GENTDEF( opname ) \ \ -typedef void (*PASTECH(opname,_voft)) \ +typedef void (*PASTECH(opname,_var_oft)) \ ( \ obj_t* a, \ obj_t* b, \ diff --git a/frame/3/bli_l3_ukr_fpa.c b/frame/3/bli_l3_ukr_fpa.c new file mode 100644 index 000000000..13ad93b64 --- /dev/null +++ b/frame/3/bli_l3_ukr_fpa.c @@ -0,0 +1,58 @@ +/* + + 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. + +*/ + +#include "blis.h" + +// +// Define function pointer query interfaces. +// + +#undef GENFRONT +#define GENFRONT( tname, opname ) \ +\ +GENARRAY_FPA( PASTECH2(tname,_ukr,_vft), \ + opname ); \ +\ +PASTECH2(tname,_ukr,_vft) \ +PASTEMAC(opname,_qfp)( num_t dt ) \ +{ \ + return PASTECH(opname,_fpa)[ dt ]; \ +} + +GENFRONT( gemm, gemm_ukernel ) +GENFRONT( gemmtrsm, gemmtrsm_l_ukernel ) +GENFRONT( gemmtrsm, gemmtrsm_u_ukernel ) +GENFRONT( trsm, trsm_l_ukernel ) +GENFRONT( trsm, trsm_u_ukernel ) + diff --git a/frame/3/bli_l3_ukr_fpa.h b/frame/3/bli_l3_ukr_fpa.h new file mode 100644 index 000000000..088c8e3a3 --- /dev/null +++ b/frame/3/bli_l3_ukr_fpa.h @@ -0,0 +1,50 @@ +/* + + 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. + +*/ + +// +// Prototype function pointer query interface. +// + +#undef GENPROT +#define GENPROT( tname, opname ) \ +\ +PASTECH2(tname,_ukr,_vft) \ +PASTEMAC(opname,_qfp)( num_t dt ); + +GENPROT( gemm, gemm_ukernel ) +GENPROT( gemmtrsm, gemmtrsm_l_ukernel ) +GENPROT( gemmtrsm, gemmtrsm_u_ukernel ) +GENPROT( trsm, trsm_l_ukernel ) +GENPROT( trsm, trsm_u_ukernel ) + diff --git a/frame/3/bli_l3_ukr_oapi.c b/frame/3/bli_l3_ukr_oapi.c index f5a183153..0c5044dd9 100644 --- a/frame/3/bli_l3_ukr_oapi.c +++ b/frame/3/bli_l3_ukr_oapi.c @@ -35,7 +35,7 @@ #include "blis.h" #undef GENFRONT -#define GENFRONT( opname ) \ +#define GENFRONT( tname, opname ) \ \ void PASTEMAC0(opname) \ ( \ @@ -68,11 +68,13 @@ void PASTEMAC0(opname) \ bli_auxinfo_set_is_a( 1, &data ); \ bli_auxinfo_set_is_b( 1, &data ); \ \ - /* Invoke the void pointer-based function for the given datatype. */ \ - bli_call_ft_10 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(tname,_ukr,_vft) f = \ + PASTEMAC(opname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ k, \ buf_alpha, \ buf_a, \ @@ -84,72 +86,11 @@ void PASTEMAC0(opname) \ ); \ } \ -GENFRONT( gemm_ukernel ) +GENFRONT( gemm, gemm_ukernel ) #undef GENFRONT -#define GENFRONT( opname, opnamel, opnameu ) \ -\ -void PASTEMAC0(opname) \ - ( \ - obj_t* a, \ - obj_t* b, \ - obj_t* c, \ - cntx_t* cntx \ - ) \ -{ \ - bli_init_once(); \ -\ - num_t dt = bli_obj_dt( c ); \ -\ - void* buf_a = bli_obj_buffer_at_off( a ); \ - void* buf_b = bli_obj_buffer_at_off( 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 ); \ -\ - auxinfo_t data; \ -\ - /* Fill the auxinfo_t struct in case the micro-kernel uses it. */ \ - bli_auxinfo_set_next_a( buf_a, &data ); \ - bli_auxinfo_set_next_b( buf_b, &data ); \ - bli_auxinfo_set_is_a( 1, &data ); \ - bli_auxinfo_set_is_b( 1, &data ); \ -\ - /* Invoke the void pointer-based function for the given datatype. */ \ - if ( bli_obj_is_lower( a ) ) \ - { \ - bli_call_ft_7 \ - ( \ - dt, \ - opnamel, \ - buf_a, \ - buf_b, \ - buf_c, rs_c, cs_c, \ - &data, \ - cntx \ - ); \ - } \ - else /* if ( bli_obj_is_upper( a ) ) */ \ - { \ - bli_call_ft_7 \ - ( \ - dt, \ - opnameu, \ - buf_a, \ - buf_b, \ - buf_c, rs_c, cs_c, \ - &data, \ - cntx \ - ); \ - } \ -} \ - -GENFRONT( trsm_ukernel, trsm_l_ukernel, trsm_u_ukernel ) - - -#undef GENFRONT -#define GENFRONT( opname, opnamel, opnameu ) \ +#define GENFRONT( tname, opname, opnamel, opnameu ) \ \ void PASTEMAC0(opname) \ ( \ @@ -188,10 +129,13 @@ void PASTEMAC0(opname) \ /* Invoke the void pointer-based function for the given datatype. */ \ if ( bli_obj_is_lower( a11 ) ) \ { \ - bli_call_ft_11 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(tname,_ukr,_vft) f = \ + PASTEMAC(opnamel,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opnamel, \ k, \ buf_alpha, \ buf_a1x, \ @@ -205,10 +149,13 @@ void PASTEMAC0(opname) \ } \ else /* if ( bli_obj_is_upper( a11 ) ) */ \ { \ - bli_call_ft_11 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(tname,_ukr,_vft) f = \ + PASTEMAC(opnameu,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opnameu, \ k, \ buf_alpha, \ buf_a1x, \ @@ -222,5 +169,72 @@ void PASTEMAC0(opname) \ } \ } \ -GENFRONT( gemmtrsm_ukernel, gemmtrsm_l_ukernel, gemmtrsm_u_ukernel ) +GENFRONT( gemmtrsm, gemmtrsm_ukernel, gemmtrsm_l_ukernel, gemmtrsm_u_ukernel ) + + +#undef GENFRONT +#define GENFRONT( tname, opname, opnamel, opnameu ) \ +\ +void PASTEMAC0(opname) \ + ( \ + obj_t* a, \ + obj_t* b, \ + obj_t* c, \ + cntx_t* cntx \ + ) \ +{ \ + bli_init_once(); \ +\ + num_t dt = bli_obj_dt( c ); \ +\ + void* buf_a = bli_obj_buffer_at_off( a ); \ + void* buf_b = bli_obj_buffer_at_off( 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 ); \ +\ + auxinfo_t data; \ +\ + /* Fill the auxinfo_t struct in case the micro-kernel uses it. */ \ + bli_auxinfo_set_next_a( buf_a, &data ); \ + bli_auxinfo_set_next_b( buf_b, &data ); \ + bli_auxinfo_set_is_a( 1, &data ); \ + bli_auxinfo_set_is_b( 1, &data ); \ +\ + /* Invoke the void pointer-based function for the given datatype. */ \ + if ( bli_obj_is_lower( a ) ) \ + { \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(tname,_ukr,_vft) f = \ + PASTEMAC(opnamel,_qfp)( dt ); \ +\ + f \ + ( \ + buf_a, \ + buf_b, \ + buf_c, rs_c, cs_c, \ + &data, \ + cntx \ + ); \ + } \ + else /* if ( bli_obj_is_upper( a ) ) */ \ + { \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(tname,_ukr,_vft) f = \ + PASTEMAC(opnameu,_qfp)( dt ); \ +\ + f \ + ( \ + buf_a, \ + buf_b, \ + buf_c, rs_c, cs_c, \ + &data, \ + cntx \ + ); \ + } \ +} \ + +GENFRONT( trsm, trsm_ukernel, trsm_l_ukernel, trsm_u_ukernel ) diff --git a/frame/3/bli_l3_ukr_oapi.h b/frame/3/bli_l3_ukr_oapi.h index 3647e954a..012dbc3cc 100644 --- a/frame/3/bli_l3_ukr_oapi.h +++ b/frame/3/bli_l3_ukr_oapi.h @@ -53,20 +53,6 @@ void PASTEMAC0(opname) \ GENPROT( gemm_ukernel ) -#undef GENPROT -#define GENPROT( opname ) \ -\ -void PASTEMAC0(opname) \ - ( \ - obj_t* a, \ - obj_t* b, \ - obj_t* c, \ - cntx_t* cntx \ - ); - -GENPROT( trsm_ukernel ) - - #undef GENPROT #define GENPROT( opname ) \ \ @@ -83,3 +69,17 @@ void PASTEMAC0(opname) \ GENPROT( gemmtrsm_ukernel ) + +#undef GENPROT +#define GENPROT( opname ) \ +\ +void PASTEMAC0(opname) \ + ( \ + obj_t* a, \ + obj_t* b, \ + obj_t* c, \ + cntx_t* cntx \ + ); + +GENPROT( trsm_ukernel ) + diff --git a/frame/3/bli_l3_ukr_tapi.c b/frame/3/bli_l3_ukr_tapi.c index 44f557029..c811c23e6 100644 --- a/frame/3/bli_l3_ukr_tapi.c +++ b/frame/3/bli_l3_ukr_tapi.c @@ -55,7 +55,7 @@ void PASTEMAC(ch,opname) \ \ /* Query the context for the function address of the current datatype's micro-kernel. */ \ - PASTECH2(ch,tname,_ft) f = bli_cntx_get_l3_vir_ukr_dt( dt, kerid, cntx ); \ + PASTECH2(ch,tname,_ukr_ft) f = bli_cntx_get_l3_vir_ukr_dt( dt, kerid, cntx ); \ \ /* Invoke the typed function for the given datatype. */ \ f( \ @@ -70,41 +70,7 @@ void PASTEMAC(ch,opname) \ ); \ } \ -INSERT_GENTFUNC_BASIC2( gemm_ukernel, gemm_ukr, BLIS_GEMM_UKR ) - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, opname, tname, kerid ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - ctype* restrict a, \ - ctype* restrict b, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* restrict data, \ - cntx_t* restrict cntx \ - ) \ -{ \ - bli_init_once(); \ -\ - const num_t dt = PASTEMAC(ch,type); \ -\ - /* Query the context for the function address of the current - datatype's micro-kernel. */ \ - PASTECH2(ch,tname,_ft) f = bli_cntx_get_l3_vir_ukr_dt( dt, kerid, cntx ); \ -\ - /* Invoke the typed function for the given datatype. */ \ - f( \ - a, \ - b, \ - c, rs_c, cs_c, \ - data, \ - cntx \ - ); \ -} \ - -INSERT_GENTFUNC_BASIC2( trsm_l_ukernel, trsm_ukr, BLIS_TRSM_L_UKR ) -INSERT_GENTFUNC_BASIC2( trsm_u_ukernel, trsm_ukr, BLIS_TRSM_U_UKR ) +INSERT_GENTFUNC_BASIC2( gemm_ukernel, gemm, BLIS_GEMM_UKR ) #undef GENTFUNC @@ -129,7 +95,7 @@ void PASTEMAC(ch,opname) \ \ /* Query the context for the function address of the current datatype's micro-kernel. */ \ - PASTECH2(ch,tname,_ft) f = bli_cntx_get_l3_vir_ukr_dt( dt, kerid, cntx ); \ + PASTECH2(ch,tname,_ukr_ft) f = bli_cntx_get_l3_vir_ukr_dt( dt, kerid, cntx ); \ \ /* Invoke the typed function for the given datatype. */ \ f( \ @@ -145,6 +111,40 @@ void PASTEMAC(ch,opname) \ ); \ } \ -INSERT_GENTFUNC_BASIC2( gemmtrsm_l_ukernel, gemmtrsm_ukr, BLIS_GEMMTRSM_L_UKR ) -INSERT_GENTFUNC_BASIC2( gemmtrsm_u_ukernel, gemmtrsm_ukr, BLIS_GEMMTRSM_U_UKR ) +INSERT_GENTFUNC_BASIC2( gemmtrsm_l_ukernel, gemmtrsm, BLIS_GEMMTRSM_L_UKR ) +INSERT_GENTFUNC_BASIC2( gemmtrsm_u_ukernel, gemmtrsm, BLIS_GEMMTRSM_U_UKR ) + + +#undef GENTFUNC +#define GENTFUNC( ctype, ch, opname, tname, kerid ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + ctype* restrict a, \ + ctype* restrict b, \ + ctype* restrict c, inc_t rs_c, inc_t cs_c, \ + auxinfo_t* restrict data, \ + cntx_t* restrict cntx \ + ) \ +{ \ + bli_init_once(); \ +\ + const num_t dt = PASTEMAC(ch,type); \ +\ + /* Query the context for the function address of the current + datatype's micro-kernel. */ \ + PASTECH2(ch,tname,_ukr_ft) f = bli_cntx_get_l3_vir_ukr_dt( dt, kerid, cntx ); \ +\ + /* Invoke the typed function for the given datatype. */ \ + f( \ + a, \ + b, \ + c, rs_c, cs_c, \ + data, \ + cntx \ + ); \ +} \ + +INSERT_GENTFUNC_BASIC2( trsm_l_ukernel, trsm, BLIS_TRSM_L_UKR ) +INSERT_GENTFUNC_BASIC2( trsm_u_ukernel, trsm, BLIS_TRSM_U_UKR ) diff --git a/frame/3/gemm/bli_gemm_int.c b/frame/3/gemm/bli_gemm_int.c index 2149fd052..865454476 100644 --- a/frame/3/gemm/bli_gemm_int.c +++ b/frame/3/gemm/bli_gemm_int.c @@ -47,10 +47,10 @@ void bli_gemm_int thrinfo_t* thread ) { - obj_t a_local; - obj_t b_local; - obj_t c_local; - gemm_voft f; + obj_t a_local; + obj_t b_local; + obj_t c_local; + gemm_var_oft f; // Check parameters. if ( bli_error_checking_is_enabled() ) diff --git a/frame/3/herk/bli_herk_x_ker_var2.c b/frame/3/herk/bli_herk_x_ker_var2.c index b2ee72110..b2592718f 100644 --- a/frame/3/herk/bli_herk_x_ker_var2.c +++ b/frame/3/herk/bli_herk_x_ker_var2.c @@ -34,7 +34,7 @@ #include "blis.h" -static gemm_voft vars[2] = +static gemm_var_oft vars[2] = { bli_herk_l_ker_var2, bli_herk_u_ker_var2, }; @@ -50,8 +50,8 @@ void bli_herk_x_ker_var2 thrinfo_t* thread ) { - bool_t uplo; - gemm_voft f; + bool_t uplo; + gemm_var_oft f; // Set a bool based on the uplo field of C's root object. if ( bli_obj_root_is_lower( c ) ) uplo = 0; diff --git a/frame/3/trmm/bli_trmm_xx_ker_var2.c b/frame/3/trmm/bli_trmm_xx_ker_var2.c index 44a55b8bb..c79dfc39c 100644 --- a/frame/3/trmm/bli_trmm_xx_ker_var2.c +++ b/frame/3/trmm/bli_trmm_xx_ker_var2.c @@ -34,7 +34,7 @@ #include "blis.h" -static gemm_voft vars[2][2] = +static gemm_var_oft vars[2][2] = { { bli_trmm_ll_ker_var2, bli_trmm_lu_ker_var2 }, { bli_trmm_rl_ker_var2, bli_trmm_ru_ker_var2 } @@ -51,9 +51,9 @@ void bli_trmm_xx_ker_var2 thrinfo_t* thread ) { - bool_t side; - bool_t uplo; - gemm_voft f; + bool_t side; + bool_t uplo; + gemm_var_oft f; // Set two bools: one based on the implied side parameter (the structure // of the root object) and one based on the uplo field of the triangular diff --git a/frame/3/trsm/bli_trsm_int.c b/frame/3/trsm/bli_trsm_int.c index 013fc48e7..5d5a0f5e6 100644 --- a/frame/3/trsm/bli_trsm_int.c +++ b/frame/3/trsm/bli_trsm_int.c @@ -47,10 +47,10 @@ void bli_trsm_int thrinfo_t* thread ) { - obj_t a_local; - obj_t b_local; - obj_t c_local; - trsm_voft f; + obj_t a_local; + obj_t b_local; + obj_t c_local; + trsm_var_oft f; // Check parameters. if ( bli_error_checking_is_enabled() ) diff --git a/frame/3/trsm/bli_trsm_xx_ker_var2.c b/frame/3/trsm/bli_trsm_xx_ker_var2.c index e6d86a6d8..f8f9cf462 100644 --- a/frame/3/trsm/bli_trsm_xx_ker_var2.c +++ b/frame/3/trsm/bli_trsm_xx_ker_var2.c @@ -34,7 +34,7 @@ #include "blis.h" -static trsm_voft vars[2][2] = +static trsm_var_oft vars[2][2] = { { bli_trsm_ll_ker_var2, bli_trsm_lu_ker_var2 }, { bli_trsm_rl_ker_var2, bli_trsm_ru_ker_var2 } @@ -51,9 +51,9 @@ void bli_trsm_xx_ker_var2 thrinfo_t* thread ) { - bool_t side; - bool_t uplo; - trsm_voft f; + bool_t side; + bool_t uplo; + trsm_var_oft f; // Set two bools: one based on the implied side parameter (the structure // of the root object) and one based on the uplo field of the triangular diff --git a/frame/include/bli_genarray_macro_defs.h b/frame/include/bli_genarray_macro_defs.h index 4305ce989..c38c1e431 100644 --- a/frame/include/bli_genarray_macro_defs.h +++ b/frame/include/bli_genarray_macro_defs.h @@ -40,15 +40,27 @@ // -- "Smart" one-operand macro -- -#define GENARRAY_VFP(ftname,opname) \ +#define GENARRAY_FPA(tname,opname) \ \ -PASTECH(ftname,_vft) \ -PASTECH(opname,_vfp)[BLIS_NUM_FP_TYPES] = \ +static tname PASTECH(opname,_fpa)[BLIS_NUM_FP_TYPES] = \ { \ - PASTEMAC(s,opname), \ - PASTEMAC(c,opname), \ - PASTEMAC(d,opname), \ - PASTEMAC(z,opname) \ + ( tname )PASTEMAC(s,opname), \ + ( tname )PASTEMAC(c,opname), \ + ( tname )PASTEMAC(d,opname), \ + ( tname )PASTEMAC(z,opname) \ +} + +// -- "Smart" one-operand macro (with integer support) -- + +#define GENARRAY_FPA_I(tname,opname) \ +\ +static tname PASTECH(opname,_fpa)[BLIS_NUM_FP_TYPES+1] = \ +{ \ + ( tname )PASTEMAC(s,opname), \ + ( tname )PASTEMAC(c,opname), \ + ( tname )PASTEMAC(d,opname), \ + ( tname )PASTEMAC(z,opname), \ + ( tname )PASTEMAC(i,opname) \ } // -- "Smart" two-operand macro -- diff --git a/frame/include/bli_misc_macro_defs.h b/frame/include/bli_misc_macro_defs.h index 0c4af3c08..0ed6477f9 100644 --- a/frame/include/bli_misc_macro_defs.h +++ b/frame/include/bli_misc_macro_defs.h @@ -148,130 +148,6 @@ static void bli_toggle_bool( bool_t* b ) #define bli_zformatspec() "%9.2e + %9.2e " #define bli_iformatspec() "%6d" -// -- Function caller/chooser macros -- - -#define bli_call_ft_2( dt, fname, o0, o1 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1); \ -} -#define bli_call_ft_3( dt, fname, o0, o1, o2 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2); \ -} -#define bli_call_ft_3i( dt, fname, o0, o1, o2 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2); \ - else if ( bli_is_int( dt ) ) PASTEMAC(i,fname)(o0,o1,o2); \ -} -#define bli_call_ft_4( dt, fname, o0, o1, o2, o3 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3); \ -} -#define bli_call_ft_5( dt, fname, o0, o1, o2, o3, o4 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4); \ -} -#define bli_call_ft_6( dt, fname, o0, o1, o2, o3, o4, o5 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5); \ -} -#define bli_call_ft_7( dt, fname, o0, o1, o2, o3, o4, o5, o6 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6); \ -} -#define bli_call_ft_8( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7); \ -} -#define bli_call_ft_9( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7, o8 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8); \ -} -#define bli_call_ft_10( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7, o8, o9 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9); \ -} -#define bli_call_ft_11( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10); \ -} -#define bli_call_ft_12( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11); \ -} -#define bli_call_ft_13( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12); \ -} -#define bli_call_ft_14( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13); \ -} -#define bli_call_ft_15( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14); \ -} -#define bli_call_ft_20( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17, o18, o19 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14,o15,o16,o17,o18,o19); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14,o15,o16,o17,o18,o19); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14,o15,o16,o17,o18,o19); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14,o15,o16,o17,o18,o19); \ -} -#define bli_call_ft_21( dt, fname, o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17, o18, o19, o20 ) \ -{ \ - if ( bli_is_float( dt ) ) PASTEMAC(s,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14,o15,o16,o17,o18,o19,o20); \ - else if ( bli_is_double( dt ) ) PASTEMAC(d,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14,o15,o16,o17,o18,o19,o20); \ - else if ( bli_is_scomplex( dt ) ) PASTEMAC(c,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14,o15,o16,o17,o18,o19,o20); \ - else if ( bli_is_dcomplex( dt ) ) PASTEMAC(z,fname)(o0,o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14,o15,o16,o17,o18,o19,o20); \ -} - - - #endif + diff --git a/frame/include/bli_oapi_ba.h b/frame/include/bli_oapi_ba.h index a8ed123e2..3814a4f63 100644 --- a/frame/include/bli_oapi_ba.h +++ b/frame/include/bli_oapi_ba.h @@ -51,3 +51,8 @@ #undef BLIS_OAPI_EX_DECLS #define BLIS_OAPI_EX_DECLS cntx_t* cntx = NULL; ( void )cntx; \ rntm_t* rntm = NULL; ( void )rntm; + +// Define the macro to pass the local expert variables to another function. +//#undef BLIS_TAPI_EX_VARS +//#define BLIS_TAPI_EX_VARS + diff --git a/frame/include/bli_oapi_ex.h b/frame/include/bli_oapi_ex.h index ce7273ea5..ad205c423 100644 --- a/frame/include/bli_oapi_ex.h +++ b/frame/include/bli_oapi_ex.h @@ -50,3 +50,7 @@ #undef BLIS_OAPI_EX_DECLS #define BLIS_OAPI_EX_DECLS +// Define the macro to pass the local expert variables to another function. +//#undef BLIS_TAPI_EX_VARS +//#define BLIS_TAPI_EX_VARS ,cntx, rntm + diff --git a/frame/include/bli_tapi_ba.h b/frame/include/bli_tapi_ba.h index 694d0ae0c..73c906b12 100644 --- a/frame/include/bli_tapi_ba.h +++ b/frame/include/bli_tapi_ba.h @@ -52,3 +52,7 @@ #define BLIS_TAPI_EX_DECLS cntx_t* cntx = NULL; ( void )cntx; \ rntm_t* rntm = NULL; ( void )rntm; +// Define the macro to pass the local expert variables to another function. +//#undef BLIS_TAPI_EX_VARS +//#define BLIS_TAPI_EX_VARS + diff --git a/frame/include/bli_tapi_ex.h b/frame/include/bli_tapi_ex.h index a08f49cc9..280a3e5eb 100644 --- a/frame/include/bli_tapi_ex.h +++ b/frame/include/bli_tapi_ex.h @@ -50,3 +50,7 @@ #undef BLIS_TAPI_EX_DECLS #define BLIS_TAPI_EX_DECLS +// Define the macro to pass the local expert variables to another function. +//#undef BLIS_TAPI_EX_VARS +//#define BLIS_TAPI_EX_VARS ,cntx, rntm + diff --git a/frame/util/bli_util.h b/frame/util/bli_util.h index f3523e86f..14824ee70 100644 --- a/frame/util/bli_util.h +++ b/frame/util/bli_util.h @@ -37,14 +37,22 @@ // Prototype object APIs (expert and non-expert). #include "bli_oapi_ex.h" #include "bli_util_oapi.h" + #include "bli_oapi_ba.h" #include "bli_util_oapi.h" // Prototype typed APIs (expert and non-expert). #include "bli_tapi_ex.h" #include "bli_util_tapi.h" +#include "bli_util_ft.h" + #include "bli_tapi_ba.h" #include "bli_util_tapi.h" +#include "bli_util_ft.h" +// Generate function pointer arrays for tapi functions (expert only). +#include "bli_util_fpa.h" + +// Prototype level-1m implementations. #include "bli_util_unb_var1.h" diff --git a/frame/util/bli_util_fpa.c b/frame/util/bli_util_fpa.c new file mode 100644 index 000000000..cf7159537 --- /dev/null +++ b/frame/util/bli_util_fpa.c @@ -0,0 +1,85 @@ +/* + + 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. + +*/ + +#include "blis.h" + +// +// Define function pointer query interfaces. +// + +#undef GENFRONT +#define GENFRONT( opname ) \ +\ +GENARRAY_FPA( PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft), \ + PASTECH(opname,BLIS_TAPI_EX_SUF) ); \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ) \ +{ \ + return PASTECH2(opname,BLIS_TAPI_EX_SUF,_fpa)[ dt ]; \ +} + +GENFRONT( asumv ) +GENFRONT( mkherm ) +GENFRONT( mksymm ) +GENFRONT( mktrim ) +GENFRONT( norm1v ) +GENFRONT( normfv ) +GENFRONT( normiv ) +GENFRONT( norm1m ) +GENFRONT( normfm ) +GENFRONT( normim ) +GENFRONT( randv ) +GENFRONT( randnv ) +GENFRONT( randm ) +GENFRONT( randnm ) +GENFRONT( sumsqv ) + + +#undef GENFRONT +#define GENFRONT( opname ) \ +\ +GENARRAY_FPA( void*, opname ); \ +\ +PASTECH(opname,_vft) \ +PASTEMAC(opname,_qfp)( num_t dt ) \ +{ \ + return PASTECH(opname,_fpa)[ dt ]; \ +} + +GENFRONT( fprintv ) +GENFRONT( fprintm ) +//GENFRONT( printv ) +//GENFRONT( printm ) + diff --git a/frame/util/bli_util_fpa.h b/frame/util/bli_util_fpa.h new file mode 100644 index 000000000..35f1e99f6 --- /dev/null +++ b/frame/util/bli_util_fpa.h @@ -0,0 +1,75 @@ +/* + + 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. + +*/ + +// +// Prototype function pointer query interface. +// + +#undef GENPROT +#define GENPROT( opname ) \ +\ +PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) \ +PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( num_t dt ); + +GENPROT( asumv ) +GENPROT( mkherm ) +GENPROT( mksymm ) +GENPROT( mktrim ) +GENPROT( norm1v ) +GENPROT( normfv ) +GENPROT( normiv ) +GENPROT( norm1m ) +GENPROT( normfm ) +GENPROT( normim ) +GENPROT( fprintv ) +GENPROT( fprintm ) +//GENPROT( printv ) +//GENPROT( printm ) +GENPROT( randv ) +GENPROT( randnv ) +GENPROT( randm ) +GENPROT( randnm ) +GENPROT( sumsqv ) + + +#undef GENPROT +#define GENPROT( opname ) \ +\ +PASTECH(opname,_vft) \ +PASTEMAC(opname,_qfp)( num_t dt ); + +GENPROT( fprintv ) +GENPROT( fprintm ) +//GENPROT( printv ) +//GENPROT( printm ) diff --git a/frame/util/bli_util_ft.h b/frame/util/bli_util_ft.h new file mode 100644 index 000000000..351709df3 --- /dev/null +++ b/frame/util/bli_util_ft.h @@ -0,0 +1,193 @@ +/* + + 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. + +*/ + + +// +// -- Utility function types --------------------------------------------------- +// + +// asumv + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + dim_t n, \ + ctype* x, inc_t incx, \ + ctype_r* asum \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEFR( asumv ) + +// mkherm, mksymm, mktrim + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + uplo_t uploa, \ + dim_t m, \ + ctype* a, inc_t rs_a, inc_t cs_a \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEF( mkherm ) +INSERT_GENTDEF( mksymm ) +INSERT_GENTDEF( mktrim ) + +// norm1v, normfv, normiv + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + dim_t n, \ + ctype* x, inc_t incx, \ + ctype_r* norm \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEFR( norm1v ) +INSERT_GENTDEFR( normfv ) +INSERT_GENTDEFR( normiv ) + +// norm1m, normfm, normim + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + doff_t diagoffx, \ + diag_t diagx, \ + uplo_t uplox, \ + dim_t m, \ + dim_t n, \ + ctype* x, inc_t rs_x, inc_t cs_x, \ + ctype_r* norm \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEFR( norm1m ) +INSERT_GENTDEFR( normfm ) +INSERT_GENTDEFR( normim ) + +// fprintv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + FILE* file, \ + char* s1, \ + dim_t n, \ + ctype* x, inc_t incx, \ + char* format, \ + char* s2 \ + ); + +INSERT_GENTDEF( fprintv ) + +// fprintm + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + FILE* file, \ + char* s1, \ + dim_t m, \ + dim_t n, \ + ctype* x, inc_t rs_x, inc_t cs_x, \ + char* format, \ + char* s2 \ + ); + +INSERT_GENTDEF( fprintm ) + +// randv, randnv + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + dim_t n, \ + ctype* x, inc_t incx \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEF( randv ) +INSERT_GENTDEF( randnv ) + +// randm, randnm + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + doff_t diagoffx, \ + uplo_t uplox, \ + dim_t m, \ + dim_t n, \ + ctype* x, inc_t rs_x, inc_t cs_x \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEF( randm ) +INSERT_GENTDEF( randnm ) + +// sumsqv + +#undef GENTDEFR +#define GENTDEFR( ctype, ctype_r, ch, chr, opname, tsuf ) \ +\ +typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \ + ( \ + dim_t n, \ + ctype* x, inc_t incx, \ + ctype_r* scale, \ + ctype_r* sumsq \ + BLIS_TAPI_EX_PARAMS \ + ); + +INSERT_GENTDEFR( sumsqv ) + diff --git a/frame/util/bli_util_oapi.c b/frame/util/bli_util_oapi.c index fe5a1dc60..e97b06e3e 100644 --- a/frame/util/bli_util_oapi.c +++ b/frame/util/bli_util_oapi.c @@ -65,11 +65,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, asum ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_6 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ n, \ buf_x, incx, \ buf_asum, \ @@ -105,11 +107,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( a ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_7 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ uploa, \ m, \ buf_a, rs_a, cs_a, \ @@ -147,11 +151,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, norm ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_6 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ n, \ buf_x, incx, \ buf_norm, \ @@ -194,11 +200,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, norm ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_11 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ diagoffx, \ diagx, \ uplox, \ @@ -248,11 +256,13 @@ void PASTEMAC(opname,EX_SUF) \ bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED ); \ } \ \ - /* Invoke the typed function. */ \ - bli_call_ft_7 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = \ + PASTEMAC(opname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ file, \ s1, \ n, \ @@ -314,11 +324,13 @@ void PASTEMAC(opname,EX_SUF) \ return; \ } \ \ - /* Invoke the typed function. */ \ - bli_call_ft_9 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(opname,_vft) f = \ + PASTEMAC(opname,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - opname, \ file, \ s1, \ m, \ @@ -388,11 +400,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_5 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ n, \ buf_x, incx, \ cntx, \ @@ -430,11 +444,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_9 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ diagoffx, \ uplox, \ m, \ @@ -475,11 +491,13 @@ void PASTEMAC(opname,EX_SUF) \ if ( bli_error_checking_is_enabled() ) \ PASTEMAC(opname,_check)( x, scale, sumsq ); \ \ - /* Invoke the typed function. */ \ - bli_call_ft_7 \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH2(opname,BLIS_TAPI_EX_SUF,_vft) f = \ + PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \ +\ + f \ ( \ - dt, \ - PASTECH(opname,BLIS_TAPI_EX_SUF), \ n, \ buf_x, incx, \ buf_scale, \ diff --git a/kernels/zen/1/bli_scalv_zen_int.c b/kernels/zen/1/bli_scalv_zen_int.c index 530fd3d7d..991550287 100644 --- a/kernels/zen/1/bli_scalv_zen_int.c +++ b/kernels/zen/1/bli_scalv_zen_int.c @@ -81,8 +81,8 @@ void bli_sscalv_zen_int // If alpha is zero, use setv (in case y contains NaN or Inf). if ( PASTEMAC(s,eq0)( *alpha ) ) { - float* zero = bli_s0; - ssetv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_SETV_KER, cntx ); + float* zero = bli_s0; + ssetv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_SETV_KER, cntx ); f ( @@ -180,8 +180,8 @@ void bli_dscalv_zen_int // If alpha is zero, use setv (in case y contains NaN or Inf). if ( PASTEMAC(d,eq0)( *alpha ) ) { - double* zero = bli_d0; - dsetv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_SETV_KER, cntx ); + double* zero = bli_d0; + dsetv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_SETV_KER, cntx ); f ( diff --git a/kernels/zen/1/bli_scalv_zen_int10.c b/kernels/zen/1/bli_scalv_zen_int10.c index e3756ee7d..e23ea7ee8 100644 --- a/kernels/zen/1/bli_scalv_zen_int10.c +++ b/kernels/zen/1/bli_scalv_zen_int10.c @@ -79,8 +79,8 @@ void bli_sscalv_zen_int10 // If alpha is zero, use setv. if ( PASTEMAC(s,eq0)( *alpha ) ) { - float* zero = bli_s0; - ssetv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_SETV_KER, cntx ); + float* zero = bli_s0; + ssetv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_SETV_KER, cntx ); f ( @@ -269,8 +269,8 @@ void bli_dscalv_zen_int10 // If alpha is zero, use setv. if ( PASTEMAC(d,eq0)( *alpha ) ) { - double* zero = bli_d0; - dsetv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_SETV_KER, cntx ); + double* zero = bli_d0; + dsetv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_SETV_KER, cntx ); f ( diff --git a/kernels/zen/1f/bli_axpyf_zen_int_8.c b/kernels/zen/1f/bli_axpyf_zen_int_8.c index 077ec12e3..10bc58794 100644 --- a/kernels/zen/1f/bli_axpyf_zen_int_8.c +++ b/kernels/zen/1f/bli_axpyf_zen_int_8.c @@ -103,7 +103,7 @@ void bli_saxpyf_zen_int_8 // operation as a loop over axpyv. if ( b_n != fuse_fac ) { - saxpyv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_AXPYV_KER, cntx ); + saxpyv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_AXPYV_KER, cntx ); for ( i = 0; i < b_n; ++i ) { @@ -312,7 +312,7 @@ void bli_daxpyf_zen_int_8 // operation as a loop over axpyv. if ( b_n != fuse_fac ) { - daxpyv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_AXPYV_KER, cntx ); + daxpyv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_AXPYV_KER, cntx ); for ( i = 0; i < b_n; ++i ) { diff --git a/kernels/zen/1f/bli_dotxf_zen_int_8.c b/kernels/zen/1f/bli_dotxf_zen_int_8.c index e23efc830..7c9b2caa9 100644 --- a/kernels/zen/1f/bli_dotxf_zen_int_8.c +++ b/kernels/zen/1f/bli_dotxf_zen_int_8.c @@ -77,7 +77,7 @@ void bli_sdotxf_zen_int_8 // simplifies to updating y. if ( bli_zero_dim1( m ) || PASTEMAC(s,eq0)( *alpha ) ) { - sscalv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_SCALV_KER, cntx ); + sscalv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_SCALV_KER, cntx ); f ( @@ -94,7 +94,7 @@ void bli_sdotxf_zen_int_8 // operation as a loop over dotxv. if ( b_n != fuse_fac ) { - sdotxv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_DOTXV_KER, cntx ); + sdotxv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_FLOAT, BLIS_DOTXV_KER, cntx ); for ( dim_t i = 0; i < b_n; ++i ) { @@ -467,7 +467,7 @@ void bli_ddotxf_zen_int_8 // simplifies to updating y. if ( bli_zero_dim1( m ) || PASTEMAC(d,eq0)( *alpha ) ) { - dscalv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_SCALV_KER, cntx ); + dscalv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_SCALV_KER, cntx ); f ( @@ -484,7 +484,7 @@ void bli_ddotxf_zen_int_8 // operation as a loop over dotxv. if ( b_n != fuse_fac ) { - ddotxv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_DOTXV_KER, cntx ); + ddotxv_ker_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_DOTXV_KER, cntx ); for ( dim_t i = 0; i < b_n; ++i ) { diff --git a/ref_kernels/1/bli_axpbyv_ref.c b/ref_kernels/1/bli_axpbyv_ref.c index be3799d67..cb1d8525f 100644 --- a/ref_kernels/1/bli_axpbyv_ref.c +++ b/ref_kernels/1/bli_axpbyv_ref.c @@ -62,8 +62,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ ctype* zero = PASTEMAC(ch,0); \ \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,setv_ft) setv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SETV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,setv_ker_ft) setv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SETV_KER, cntx ); \ \ setv_p \ ( \ @@ -84,8 +84,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ else \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,scalv_ft) scalv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SCALV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,scalv_ker_ft) scalv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SCALV_KER, cntx ); \ \ scalv_p \ ( \ @@ -105,8 +105,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ if ( PASTEMAC(ch,eq0)( *beta ) ) \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,copyv_ft) copyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_COPYV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,copyv_ker_ft) copyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_COPYV_KER, cntx ); \ \ copyv_p \ ( \ @@ -122,8 +122,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ else if ( PASTEMAC(ch,eq1)( *beta ) ) \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,addv_ft) addv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_ADDV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,addv_ker_ft) addv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_ADDV_KER, cntx ); \ \ addv_p \ ( \ @@ -139,8 +139,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ else \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,xpbyv_ft) xpbyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_XPBYV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,xpbyv_ker_ft) xpbyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_XPBYV_KER, cntx ); \ \ xpbyv_p \ ( \ @@ -160,8 +160,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ if ( PASTEMAC(ch,eq0)( *beta ) ) \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,scal2v_ft) scal2v_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SCAL2V_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,scal2v_ker_ft) scal2v_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SCAL2V_KER, cntx ); \ \ scal2v_p \ ( \ @@ -178,8 +178,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ else if ( PASTEMAC(ch,eq1)( *beta ) ) \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,axpyv_ft) axpyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,axpyv_ker_ft) axpyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ \ axpyv_p \ ( \ diff --git a/ref_kernels/1/bli_axpyv_ref.c b/ref_kernels/1/bli_axpyv_ref.c index 62662c337..9fae0ccf1 100644 --- a/ref_kernels/1/bli_axpyv_ref.c +++ b/ref_kernels/1/bli_axpyv_ref.c @@ -60,8 +60,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ if ( PASTEMAC(ch,eq1)( *alpha ) ) \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,addv_ft) addv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_ADDV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,addv_ker_ft) addv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_ADDV_KER, cntx ); \ \ addv_p \ ( \ diff --git a/ref_kernels/1/bli_scal2v_ref.c b/ref_kernels/1/bli_scal2v_ref.c index 39b1e20f7..47e75da46 100644 --- a/ref_kernels/1/bli_scal2v_ref.c +++ b/ref_kernels/1/bli_scal2v_ref.c @@ -59,8 +59,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ ctype* zero = PASTEMAC(ch,0); \ \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,setv_ft) setv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SETV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,setv_ker_ft) setv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SETV_KER, cntx ); \ \ setv_p \ ( \ @@ -76,8 +76,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ else if ( PASTEMAC(ch,eq0)( *alpha ) ) \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,copyv_ft) copyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_COPYV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,copyv_ker_ft) copyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_COPYV_KER, cntx ); \ \ copyv_p \ ( \ diff --git a/ref_kernels/1/bli_scalv_ref.c b/ref_kernels/1/bli_scalv_ref.c index b1433c4d6..7ee8946f0 100644 --- a/ref_kernels/1/bli_scalv_ref.c +++ b/ref_kernels/1/bli_scalv_ref.c @@ -61,8 +61,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ ctype* zero = PASTEMAC(ch,0); \ \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,setv_ft) setv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SETV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,setv_ker_ft) setv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_SETV_KER, cntx ); \ \ setv_p \ ( \ diff --git a/ref_kernels/1/bli_xpbyv_ref.c b/ref_kernels/1/bli_xpbyv_ref.c index dc73e4116..7c125cc92 100644 --- a/ref_kernels/1/bli_xpbyv_ref.c +++ b/ref_kernels/1/bli_xpbyv_ref.c @@ -57,8 +57,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ if ( PASTEMAC(ch,eq0)( *beta ) ) \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,copyv_ft) copyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_COPYV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,copyv_ker_ft) copyv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_COPYV_KER, cntx ); \ \ copyv_p \ ( \ @@ -74,8 +74,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ else if ( PASTEMAC(ch,eq1)( *beta ) ) \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,addv_ft) addv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_ADDV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,addv_ker_ft) addv_p = bli_cntx_get_l1v_ker_dt( dt, BLIS_ADDV_KER, cntx ); \ \ addv_p \ ( \ diff --git a/ref_kernels/1f/bli_axpy2v_ref.c b/ref_kernels/1f/bli_axpy2v_ref.c index b6a8ca3ba..e56a294a5 100644 --- a/ref_kernels/1f/bli_axpy2v_ref.c +++ b/ref_kernels/1f/bli_axpy2v_ref.c @@ -52,8 +52,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ ) \ { \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,axpyv_ft) kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,axpyv_ker_ft) kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ \ kfp_av \ ( \ diff --git a/ref_kernels/1f/bli_axpyf_ref.c b/ref_kernels/1f/bli_axpyf_ref.c index e0b91903d..f687c3b66 100644 --- a/ref_kernels/1f/bli_axpyf_ref.c +++ b/ref_kernels/1f/bli_axpyf_ref.c @@ -58,8 +58,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ dim_t i; \ \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,axpyv_ft) kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,axpyv_ker_ft) kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ \ for ( i = 0; i < b_n; ++i ) \ { \ diff --git a/ref_kernels/1f/bli_dotaxpyv_ref.c b/ref_kernels/1f/bli_dotaxpyv_ref.c index 472f78e87..f858a1049 100644 --- a/ref_kernels/1f/bli_dotaxpyv_ref.c +++ b/ref_kernels/1f/bli_dotaxpyv_ref.c @@ -56,9 +56,9 @@ void PASTEMAC3(ch,opname,arch,suf) \ ctype* zero = PASTEMAC(ch,0); \ \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,dotxv_ft) kfp_dv = bli_cntx_get_l1v_ker_dt( dt, BLIS_DOTXV_KER, cntx ); \ - PASTECH(ch,axpyv_ft) kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,dotxv_ker_ft) kfp_dv = bli_cntx_get_l1v_ker_dt( dt, BLIS_DOTXV_KER, cntx ); \ + PASTECH(ch,axpyv_ker_ft) kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \ \ kfp_dv \ ( \ diff --git a/ref_kernels/1f/bli_dotxaxpyf_ref.c b/ref_kernels/1f/bli_dotxaxpyf_ref.c index 9db9fd732..06148ef8b 100644 --- a/ref_kernels/1f/bli_dotxaxpyf_ref.c +++ b/ref_kernels/1f/bli_dotxaxpyf_ref.c @@ -61,9 +61,9 @@ void PASTEMAC3(ch,opname,arch,suf) \ /* z = z + alpha * A x; */ \ \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,dotxf_ft) kfp_df = bli_cntx_get_l1f_ker_dt( dt, BLIS_DOTXF_KER, cntx ); \ - PASTECH(ch,axpyf_ft) kfp_af = bli_cntx_get_l1f_ker_dt( dt, BLIS_AXPYF_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,dotxf_ker_ft) kfp_df = bli_cntx_get_l1f_ker_dt( dt, BLIS_DOTXF_KER, cntx ); \ + PASTECH(ch,axpyf_ker_ft) kfp_af = bli_cntx_get_l1f_ker_dt( dt, BLIS_AXPYF_KER, cntx ); \ \ kfp_df \ ( \ diff --git a/ref_kernels/1f/bli_dotxf_ref.c b/ref_kernels/1f/bli_dotxf_ref.c index c82ce3d8f..c81769e98 100644 --- a/ref_kernels/1f/bli_dotxf_ref.c +++ b/ref_kernels/1f/bli_dotxf_ref.c @@ -58,8 +58,8 @@ void PASTEMAC3(ch,opname,arch,suf) \ dim_t i; \ \ /* Query the context for the kernel function pointer. */ \ - const num_t dt = PASTEMAC(ch,type); \ - PASTECH(ch,dotxv_ft) kfp_dv = bli_cntx_get_l1v_ker_dt( dt, BLIS_DOTXV_KER, cntx ); \ + const num_t dt = PASTEMAC(ch,type); \ + PASTECH(ch,dotxv_ker_ft) kfp_dv = bli_cntx_get_l1v_ker_dt( dt, BLIS_DOTXV_KER, cntx ); \ \ for ( i = 0; i < b_n; ++i ) \ { \ diff --git a/testsuite/src/test_amaxv.c b/testsuite/src/test_amaxv.c index 7ce0ef506..621d97785 100644 --- a/testsuite/src/test_amaxv.c +++ b/testsuite/src/test_amaxv.c @@ -282,18 +282,50 @@ void PASTEMAC(ch,opname) \ ( \ dim_t n, \ ctype* restrict x, inc_t incx, \ - dim_t* restrict index, \ - cntx_t* cntx \ + dim_t* restrict index \ ); \ INSERT_GENTPROT_BASIC0( amaxv_test ) + +// +// Prototype function pointer query interface. +// + +#undef GENPROT +#define GENPROT( tname, opname ) \ +\ +PASTECH(tname,_vft) \ +PASTEMAC(opname,_qfp)( num_t dt ); + +GENPROT( amaxv, amaxv_test ) + + +// +// Define function pointer query interfaces. +// + +#undef GENFRONT +#define GENFRONT( tname, opname ) \ +\ +GENARRAY_FPA( PASTECH(tname,_vft), \ + opname ); \ +\ +PASTECH(tname,_vft) \ +PASTEMAC(opname,_qfp)( num_t dt ) \ +{ \ + return PASTECH(opname,_fpa)[ dt ]; \ +} + +GENFRONT( amaxv, amaxv_test ) + + // // Define object-based interface for a local amaxv test operation. // #undef GENFRONT -#define GENFRONT( opname ) \ +#define GENFRONT( tname, opname ) \ \ void PASTEMAC0(opname) \ ( \ @@ -312,19 +344,21 @@ void PASTEMAC0(opname) \ if ( bli_error_checking_is_enabled() ) \ bli_amaxv_check( x, index ); \ \ - /* Invoke the bli_?amaxv_test() function. */ \ - bli_call_ft_5 \ - ( \ - dt, \ - amaxv_test, \ + /* Query a type-specific function pointer, except one that uses + void* instead of typed pointers. */ \ + PASTECH(tname,_vft) f = \ + PASTEMAC(opname,_qfp)( dt ); \ +\ + f \ + ( \ n, \ buf_x, incx, \ - buf_index, \ - NULL \ + buf_index \ ); \ } -GENFRONT( amaxv_test ) +GENFRONT( amaxv, amaxv_test ) + // // Define BLAS-like interfaces with typed operands for a local amaxv test @@ -340,8 +374,7 @@ void PASTEMAC(ch,varname) \ ( \ dim_t n, \ ctype* x, inc_t incx, \ - dim_t* i_max, \ - cntx_t* cntx \ + dim_t* index \ ) \ { \ ctype_r* minus_one = PASTEMAC(chr,m1); \ @@ -351,19 +384,19 @@ void PASTEMAC(ch,varname) \ ctype_r chi1_i; \ ctype_r abs_chi1; \ ctype_r abs_chi1_max; \ - dim_t i_max_l; \ + dim_t index_l; \ dim_t i; \ \ /* If the vector length is zero, return early. This directly emulates the behavior of netlib BLAS's i?amax() routines. */ \ if ( bli_zero_dim1( n ) ) \ { \ - PASTEMAC(i,copys)( *zero_i, *i_max ); \ + PASTEMAC(i,copys)( *zero_i, *index ); \ return; \ } \ \ /* Initialize the index of the maximum absolute value to zero. */ \ - PASTEMAC(i,copys)( *zero_i, i_max_l ); \ + PASTEMAC(i,copys)( *zero_i, index_l ); \ \ /* Initialize the maximum absolute value search candidate with -1, which is guaranteed to be less than all values we will @@ -395,13 +428,13 @@ void PASTEMAC(ch,varname) \ if ( abs_chi1_max < abs_chi1 || bli_isnan( abs_chi1 ) ) \ { \ abs_chi1_max = abs_chi1; \ - i_max_l = i; \ + index_l = i; \ } \ } \ } \ \ /* Store the final index to the output variable. */ \ - PASTEMAC(i,copys)( i_max_l, *i_max ); \ + PASTEMAC(i,copys)( index_l, *index ); \ } INSERT_GENTFUNCR_BASIC0( amaxv_test )