Separated expert, non-expert typed APIs.

Details:
- Split existing typed APIs into two subsets of interfaces: one for use
  with expert parameters, such as the cntx_t*, and one without. This
  separation was already in place for the object APIs, and after this
  commit the typed and object APIs will have similar expert and non-
  expert APIs. The expert functions will be suffixed with "_ex" just as
  is the case for expert interfaces in the object APIs.
- Updated internal invocations of typed APIs (functions such as
  bli_?setm() and bli_?scalv()) throughout BLIS to reflect use of the
  new explictly expert APIs.
- Updated example code in examples/tapi to reflect the existence (and
  usage) of non-expert APIs.
- Bumped the major soname version number in 'so_version'. While code
  compiled against a previous version/commit will likely still work
  (since the old typed function symbol names still exist in the new API,
  just with one less function argument) the semantics of the function
  have changed if the cntx_t* parameter the application passes in is
  non-NULL. For example, calling bli_daxpyv() with a non-NULL context
  does not behave the same way now as it did before; before, the
  context would be used in the computation, and now the context would
  be ignored since the interace for that function no longer expects a
  context argument.
This commit is contained in:
Field G. Van Zee
2018-07-06 19:14:02 -05:00
parent 331694e524
commit e88aedae73
128 changed files with 2006 additions and 818 deletions

View File

@@ -164,5 +164,8 @@
#include "bli_error_macro_defs.h"
#include "bli_blas_macro_defs.h"
#include "bli_oapi_macro_defs.h"
#include "bli_tapi_macro_defs.h"
#endif

View File

@@ -0,0 +1,38 @@
/*
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.
*/
// Define the suffix to add to object API function names that include
// additional "expert" parameters.
#define BLIS_OAPI_EX_SUF _ex

View File

@@ -32,22 +32,21 @@
*/
// This file defines macros used to allow the _oapi.c files to
// produce object APIs that contain context parameters.
// Define the macro to add a suffix to the object function names.
// We use "ex" for "expert".
// Define the macro to add a suffix to the object API function names
// (in function definitions).
#undef EX_SUF
#define EX_SUF _ex
#define EX_SUF BLIS_OAPI_EX_SUF
// Define the macro to add cntx_t* arguments to function signatures
// and prototypes.
#undef BLIS_OAPI_CNTX_PARAM
#define BLIS_OAPI_CNTX_PARAM ,cntx_t* cntx
#undef BLIS_OAPI_EX_PARAMS
#define BLIS_OAPI_EX_PARAMS ,cntx_t* cntx
// Define the macro to omit the cntx_t declaration block, since it is
// not needed when cntx_t's are passed in through the API.
#undef BLIS_OAPI_CNTX_DECL
#define BLIS_OAPI_CNTX_DECL
#undef BLIS_OAPI_EX_DECLS
#define BLIS_OAPI_EX_DECLS

View File

@@ -35,17 +35,18 @@
// This file defines macros used to allow the _oapi.c files to
// produce object APIs that omit context parameters.
// Define the macro to remove the function name suffix.
// Define the macro to remove the function name suffix (in function
// definitions).
#undef EX_SUF
#define EX_SUF
// Define the macro to omit cntx_t* arguments from function signatures
// and prototypes.
#undef BLIS_OAPI_CNTX_PARAM
#define BLIS_OAPI_CNTX_PARAM
#undef BLIS_OAPI_EX_PARAMS
#define BLIS_OAPI_EX_PARAMS
// Define the macro to declare a local cntx_t pointer that is initialized
// to NULL.
#undef BLIS_OAPI_CNTX_DECL
#define BLIS_OAPI_CNTX_DECL cntx_t* cntx = NULL;
#undef BLIS_OAPI_EX_DECLS
#define BLIS_OAPI_EX_DECLS cntx_t* cntx = NULL; ( void )cntx;

View File

@@ -0,0 +1,38 @@
/*
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.
*/
// Define the suffix to add to typed API function names that include
// additional "expert" parameters.
#define BLIS_TAPI_EX_SUF _ex

View File

@@ -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.
*/
// This file defines macros used to allow the _tapi.c files to
// produce typed APIs that contain context parameters.
// Define the macro to add a suffix to the typed API function names
// (in function definitions).
#undef EX_SUF
#define EX_SUF BLIS_TAPI_EX_SUF
// Define the macro to add cntx_t* arguments to function signatures
// and prototypes.
#undef BLIS_TAPI_EX_PARAMS
#define BLIS_TAPI_EX_PARAMS ,cntx_t* cntx
// Define the macro to omit the cntx_t declaration block, since it is
// not needed when cntx_t's are passed in through the API.
#undef BLIS_TAPI_EX_DECLS
#define BLIS_TAPI_EX_DECLS

View File

@@ -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.
*/
// This file defines macros used to allow the _tapi.c files to
// produce typed APIs that omit context parameters.
// Define the macro to remove the function name suffix (in function
// definitions).
#undef EX_SUF
#define EX_SUF
// Define the macro to omit cntx_t* arguments from function signatures
// and prototypes.
#undef BLIS_TAPI_EX_PARAMS
#define BLIS_TAPI_EX_PARAMS
// Define the macro to declare a local cntx_t pointer that is initialized
// to NULL.
#undef BLIS_TAPI_EX_DECLS
#define BLIS_TAPI_EX_DECLS cntx_t* cntx = NULL; ( void )cntx;