Disallow 64b BLAS integers + 32b BLIS integers.

Details:
- Print an error message from configure if the user attempts to
  explicitly configure BLIS for simultaneous use of 64-bit integers in
  the BLAS API with 32-bit integers in the BLIS API.
- Added cpp macro conditional to bli_type_defs.h to mandate that BLIS
  integers be 64 bits if the BLAS integers are 64 bits. This and the
  above item take care of issue #274. Thanks to Devin Matthews and
  Jeff Hammond for suggesting these safeguards.
- Slight reorganization and relabeling (for clarity) of BLAS/CBLAS
  sections and BLIS integer size line of the testsuite configuration
  output.
- Very minor edits to docs/MixedDatatypes.md.
This commit is contained in:
Field G. Van Zee
2018-10-26 17:07:15 -05:00
parent e90e7f309b
commit f19c33af4c
4 changed files with 33 additions and 18 deletions

21
configure vendored
View File

@@ -193,7 +193,7 @@ print_usage()
echo " Disable (enabled by default) support for mixing the"
echo " storage domain and/or storage precision of matrix"
echo " operands for the gemm operation, as well as support"
echo " for computing in a precision different from one or."
echo " for computing in a precision different from one or"
echo " both of matrices A and B."
echo " "
echo " --disable-mixed-dt-extra-mem, --enable-mixed-dt-extra-mem"
@@ -2620,18 +2620,25 @@ main()
# Report integer sizes.
if [ "x${int_type_size}" = "x32" ]; then
echo "${script_name}: the internal integer size is 32-bit."
echo "${script_name}: the BLIS API integer size is 32-bit."
elif [ "x${int_type_size}" = "x64" ]; then
echo "${script_name}: the internal integer size is 64-bit."
echo "${script_name}: the BLIS API integer size is 64-bit."
else
echo "${script_name}: the internal integer size is automatically determined."
echo "${script_name}: the BLIS API integer size is automatically determined."
fi
if [ "x${blas_int_type_size}" = "x32" ]; then
echo "${script_name}: the BLAS/CBLAS interface integer size is 32-bit."
echo "${script_name}: the BLAS/CBLAS API integer size is 32-bit."
elif [ "x${blas_int_type_size}" = "x64" ]; then
echo "${script_name}: the BLAS/CBLAS interface integer size is 64-bit."
echo "${script_name}: the BLAS/CBLAS API integer size is 64-bit."
else
echo "${script_name}: the BLAS/CBLAS interface integer size is automatically determined."
echo "${script_name}: the BLAS/CBLAS API integer size is automatically determined."
fi
# Disallow the simultaneous use of 64-bit integers in the BLAS and
# 32-bit integers in BLIS.
if [ "x${blas_int_type_size}" = "x64" -a "x${int_type_size}" = "x32" ]; then
echo "${script_name}: *** To avoid the possibility of truncation, we do not allow use of 64-bit integers in the BLAS API with 32-bit integers in BLIS. Please use a different configuration of integers."
exit 1
fi
# Check if a sandbox was given.

View File

@@ -13,7 +13,7 @@
This document serves as a guide to users interested in taking advantage of
BLIS's support for performing the `gemm` operation on operands of differing
types.
datatypes (domain and/or precision).
## Categories of mixed datatypes
@@ -182,10 +182,9 @@ distribution.
## Known issues
While BLIS implements 128 mixed-datatype combinations of `gemm`, there may be
odd behavior in the current implementation that does not conform to the reader's
expectations. Below is a list of issues that BLIS developers are aware of in
the context of mixed-datatype `gemm`. If any of these issues poses a problem for
There may be odd behavior in the current implementation of mixed-datatype `gemm`
that does not conform to the reader's expectations. Below is a list of issues
that BLIS developers are aware of. If any of these issues poses a problem for
your application, please contact us by
[opening an issue](https://github.com/flame/blis/issues).

View File

@@ -62,6 +62,17 @@
// -- General-purpose integers --
// If BLAS integers are 64 bits, mandate that BLIS integers also be 64 bits.
// NOTE: This cpp guard will only meaningfully change BLIS's behavior on
// systems where the BLIS integer size would have been automatically selected
// to be 32 bits, since explicit selection of 32 bits is prohibited at
// configure-time (and explicit or automatic selection of 64 bits is fine
// and would have had the same result).
#if BLIS_BLAS_INT_SIZE == 64
#undef BLIS_INT_TYPE_SIZE
#define BLIS_INT_TYPE_SIZE 64
#endif
// Define integer types depending on what size integer was requested.
#if BLIS_INT_TYPE_SIZE == 32
typedef int32_t gint_t;

View File

@@ -829,7 +829,7 @@ void libblis_test_output_params_struct( FILE* os, test_params_t* params )
libblis_test_fprintf_c( os, "\n" );
libblis_test_fprintf_c( os, "active sub-configuration %s\n", bli_arch_string( bli_arch_query_id() ) );
libblis_test_fprintf_c( os, "\n" );
libblis_test_fprintf_c( os, "integer type size (bits) %d\n", ( int )int_type_size );
libblis_test_fprintf_c( os, "BLIS integer type size (bits) %d\n", ( int )int_type_size );
libblis_test_fprintf_c( os, "\n" );
libblis_test_fprintf_c( os, "SIMD number of registers %d\n", ( int )bli_info_get_simd_num_registers() );
libblis_test_fprintf_c( os, "SIMD size (bytes) %d\n", ( int )bli_info_get_simd_size() );
@@ -846,13 +846,11 @@ void libblis_test_output_params_struct( FILE* os, test_params_t* params )
libblis_test_fprintf_c( os, " obj_t stride %d\n", ( int )bli_info_get_heap_stride_align_size() );
libblis_test_fprintf_c( os, " pool block addr %d\n", ( int )bli_info_get_pool_addr_align_size() );
libblis_test_fprintf_c( os, "\n" );
libblis_test_fprintf_c( os, "BLAS compatibility layer \n" );
libblis_test_fprintf_c( os, " enabled? %d\n", ( int )bli_info_get_enable_blas() );
libblis_test_fprintf_c( os, "BLAS/CBLAS compatibility layers \n" );
libblis_test_fprintf_c( os, " BLAS API enabled? %d\n", ( int )bli_info_get_enable_blas() );
libblis_test_fprintf_c( os, " CBLAS API enabled? %d\n", ( int )bli_info_get_enable_cblas() );
libblis_test_fprintf_c( os, " integer type size (bits) %d\n", ( int )bli_info_get_blas_int_type_size() );
libblis_test_fprintf_c( os, "\n" );
libblis_test_fprintf_c( os, "CBLAS compatibility layer \n" );
libblis_test_fprintf_c( os, " enabled? %d\n", ( int )bli_info_get_enable_cblas() );
libblis_test_fprintf_c( os, "\n" );
libblis_test_fprintf_c( os, "libmemkind \n" );
libblis_test_fprintf_c( os, " enabled? %d\n", ( int )bli_info_get_enable_memkind() );
libblis_test_fprintf_c( os, "\n" );