mirror of
https://github.com/amd/blis.git
synced 2026-07-13 10:37:34 +00:00
GTestSuite: add option to test blis_impl layer
Add BLAS_TEST_IMPL option for TEST_INTERFACE to test the
wrapper layer underneath BLAS and CBLAS interfaces. This is
particularly useful if building a BLIS library with these
interfaces disabled, e.g.
./configure --disable-blas amdzen
or
cmake . -DENABLE_BLAS=OFF -DBLIS_CONFIG_FAMILY=amdzen
The ?_blis_impl wrappers should have the same arguments as the
BLAS interfaces, thus we define TEST_BLAS_LIKE as an additional
definition for convenience when selecting tests and options in
the C++ files.
AMD-Internal: [CPUPL-5650]
Change-Id: I0275a387563f3efc2b40029950c8569956f2df7b
(cherry picked from commit 8d4881c4fd)
This commit is contained in:
@@ -132,10 +132,10 @@ endif()
|
||||
# Use TEST_INTERFACE to set which interface, supported by BLIS is meant to be tested.
|
||||
set(TEST_INTERFACE "BLAS" CACHE STRING "Interface of BLIS that is being tested.")
|
||||
# Set the possible values of interfaces for cmake-gui
|
||||
set_property(CACHE TEST_INTERFACE PROPERTY STRINGS "BLAS" "CBLAS" "BLIS_TYPED")
|
||||
if( NOT ((TEST_INTERFACE STREQUAL "BLAS") OR (TEST_INTERFACE STREQUAL "CBLAS") OR (TEST_INTERFACE STREQUAL "BLIS_TYPED")) )
|
||||
set_property(CACHE TEST_INTERFACE PROPERTY STRINGS "BLAS" "BLAS_BLIS_IMPL" "CBLAS" "BLIS_TYPED")
|
||||
if( NOT ((TEST_INTERFACE STREQUAL "BLAS") OR (TEST_INTERFACE STREQUAL "BLAS_BLIS_IMPL") OR (TEST_INTERFACE STREQUAL "CBLAS") OR (TEST_INTERFACE STREQUAL "BLIS_TYPED")) )
|
||||
message(FATAL_ERROR "TEST_INTERFACE option ${TEST_INTERFACE} is not supported. Please use on of the following options \
|
||||
during CMake invokation: BLAS, CBLAS, BLIS_TYPED")
|
||||
during CMake invokation: BLAS, BLAS_BLIS_IMPL, CBLAS, BLIS_TYPED")
|
||||
endif()
|
||||
|
||||
# Use BLIS_ELEMENT_TYPE to set whether the elements of any matrix/vector tested are integers or floating point values.
|
||||
|
||||
@@ -107,6 +107,7 @@ $ ASAN_OPTIONS=redzone=2048 <executable>
|
||||
## BLIS Library Interface to be Tested
|
||||
* To build the testsuite using BLAS interface, configure using `-DTEST_INTERFACE=BLAS`. [**Default**]
|
||||
* To build the testsuite using CBLAS interface, configure using `-DTEST_INTERFACE=CBLAS`.
|
||||
* To build the testsuite using BLAS_BLIS_IMPL wrapper layer (called underneath BLAS and CBLAS interfaces), configure using `-DTEST_INTERFACE=BLAS_BLIS_IMPL`.
|
||||
* To build the testsuite using BLIS-typed interface, configure using `-DTEST_INTERFACE=BLIS_TYPED`. Note that more tests are built for this option, due to the extended APIs.
|
||||
## Test with upper case character arguments
|
||||
* To test with upper case character arguments, configure using `-DTEST_UPPERCASE_ARGS=ON`. [**OFF by default**]
|
||||
|
||||
@@ -43,7 +43,9 @@ elseif(REF_CBLAS STREQUAL "OpenBLAS")
|
||||
target_compile_definitions(testinghelpers PUBLIC REF_IS_OPENBLAS)
|
||||
endif()
|
||||
if(TEST_INTERFACE STREQUAL "BLAS")
|
||||
target_compile_definitions(testinghelpers PUBLIC TEST_BLAS)
|
||||
target_compile_definitions(testinghelpers PUBLIC TEST_BLAS TEST_BLAS_LIKE)
|
||||
elseif(TEST_INTERFACE STREQUAL "BLAS_BLIS_IMPL")
|
||||
target_compile_definitions(testinghelpers PUBLIC TEST_BLAS_BLIS_IMPL TEST_BLAS_LIKE)
|
||||
elseif(TEST_INTERFACE STREQUAL "CBLAS")
|
||||
target_compile_definitions(testinghelpers PUBLIC TEST_CBLAS)
|
||||
else() # BLIS_TYPED option
|
||||
|
||||
@@ -127,7 +127,9 @@ foreach(dir ${test_files})
|
||||
endif()
|
||||
target_link_libraries(${exec_name} ${ASAN_FLAGS} ${COVERAGE_FLAGS})
|
||||
if(TEST_INTERFACE STREQUAL "BLAS")
|
||||
target_compile_definitions(${exec_name} PUBLIC TEST_BLAS API_PRINT="blas")
|
||||
target_compile_definitions(${exec_name} PUBLIC TEST_BLAS TEST_BLAS_LIKE API_PRINT="blas")
|
||||
elseif(TEST_INTERFACE STREQUAL "BLAS_BLIS_IMPL")
|
||||
target_compile_definitions(${exec_name} PUBLIC TEST_BLAS_BLIS_IMPL TEST_BLAS_LIKE API_PRINT="blas_blis_impl")
|
||||
elseif(TEST_INTERFACE STREQUAL "CBLAS")
|
||||
target_compile_definitions(${exec_name} PUBLIC TEST_CBLAS API_PRINT="cblas")
|
||||
else() # BLIS_TYPED option
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_P( cimatcopyEVT, API )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
static float AOCL_INF = std::numeric_limits<float>::infinity();
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST_P( cimatcopyGeneric, API )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_in_inc, lda_out_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of cimatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_P( dimatcopyEVT, API )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double AOCL_INF = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST_P( dimatcopyGeneric, API )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_in_inc, lda_out_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of dimatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -82,7 +82,7 @@ static void imatcopy( char trans, gtint_t m, gtint_t n, T alpha, T* A, gtint_t l
|
||||
gtint_t lda_out_cpy = lda_out;
|
||||
#endif
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
#ifdef TEST_BLAS_LIKE
|
||||
imatcopy_<T>( trans, m, n, alpha, A, lda_in, lda_out );
|
||||
#else
|
||||
throw std::runtime_error("Error in testsuite/level1/imatcopy.h: No interfaces are set to be tested.");
|
||||
|
||||
@@ -45,7 +45,7 @@ TYPED_TEST_SUITE(imatcopy_IIT_ERS, TypeParam);
|
||||
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
|
||||
/*
|
||||
Incorrect Input Testing(IIT)
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_P( simatcopyEVT, API )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
static float AOCL_INF = std::numeric_limits<float>::infinity();
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST_P( simatcopyGeneric, API )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_in_inc, lda_out_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of simatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_P( zimatcopyEVT, API )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double AOCL_INF = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST_P( zimatcopyGeneric, API )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_in_inc, lda_out_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of zimatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_P( comatcopyEVT, API )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
static float AOCL_INF = std::numeric_limits<float>::infinity();
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST_P( comatcopyGeneric, API )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of comatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_P( domatcopyEVT, API )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double AOCL_INF = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST_P( domatcopyGeneric, API )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of domatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -93,7 +93,7 @@ static void omatcopy( char trans, gtint_t m, gtint_t n, T alpha, T* A, gtint_t l
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
#ifdef TEST_BLAS_LIKE
|
||||
omatcopy_<T>( trans, m, n, alpha, A, lda, B, ldb );
|
||||
#else
|
||||
throw std::runtime_error("Error in testsuite/extension/omatcopy.h: No interfaces are set to be tested.");
|
||||
|
||||
@@ -45,7 +45,7 @@ TYPED_TEST_SUITE(omatcopy_IIT_ERS, TypeParam);
|
||||
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
|
||||
/*
|
||||
Incorrect Input Testing(IIT)
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_P( somatcopyEVT, API )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
static float AOCL_INF = std::numeric_limits<float>::infinity();
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST_P( somatcopyGeneric, API )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of somatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_P( zomatcopyEVT, API )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double AOCL_INF = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST_P( zomatcopyGeneric, API )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
#if defined(TEST_BLAS_LIKE) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of zomatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -93,7 +93,7 @@ TEST_P( comatcopy2EVT, API )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
#if defined(TEST_BLAS_LIKE) && defined(REF_IS_MKL)
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
static float AOCL_INF = std::numeric_limits<float>::infinity();
|
||||
|
||||
@@ -89,7 +89,7 @@ TEST_P( comatcopy2Generic, API )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
#if defined(TEST_BLAS_LIKE) && defined(REF_IS_MKL)
|
||||
// Black box testing for generic and main use of comatcopy2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -93,7 +93,7 @@ TEST_P( domatcopy2EVT, API )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
#if defined(TEST_BLAS_LIKE) && defined(REF_IS_MKL)
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double AOCL_INF = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -89,7 +89,7 @@ TEST_P( domatcopy2Generic, API )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
#if defined(TEST_BLAS_LIKE) && defined(REF_IS_MKL)
|
||||
// Black box testing for generic and main use of domatcopy2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -96,7 +96,7 @@ static void omatcopy2( char trans, gtint_t m, gtint_t n, T alpha, T* A, gtint_t
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
#ifdef TEST_BLAS_LIKE
|
||||
omatcopy2_<T>( trans, m, n, alpha, A, lda, stridea, B, ldb, strideb );
|
||||
#else
|
||||
throw std::runtime_error("Error in testsuite/extension/omatcopy2.h: No interfaces are set to be tested.");
|
||||
|
||||
@@ -45,7 +45,7 @@ TYPED_TEST_SUITE(omatcopy2_IIT_ERS, TypeParam);
|
||||
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
|
||||
/*
|
||||
Incorrect Input Testing(IIT)
|
||||
|
||||
@@ -93,7 +93,7 @@ TEST_P( somatcopy2EVT, API )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
#if defined(TEST_BLAS_LIKE) && defined(REF_IS_MKL)
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
static float AOCL_INF = std::numeric_limits<float>::infinity();
|
||||
|
||||
@@ -89,7 +89,7 @@ TEST_P( somatcopy2Generic, API )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
#if defined(TEST_BLAS_LIKE) && defined(REF_IS_MKL)
|
||||
// Black box testing for generic and main use of somatcopy2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -93,7 +93,7 @@ TEST_P( zomatcopy2EVT, API )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
#if defined(TEST_BLAS_LIKE) && defined(REF_IS_MKL)
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
static float AOCL_INF = std::numeric_limits<float>::infinity();
|
||||
|
||||
@@ -89,7 +89,7 @@ TEST_P( zomatcopy2Generic, API )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
#if defined(TEST_BLAS_LIKE) && defined(REF_IS_MKL)
|
||||
// Black box testing for generic and main use of zomatcopy2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
|
||||
@@ -94,6 +94,8 @@ static void addv(char conjx, gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/addv.h: BLAS interface is not available.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
throw std::runtime_error("Error in testsuite/level1/addv.h: BLAS_BLIS_IMPL interface is not available.");
|
||||
#elif TEST_CBLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/addv.h: CBLAS interface is not available.");
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -66,6 +66,24 @@ static gtint_t amaxv_(gtint_t n, T* x, gtint_t incx) {
|
||||
return idx;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static gtint_t amaxv_blis_impl(gtint_t n, T* x, gtint_t incx) {
|
||||
|
||||
gtint_t idx;
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
idx = isamax_blis_impl( &n, x, &incx );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
idx = idamax_blis_impl( &n, x, &incx );
|
||||
else if constexpr (std::is_same<T, scomplex>::value)
|
||||
idx = icamax_blis_impl( &n, x, &incx );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
idx = izamax_blis_impl( &n, x, &incx );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/amaxv.h: Invalid typename in amaxv_blis_impl().");
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static gtint_t cblas_amaxv(gtint_t n, T* x, gtint_t incx) {
|
||||
|
||||
@@ -125,6 +143,10 @@ static gtint_t amaxv(gtint_t n, T* x, gtint_t incx)
|
||||
// Since we would be comparing against CBLAS which is 0-based and BLAS
|
||||
// which is 1-based, we need decrement the result of BLAS call by 1.
|
||||
return ( amaxv_<T>(n, x, incx) - 1 );
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
// Since we would be comparing against CBLAS which is 0-based and BLAS
|
||||
// which is 1-based, we need decrement the result of BLAS call by 1.
|
||||
return ( amaxv_blis_impl<T>(n, x, incx) - 1 );
|
||||
#elif TEST_CBLAS
|
||||
return cblas_amaxv<T>(n, x, incx);
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -40,13 +40,13 @@
|
||||
#include "inc/check_error.h"
|
||||
|
||||
template <typename T>
|
||||
class amaxv_IIT_ERS : public ::testing::Test {};
|
||||
class amaxvIIT_ERS : public ::testing::Test {};
|
||||
typedef ::testing::Types<float, double, scomplex, dcomplex> TypeParam;
|
||||
TYPED_TEST_SUITE(amaxv_IIT_ERS, TypeParam);
|
||||
TYPED_TEST_SUITE(amaxvIIT_ERS, TypeParam);
|
||||
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
/*
|
||||
|
||||
Early Return Scenarios(ERS) for BLAS/CBLAS compliance :
|
||||
@@ -65,7 +65,7 @@ using namespace testinghelpers::IIT;
|
||||
*/
|
||||
|
||||
// n < 1, with non-unit stride
|
||||
TYPED_TEST(amaxv_IIT_ERS, n_lt_one_nonUnitStride)
|
||||
TYPED_TEST(amaxvIIT_ERS, n_lt_one_nonUnitStride)
|
||||
{
|
||||
using T = TypeParam;
|
||||
gtint_t n = 0;
|
||||
@@ -73,11 +73,9 @@ TYPED_TEST(amaxv_IIT_ERS, n_lt_one_nonUnitStride)
|
||||
gtint_t idx = 42;
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( n, nullptr, inc );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( n, nullptr, inc );
|
||||
#endif
|
||||
idx = amaxv<T>( n, nullptr, inc );
|
||||
|
||||
// Computing the difference.
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
|
||||
// Test with all arguments correct except for the value we are choosing to test.
|
||||
@@ -85,29 +83,23 @@ TYPED_TEST(amaxv_IIT_ERS, n_lt_one_nonUnitStride)
|
||||
std::vector<T> x = testinghelpers::get_random_vector<T>( -10, 10, N, inc );
|
||||
|
||||
// Invoking AMAXV with an invalid value of n.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( n, x.data(), inc );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( n, x.data(), inc );
|
||||
#endif
|
||||
idx = amaxv<T>( n, x.data(), inc );
|
||||
|
||||
// Computing the difference.
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
}
|
||||
|
||||
// inc == 0, with non-unit stride
|
||||
TYPED_TEST(amaxv_IIT_ERS, incx_eq_zero)
|
||||
TYPED_TEST(amaxvIIT_ERS, incx_eq_zero)
|
||||
{
|
||||
using T = TypeParam;
|
||||
gtint_t inc = 0;
|
||||
gtint_t idx = 42;
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( N, nullptr, inc );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( N, nullptr, inc );
|
||||
#endif
|
||||
idx = amaxv<T>( N, nullptr, inc );
|
||||
|
||||
// Computing the difference.
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
|
||||
// Test with all arguments correct except for the value we are choosing to test.
|
||||
@@ -115,18 +107,14 @@ TYPED_TEST(amaxv_IIT_ERS, incx_eq_zero)
|
||||
std::vector<T> x = testinghelpers::get_random_vector<T>( -10, 10, N, 1 );
|
||||
|
||||
// Invoking AMAXV with an invalid value of incx.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( N, x.data(), inc );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( N, x.data(), inc );
|
||||
#endif
|
||||
idx = amaxv<T>( N, x.data(), inc );
|
||||
|
||||
// Computing the difference.
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
}
|
||||
|
||||
// n < 1, with unit stride
|
||||
TYPED_TEST(amaxv_IIT_ERS, n_lt_one_unitStride)
|
||||
TYPED_TEST(amaxvIIT_ERS, n_lt_one_unitStride)
|
||||
{
|
||||
using T = TypeParam;
|
||||
gtint_t n = 0;
|
||||
@@ -134,11 +122,9 @@ TYPED_TEST(amaxv_IIT_ERS, n_lt_one_unitStride)
|
||||
gtint_t idx = 42;
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( n, nullptr, unit_inc );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( n, nullptr, unit_inc );
|
||||
#endif
|
||||
idx = amaxv<T>( n, nullptr, unit_inc );
|
||||
|
||||
// Computing the difference.
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
|
||||
// Test with all arguments correct except for the value we are choosing to test.
|
||||
@@ -146,18 +132,14 @@ TYPED_TEST(amaxv_IIT_ERS, n_lt_one_unitStride)
|
||||
std::vector<T> x = testinghelpers::get_random_vector<T>( -10, 10, N, unit_inc );
|
||||
|
||||
// Invoking AMAXV with an invalid value of n.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( n, x.data(), unit_inc );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( n, x.data(), unit_inc );
|
||||
#endif
|
||||
idx = amaxv<T>( n, x.data(), unit_inc );
|
||||
|
||||
// Computing the difference.
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
}
|
||||
|
||||
// n == 1, with unit stride
|
||||
TYPED_TEST(amaxv_IIT_ERS, n_eq_one_unitStride)
|
||||
TYPED_TEST(amaxvIIT_ERS, n_eq_one_unitStride)
|
||||
{
|
||||
using T = TypeParam;
|
||||
gtint_t n = 1;
|
||||
@@ -165,11 +147,12 @@ TYPED_TEST(amaxv_IIT_ERS, n_eq_one_unitStride)
|
||||
gtint_t idx = 42;
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( n, nullptr, unit_inc );
|
||||
idx = amaxv<T>( n, nullptr, unit_inc );
|
||||
|
||||
// Computing the difference.
|
||||
#ifdef TEST_BLAS_LIKE
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(1) );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( n, nullptr, unit_inc );
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
#endif
|
||||
|
||||
@@ -178,17 +161,18 @@ TYPED_TEST(amaxv_IIT_ERS, n_eq_one_unitStride)
|
||||
std::vector<T> x = testinghelpers::get_random_vector<T>( -10, 10, N, unit_inc );
|
||||
|
||||
// Invoking AMAXV with an invalid value of n.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( n, x.data(), unit_inc );
|
||||
idx = amaxv<T>( n, x.data(), unit_inc );
|
||||
|
||||
// Computing the difference.
|
||||
#ifdef TEST_BLAS_LIKE
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(1) );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( n, x.data(), unit_inc );
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
TYPED_TEST(amaxv_IIT_ERS, n_eq_one_nonUnitStrides)
|
||||
TYPED_TEST(amaxvIIT_ERS, n_eq_one_nonUnitStrides)
|
||||
{
|
||||
using T = TypeParam;
|
||||
gtint_t n = 1;
|
||||
@@ -196,11 +180,12 @@ TYPED_TEST(amaxv_IIT_ERS, n_eq_one_nonUnitStrides)
|
||||
gtint_t idx = 42;
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( n, nullptr, inc );
|
||||
idx = amaxv<T>( n, nullptr, inc );
|
||||
|
||||
// Computing the difference.
|
||||
#ifdef TEST_BLAS_LIKE
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(1) );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( n, nullptr, inc );
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
#endif
|
||||
|
||||
@@ -209,11 +194,12 @@ TYPED_TEST(amaxv_IIT_ERS, n_eq_one_nonUnitStrides)
|
||||
std::vector<T> x = testinghelpers::get_random_vector<T>( -10, 10, N, inc );
|
||||
|
||||
// Invoking AMAXV with an invalid value of n.
|
||||
#ifdef TEST_BLAS
|
||||
idx = amaxv_<T>( n, x.data(), inc );
|
||||
idx = amaxv<T>( n, x.data(), inc );
|
||||
|
||||
// Computing the difference.
|
||||
#ifdef TEST_BLAS_LIKE
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(1) );
|
||||
#else
|
||||
idx = cblas_amaxv<T>( n, x.data(), inc );
|
||||
computediff<gtint_t>( "idx", idx, gtint_t(0) );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -67,6 +67,21 @@ static void axpbyv_(gtint_t n, T alpha, T* x, gtint_t incx, T beta, T* y, gtint_
|
||||
throw std::runtime_error("Error in testsuite/level1/axpbyv.h: Invalid typename in axpbyv_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void axpbyv_blis_impl(gtint_t n, T alpha, T* x, gtint_t incx, T beta, T* y, gtint_t incy)
|
||||
{
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
saxpby_blis_impl( &n, &alpha, x, &incx, &beta, y, &incy );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
daxpby_blis_impl( &n, &alpha, x, &incx, &beta, y, &incy );
|
||||
else if constexpr (std::is_same<T, scomplex>::value)
|
||||
caxpby_blis_impl( &n, &alpha, x, &incx, &beta, y, &incy );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
zaxpby_blis_impl( &n, &alpha, x, &incx, &beta, y, &incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/axpbyv.h: Invalid typename in axpbyv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_axpbyv(gtint_t n, T alpha, T* x, gtint_t incx, T beta, T* y, gtint_t incy)
|
||||
{
|
||||
@@ -129,6 +144,8 @@ static void axpbyv(char conj_x, gtint_t n, T alpha, T* x, gtint_t incx, T beta,
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
axpbyv_<T>( n, alpha, x, incx, beta, y, incy );
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
axpbyv_blis_impl<T>( n, alpha, x, incx, beta, y, incy );
|
||||
#elif TEST_CBLAS
|
||||
cblas_axpbyv<T>( n, alpha, x, incx, beta, y, incy );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -46,7 +46,7 @@ TYPED_TEST_SUITE(axpbyv_IIT_ERS, TypeParam); // Defining individual testsuites b
|
||||
// Adding namespace to get default parameters(valid case) from testinghelpers/common/wrong_input_helpers.h.
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
/*
|
||||
Early Return Scenarios(ERS) :
|
||||
The early return cases for ?axpbyv are not defined under BLAS compliance.
|
||||
|
||||
@@ -66,6 +66,21 @@ static void axpyv_(gtint_t n, T alpha, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
throw std::runtime_error("Error in testsuite/level1/axpyv.h: Invalid typename in axpyv_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void axpyv_blis_impl(gtint_t n, T alpha, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
{
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
saxpy_blis_impl( &n, &alpha, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
daxpy_blis_impl( &n, &alpha, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, scomplex>::value)
|
||||
caxpy_blis_impl( &n, &alpha, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
zaxpy_blis_impl( &n, &alpha, x, &incx, y, &incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/axpyv.h: Invalid typename in axpyv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_axpyv(gtint_t n, T alpha, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
{
|
||||
@@ -127,6 +142,8 @@ static void axpyv(char conj_x, gtint_t n, T alpha, T* x, gtint_t incx, T* y, gti
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
axpyv_<T>( n, alpha, x, incx, y, incy );
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
axpyv_blis_impl<T>( n, alpha, x, incx, y, incy );
|
||||
#elif TEST_CBLAS
|
||||
cblas_axpyv<T>( n, alpha, x, incx, y, incy );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -46,7 +46,7 @@ TYPED_TEST_SUITE(axpyv_IIT_ERS, TypeParam); // Defining individual testsuites ba
|
||||
// Adding namespace to get default parameters(valid case) from testinghelpers/common/wrong_input_helpers.h.
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
/*
|
||||
Early Return Scenarios(ERS) for BLAS/CBLAS compliance :
|
||||
|
||||
|
||||
@@ -65,6 +65,21 @@ static void copyv_(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy) {
|
||||
throw std::runtime_error("Error in testsuite/level1/copyv.h: Invalid typename in copyv_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void copyv_blis_impl(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy) {
|
||||
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
scopy_blis_impl( &n, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
dcopy_blis_impl( &n, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, scomplex>::value)
|
||||
ccopy_blis_impl( &n, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
zcopy_blis_impl( &n, x, &incx, y, &incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/copyv.h: Invalid typename in copyv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_copyv(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy) {
|
||||
|
||||
@@ -125,6 +140,8 @@ static void copyv(char conjx, gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
copyv_<T>(n, x, incx, y, incy);
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
copyv_blis_impl<T>(n, x, incx, y, incy);
|
||||
#elif TEST_CBLAS
|
||||
cblas_copyv<T>(n, x, incx, y, incy);
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -46,7 +46,7 @@ TYPED_TEST_SUITE(copyv_IIT_ERS, TypeParam); // Defining individual testsuites ba
|
||||
// Adding namespace to get default parameters(valid case) from testinghelpers/common/wrong_input_helpers.h.
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
/*
|
||||
Early Return Scenarios(ERS) for BLAS/CBLAS compliance:
|
||||
|
||||
|
||||
@@ -110,6 +110,64 @@ static void dotc_(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy, T* rho) {
|
||||
throw std::runtime_error("Error in testsuite/level1/dotv.h: Invalid typename in dotc_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void dotv_blis_impl(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy, T* rho) {
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
*rho = sdot_blis_impl(&n, x, &incx, y, &incy);
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
*rho = ddot_blis_impl( &n, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, scomplex>::value)
|
||||
#ifdef BLIS_DISABLE_COMPLEX_RETURN_INTEL
|
||||
*rho = cdotu_blis_impl(&n, x, &incx, y, &incy);
|
||||
#else
|
||||
cdotu_blis_impl(rho, &n, x, &incx, y, &incy);
|
||||
#endif
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
#ifdef BLIS_DISABLE_COMPLEX_RETURN_INTEL
|
||||
*rho = zdotu_blis_impl(&n, x, &incx, y, &incy);
|
||||
#else
|
||||
zdotu_blis_impl(rho, &n, x, &incx, y, &incy);
|
||||
#endif
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/dotv.h: Invalid typename in dotv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void dotu_blis_impl(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy, T* rho) {
|
||||
if constexpr (std::is_same<T, scomplex>::value)
|
||||
#ifdef BLIS_DISABLE_COMPLEX_RETURN_INTEL
|
||||
*rho = cdotu_blis_impl(&n, x, &incx, y, &incy);
|
||||
#else
|
||||
cdotu_blis_impl(rho, &n, x, &incx, y, &incy);
|
||||
#endif
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
#ifdef BLIS_DISABLE_COMPLEX_RETURN_INTEL
|
||||
*rho = zdotu_blis_impl(&n, x, &incx, y, &incy);
|
||||
#else
|
||||
zdotu_blis_impl(rho, &n, x, &incx, y, &incy);
|
||||
#endif
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/dotv.h: Invalid typename in dotu_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void dotc_blis_impl(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy, T* rho) {
|
||||
if constexpr (std::is_same<T, scomplex>::value)
|
||||
#ifdef BLIS_DISABLE_COMPLEX_RETURN_INTEL
|
||||
*rho = cdotc_blis_impl(&n, x, &incx, y, &incy);
|
||||
#else
|
||||
cdotc_blis_impl(rho, &n, x, &incx, y, &incy);
|
||||
#endif
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
#ifdef BLIS_DISABLE_COMPLEX_RETURN_INTEL
|
||||
*rho = zdotc_blis_impl(&n, x, &incx, y, &incy);
|
||||
#else
|
||||
zdotc_blis_impl(rho, &n, x, &incx, y, &incy);
|
||||
#endif
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/dotv.h: Invalid typename in dotc_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_dotv(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy, T* rho) {
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
@@ -205,6 +263,16 @@ static void dotv(char conjx, char conjy, gtint_t n,
|
||||
else
|
||||
dotu_<T>(n, x, incx, y, incy, rho);
|
||||
}
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if constexpr ( testinghelpers::type_info<T>::is_real )
|
||||
dotv_blis_impl<T>(n, x, incx, y, incy, rho);
|
||||
else if constexpr ( testinghelpers::type_info<T>::is_complex )
|
||||
{
|
||||
if ( testinghelpers::chkconj(conjx) )
|
||||
dotc_blis_impl<T>(n, x, incx, y, incy, rho);
|
||||
else
|
||||
dotu_blis_impl<T>(n, x, incx, y, incy, rho);
|
||||
}
|
||||
#elif TEST_CBLAS
|
||||
if constexpr ( testinghelpers::type_info<T>::is_real )
|
||||
cblas_dotv<T>(n, x, incx, y, incy, rho);
|
||||
|
||||
@@ -45,7 +45,7 @@ TYPED_TEST_SUITE(dotv_IIT_ERS, TypeParam);
|
||||
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
|
||||
/*
|
||||
BLAS Early Return Scenarios(ERS):
|
||||
|
||||
@@ -105,6 +105,8 @@ static void dotxv( char conjx, char conjy, gtint_t n, T* alpha,
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/dotxv.h: BLAS interface is not available.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
throw std::runtime_error("Error in testsuite/level1/dotxv.h: BLAS_BLIS_IMPL interface is not available.");
|
||||
#elif TEST_CBLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/dotxv.h: CBLAS interface is not available.");
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -97,8 +97,10 @@ static void scal2v(char conjx, gtint_t n, T alpha, T* x, gtint_t incx, T* y, gti
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/scal2v.h: BLAS interface is not available.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
throw std::runtime_error("Error in testsuite/level1/scal2v.h: BLAS_BLIS_IMPL interface is not available.");
|
||||
#elif TEST_CBLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/scal2v.h: BLAS interface is not available.");
|
||||
throw std::runtime_error("Error in testsuite/level1/scal2v.h: CBLAS interface is not available.");
|
||||
#elif TEST_BLIS_TYPED
|
||||
typed_scal2v<T>( conjx, n, alpha, x, incx, y, incy );
|
||||
#else
|
||||
|
||||
@@ -73,6 +73,29 @@ static void scalv_(gtint_t n, U alpha, T* x, gtint_t incx)
|
||||
throw std::runtime_error("Error in testsuite/level1/scalv.h: Invalid typename in scalv_().");
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
static void scalv_blis_impl(gtint_t n, U alpha, T* x, gtint_t incx)
|
||||
{
|
||||
if constexpr (std::is_same<T, U>::value)
|
||||
{
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
sscal_blis_impl( &n, &alpha, x, &incx );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
dscal_blis_impl( &n, &alpha, x, &incx );
|
||||
else if constexpr (std::is_same<T, scomplex>::value)
|
||||
cscal_blis_impl( &n, &alpha, x, &incx );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
zscal_blis_impl( &n, &alpha, x, &incx );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/scalv.h: Invalid typename in scalv_blis_impl().");
|
||||
}
|
||||
else if constexpr (std::is_same<T, scomplex>::value && std::is_same<U, float>::value )
|
||||
csscal_blis_impl( &n, &alpha, x, &incx );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value && std::is_same<U, double>::value )
|
||||
zdscal_blis_impl( &n, &alpha, x, &incx );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/scalv.h: Invalid typename in scalv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
static void cblas_scalv(gtint_t n, U alpha, T* x, gtint_t incx)
|
||||
@@ -147,6 +170,8 @@ static void scalv(char conj_alpha, gtint_t n, U alpha, T* x, gtint_t incx)
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
scalv_<T, U>( n, alpha, x, incx );
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
scalv_blis_impl<T, U>( n, alpha, x, incx );
|
||||
#elif TEST_CBLAS
|
||||
cblas_scalv<T, U>( n, alpha, x, incx );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -53,7 +53,7 @@ TYPED_TEST_SUITE(scalv_IIT_ERS, TypeParam);
|
||||
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
|
||||
/*
|
||||
BLAS Early Return Scenarios(ERS):
|
||||
|
||||
@@ -84,6 +84,8 @@ static void setv(char conjalpha, gtint_t n, T* alpha, T* x, gtint_t incx)
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/setv.h: BLAS interface is not available.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
throw std::runtime_error("Error in testsuite/level1/setv.h: BLAS_BLIS_IMPL interface is not available.");
|
||||
#elif TEST_CBLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/setv.h: CBLAS interface is not available.");
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -94,6 +94,8 @@ static void subv(char conjx, gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/subv.h: BLAS interface is not available.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
throw std::runtime_error("Error in testsuite/level1/subv.h: BLAS_BLIS_IMPL interface is not available.");
|
||||
#elif TEST_CBLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/subv.h: CBLAS interface is not available.");
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -64,6 +64,22 @@ static void swapv_(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
throw std::runtime_error("Error in testsuite/level1/swapv.h: Invalid typename in swapv_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void swapv_blis_impl(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
{
|
||||
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
sswap_blis_impl( &n, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
dswap_blis_impl( &n, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, scomplex>::value)
|
||||
cswap_blis_impl( &n, x, &incx, y, &incy );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
zswap_blis_impl( &n, x, &incx, y, &incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level1/swapv.h: Invalid typename in swapv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_swapv(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
{
|
||||
@@ -109,6 +125,8 @@ static void swapv(gtint_t n, T* x, gtint_t incx, T* y, gtint_t incy)
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
swapv_<T>( n, x, incx, y, incy );
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
swapv_blis_impl<T>( n, x, incx, y, incy );
|
||||
#elif TEST_CBLAS
|
||||
cblas_swapv<T>( n, x, incx, y, incy );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -45,7 +45,7 @@ TYPED_TEST_SUITE(swapv_IIT_ERS, TypeParam);
|
||||
|
||||
using namespace testinghelpers::IIT;
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
|
||||
/*
|
||||
BLIS Early Return Scenarios(ERS):
|
||||
|
||||
@@ -96,6 +96,8 @@ static void xpbyv(char conj_x, gtint_t n, T* x, gtint_t incx, T beta, T* y, gtin
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/xpbyv.h: BLAS interface is not available.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
throw std::runtime_error("Error in testsuite/level1/xpbyv.h: BLAS_BLIS_IMPL interface is not available.");
|
||||
#elif TEST_CBLAS
|
||||
throw std::runtime_error("Error in testsuite/level1/xpbyv.h: CBLAS interface is not available.");
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -100,7 +100,7 @@ TYPED_TEST(gemv_IIT_ERS, invalid_storage)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
|
||||
/*
|
||||
Incorrect Input Testing(IIT)
|
||||
@@ -126,7 +126,7 @@ TYPED_TEST(gemv_IIT_ERS, invalid_trans)
|
||||
testinghelpers::initone<T>( beta );
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
gemv<T>( STORAGE, 'p', CONJ, M, N, nullptr, nullptr, LDA,
|
||||
nullptr, incx, nullptr, nullptr, incy );
|
||||
#else
|
||||
@@ -178,7 +178,7 @@ TYPED_TEST(gemv_IIT_ERS, m_lt_zero)
|
||||
testinghelpers::initone<T>( beta );
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
gemv<T>( STORAGE, TRANS, CONJ, invalid_m, N, nullptr, nullptr, LDA,
|
||||
nullptr, incx, nullptr, nullptr, incy );
|
||||
#else
|
||||
@@ -230,7 +230,7 @@ TYPED_TEST(gemv_IIT_ERS, n_lt_zero)
|
||||
testinghelpers::initone<T>( beta );
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
gemv<T>( STORAGE, TRANS, CONJ, M, invalid_n, nullptr, nullptr, LDA,
|
||||
nullptr, incx, nullptr, nullptr, incy );
|
||||
#else
|
||||
@@ -282,7 +282,7 @@ TYPED_TEST(gemv_IIT_ERS, invalid_lda)
|
||||
testinghelpers::initone<T>( beta );
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
gemv<T>( STORAGE, TRANS, CONJ, M, N, nullptr, nullptr, LDA - 1,
|
||||
nullptr, incx, nullptr, nullptr, incy );
|
||||
#else
|
||||
@@ -334,7 +334,7 @@ TYPED_TEST(gemv_IIT_ERS, incx_eq_zero)
|
||||
testinghelpers::initone<T>( beta );
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
gemv<T>( STORAGE, TRANS, CONJ, M, N, nullptr, nullptr, LDA,
|
||||
nullptr, 0, nullptr, nullptr, incy );
|
||||
#else
|
||||
@@ -386,7 +386,7 @@ TYPED_TEST(gemv_IIT_ERS, incy_eq_zero)
|
||||
testinghelpers::initone<T>( beta );
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
gemv<T>( STORAGE, TRANS, CONJ, M, N, nullptr, nullptr, LDA,
|
||||
nullptr, incx, nullptr, nullptr, 0 );
|
||||
#else
|
||||
@@ -447,7 +447,7 @@ TYPED_TEST(gemv_IIT_ERS, m_eq_zero)
|
||||
T beta = T{0.7};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
gemv<T>( STORAGE, TRANS, CONJ, invalid_m, N, nullptr, nullptr, LDA,
|
||||
nullptr, incx, nullptr, nullptr, incy );
|
||||
#else
|
||||
@@ -499,7 +499,7 @@ TYPED_TEST(gemv_IIT_ERS, n_eq_zero)
|
||||
T beta = T{0.7};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
gemv<T>( STORAGE, TRANS, CONJ, M, invalid_n, nullptr, nullptr, LDA,
|
||||
nullptr, incx, nullptr, nullptr, incy );
|
||||
#else
|
||||
@@ -552,7 +552,7 @@ TYPED_TEST(gemv_IIT_ERS, m_eq_zero_Unitbeta)
|
||||
testinghelpers::initone<T>( beta );
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
gemv<T>( STORAGE, TRANS, CONJ, invalid_m, N, &alpha, nullptr, LDA,
|
||||
nullptr, incx, nullptr, nullptr, incy );
|
||||
#else
|
||||
|
||||
@@ -121,7 +121,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -187,7 +187,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -242,7 +242,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -293,7 +293,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -110,7 +110,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -133,7 +133,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -156,7 +156,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -180,7 +180,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -204,7 +204,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -228,7 +228,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -251,7 +251,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -274,7 +274,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -120,7 +120,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -157,7 +157,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -183,7 +183,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -220,7 +220,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -110,7 +110,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -133,7 +133,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -156,7 +156,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -179,7 +179,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -203,7 +203,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -77,6 +77,22 @@ static void gemv_( char transa, gtint_t m, gtint_t n, T* alpha, T* ap, gtint_t l
|
||||
throw std::runtime_error("Error in testsuite/level2/gemv.h: Invalid typename in gemv_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void gemv_blis_impl( char transa, gtint_t m, gtint_t n, T* alpha, T* ap, gtint_t lda,
|
||||
T* xp, gtint_t incx, T* beta, T* yp, gtint_t incy )
|
||||
{
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
sgemv_blis_impl( &transa, &m, &n, alpha, ap, &lda, xp, &incx, beta, yp, &incy );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
dgemv_blis_impl( &transa, &m, &n, alpha, ap, &lda, xp, &incx, beta, yp, &incy );
|
||||
else if constexpr (std::is_same<T, scomplex>::value)
|
||||
cgemv_blis_impl( &transa, &m, &n, alpha, ap, &lda, xp, &incx, beta, yp, &incy );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
zgemv_blis_impl( &transa, &m, &n, alpha, ap, &lda, xp, &incx, beta, yp, &incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/gemv.h: Invalid typename in gemv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_gemv( char storage, char trans, gtint_t m, gtint_t n, T* alpha,
|
||||
T* ap, gtint_t lda, T* xp, gtint_t incx, T* beta, T* yp, gtint_t incy )
|
||||
@@ -182,6 +198,11 @@ static void gemv( char storage, char trans, char conj_x, gtint_t m, gtint_t n,
|
||||
gemv_<T>( trans, m, n, alpha, ap, lda, xp, incx, beta, yp, incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/gemv.h: BLAS interface cannot be tested for row-major order.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if( storage == 'c' || storage == 'C' )
|
||||
gemv_blis_impl<T>( trans, m, n, alpha, ap, lda, xp, incx, beta, yp, incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/gemv.h: BLAS_BLIS_IMPL interface cannot be tested for row-major order.");
|
||||
#elif TEST_CBLAS
|
||||
cblas_gemv<T>( storage, trans, m, n, alpha, ap, lda, xp, incx, beta, yp, incy );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -120,7 +120,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
sgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -157,7 +157,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
sgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -183,7 +183,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
sgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -220,7 +220,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
sgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -110,7 +110,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
sgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -133,7 +133,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
sgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -156,7 +156,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
sgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -179,7 +179,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
sgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -202,7 +202,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
sgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -121,7 +121,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -187,7 +187,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -242,7 +242,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -293,7 +293,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zgemvEVT,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -110,7 +110,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -133,7 +133,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -156,7 +156,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -179,7 +179,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
@@ -203,7 +203,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zgemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -124,7 +124,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -169,7 +169,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
|
||||
@@ -99,7 +99,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -134,7 +134,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -166,7 +166,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -200,7 +200,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -232,7 +232,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -263,7 +263,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -294,7 +294,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
|
||||
@@ -123,7 +123,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -168,7 +168,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
|
||||
@@ -97,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -159,7 +159,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -193,7 +193,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -225,7 +225,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -256,7 +256,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -287,7 +287,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
|
||||
@@ -81,6 +81,30 @@ static void ger_( char conjy, gtint_t m, gtint_t n, T* alpha,
|
||||
throw std::runtime_error("Error in testsuite/level2/ger.h: Invalid typename in ger_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void ger_blis_impl( char conjy, gtint_t m, gtint_t n, T* alpha,
|
||||
T* xp, gtint_t incx, T* yp, gtint_t incy, T* ap, gtint_t lda )
|
||||
{
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
sger_blis_impl( &m, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
dger_blis_impl( &m, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
else if constexpr (std::is_same<T, scomplex>::value) {
|
||||
if( testinghelpers::chkconj( conjy ) )
|
||||
cgerc_blis_impl( &m, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
else
|
||||
cgeru_blis_impl( &m, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
}
|
||||
else if constexpr (std::is_same<T, dcomplex>::value) {
|
||||
if( testinghelpers::chkconj( conjy ) )
|
||||
zgerc_blis_impl( &m, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
else
|
||||
zgeru_blis_impl( &m, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
}
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/ger.h: Invalid typename in ger_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_ger( char storage, char conjy, gtint_t m, gtint_t n,
|
||||
T* alpha, T* xp, gtint_t incx,T* yp, gtint_t incy, T* ap, gtint_t lda )
|
||||
@@ -185,6 +209,11 @@ static void ger( char storage, char conjx, char conjy, gtint_t m, gtint_t n,
|
||||
ger_<T>( conjy, m, n, alpha, xp, incx, yp, incy, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/ger.h: BLAS interface cannot be tested for row-major order.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if( storage == 'c' || storage == 'C' )
|
||||
ger_blis_impl<T>( conjy, m, n, alpha, xp, incx, yp, incy, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/ger.h: BLAS_BLIS_IMPL interface cannot be tested for row-major order.");
|
||||
#elif TEST_CBLAS
|
||||
cblas_ger<T>( storage, conjy, m, n, alpha, xp, incx, yp, incy, ap, lda );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -89,7 +89,7 @@ TYPED_TEST(ger_IIT_ERS, invalid_storage)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
|
||||
/**
|
||||
* BLAS Invalid Input Tests(IIT):
|
||||
@@ -111,7 +111,7 @@ TYPED_TEST(ger_IIT_ERS, m_lt_zero_unitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, invalid_m, N, nullptr, nullptr, unit_inc,
|
||||
nullptr, unit_inc, nullptr, LDA );
|
||||
#else
|
||||
@@ -154,7 +154,7 @@ TYPED_TEST(ger_IIT_ERS, m_lt_zero_nonUnitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, invalid_m, N, nullptr, nullptr, inc,
|
||||
nullptr, inc, nullptr, LDA );
|
||||
#else
|
||||
@@ -197,7 +197,7 @@ TYPED_TEST(ger_IIT_ERS, n_lt_zero_unitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, invalid_n, nullptr, nullptr, unit_inc,
|
||||
nullptr, unit_inc, nullptr, LDA );
|
||||
#else
|
||||
@@ -240,7 +240,7 @@ TYPED_TEST(ger_IIT_ERS, n_lt_zero_nonUnitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, invalid_n, nullptr, nullptr, inc,
|
||||
nullptr, inc, nullptr, LDA );
|
||||
#else
|
||||
@@ -283,7 +283,7 @@ TYPED_TEST(ger_IIT_ERS, incx_eq_zero_unitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, N, nullptr, nullptr, invalid_incx,
|
||||
nullptr, unit_inc, nullptr, LDA );
|
||||
#else
|
||||
@@ -326,7 +326,7 @@ TYPED_TEST(ger_IIT_ERS, incx_eq_zero_nonUnitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, N, nullptr, nullptr, invalid_incx,
|
||||
nullptr, inc, nullptr, LDA );
|
||||
#else
|
||||
@@ -369,7 +369,7 @@ TYPED_TEST(ger_IIT_ERS, incy_eq_zero_unitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, N, nullptr, nullptr, unit_inc,
|
||||
nullptr, invalid_incy, nullptr, LDA );
|
||||
#else
|
||||
@@ -412,7 +412,7 @@ TYPED_TEST(ger_IIT_ERS, incy_eq_zero_nonUnitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, N, nullptr, nullptr, inc,
|
||||
nullptr, invalid_incy, nullptr, LDA );
|
||||
#else
|
||||
@@ -455,7 +455,7 @@ TYPED_TEST(ger_IIT_ERS, lda_lt_max_1_m_unitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, N, nullptr, nullptr, unit_inc,
|
||||
nullptr, unit_inc, nullptr, invalid_lda );
|
||||
#else
|
||||
@@ -498,7 +498,7 @@ TYPED_TEST(ger_IIT_ERS, lda_lt_max_1_m_nonUnitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, N, nullptr, nullptr, inc,
|
||||
nullptr, inc, nullptr, invalid_lda );
|
||||
#else
|
||||
@@ -549,7 +549,7 @@ TYPED_TEST(ger_IIT_ERS, m_eq_zero_unitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, invalid_m, N, nullptr, nullptr, unit_inc,
|
||||
nullptr, unit_inc, nullptr, LDA );
|
||||
#else
|
||||
@@ -592,7 +592,7 @@ TYPED_TEST(ger_IIT_ERS, m_eq_zero_nonUnitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, invalid_m, N, nullptr, nullptr, inc,
|
||||
nullptr, inc, nullptr, LDA );
|
||||
#else
|
||||
@@ -635,7 +635,7 @@ TYPED_TEST(ger_IIT_ERS, n_eq_zero_unitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, invalid_n, nullptr, nullptr, unit_inc,
|
||||
nullptr, unit_inc, nullptr, LDA );
|
||||
#else
|
||||
@@ -678,7 +678,7 @@ TYPED_TEST(ger_IIT_ERS, n_eq_zero_nonUnitStride)
|
||||
T alpha = T{3};
|
||||
|
||||
// Test with nullptr for all suitable arguments that shouldn't be accessed.
|
||||
#if defined(TEST_BLAS)
|
||||
#if defined(TEST_BLAS_LIKE)
|
||||
ger<T>( STORAGE, CONJ, CONJ, M, invalid_n, nullptr, nullptr, inc,
|
||||
nullptr, inc, nullptr, LDA );
|
||||
#else
|
||||
|
||||
@@ -123,7 +123,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -168,7 +168,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
|
||||
@@ -97,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -132,7 +132,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -164,7 +164,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -198,7 +198,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -230,7 +230,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -260,7 +260,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -290,7 +290,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
|
||||
@@ -124,7 +124,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -169,7 +169,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
|
||||
@@ -97,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -132,7 +132,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -164,7 +164,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -198,7 +198,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -230,7 +230,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -260,7 +260,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
@@ -290,7 +290,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// storage scheme: row/col-stored matrix
|
||||
::testing::Values( 'c'
|
||||
// row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme.
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
, 'r'
|
||||
#endif
|
||||
),
|
||||
|
||||
@@ -104,7 +104,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
chemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -71,6 +71,18 @@ static void hemv_( char uploa, gtint_t n, T* alpha, T* ap, gtint_t lda,
|
||||
throw std::runtime_error("Error in testsuite/level2/hemv.h: Invalid typename in hemv_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void hemv_blis_impl( char uploa, gtint_t n, T* alpha, T* ap, gtint_t lda,
|
||||
T* xp, gtint_t incx, T* beta, T* yp, gtint_t incy )
|
||||
{
|
||||
if constexpr (std::is_same<T, scomplex>::value)
|
||||
chemv_blis_impl( &uploa, &n, alpha, ap, &lda, xp, &incx, beta, yp, &incy );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
zhemv_blis_impl( &uploa, &n, alpha, ap, &lda, xp, &incx, beta, yp, &incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/hemv.h: Invalid typename in hemv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_hemv( char storage, char uploa, gtint_t n, T* alpha,
|
||||
T* ap, gtint_t lda, T* xp, gtint_t incx, T* beta, T* yp, gtint_t incy )
|
||||
@@ -167,6 +179,11 @@ static void hemv( char storage, char uploa, char conja, char conjx, gtint_t n,
|
||||
hemv_<T>( uploa, n, alpha, ap, lda, xp, incx, beta, yp, incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/hemv.h: BLAS interface cannot be tested for row-major order.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if( storage == 'c' || storage == 'C' )
|
||||
hemv_blis_impl<T>( uploa, n, alpha, ap, lda, xp, incx, beta, yp, incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/hemv.h: BLAS_BLIS_IMPL interface cannot be tested for row-major order.");
|
||||
#elif TEST_CBLAS
|
||||
cblas_hemv<T>( storage, uploa, n, alpha, ap, lda, xp, incx, beta, yp, incy );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -104,7 +104,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zhemvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -91,7 +91,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cherGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -62,6 +62,18 @@ static void her_( char uploa, gtint_t n, Tr* alpha, T* xp, gtint_t incx,
|
||||
throw std::runtime_error("Error in testsuite/level2/her.h: Invalid typename in her_().");
|
||||
}
|
||||
|
||||
template<typename T, typename Tr>
|
||||
static void her_blis_impl( char uploa, gtint_t n, Tr* alpha, T* xp, gtint_t incx,
|
||||
T* ap, gtint_t lda )
|
||||
{
|
||||
if constexpr (std::is_same<T, scomplex>::value)
|
||||
cher_blis_impl( &uploa, &n, alpha, xp, &incx, ap, &lda );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
zher_blis_impl( &uploa, &n, alpha, xp, &incx, ap, &lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/her.h: Invalid typename in her_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T, typename Tr>
|
||||
static void cblas_her( char storage, char uploa, gtint_t n, Tr* alpha,
|
||||
T* xp, gtint_t incx, T* ap, gtint_t lda )
|
||||
@@ -144,6 +156,11 @@ static void her( char storage, char uploa, char conj_x, gtint_t n,
|
||||
her_<T>( uploa, n, alpha, xp, incx, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/her.h: BLAS interface cannot be tested for row-major order.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if( storage == 'c' || storage == 'C' )
|
||||
her_blis_impl<T>( uploa, n, alpha, xp, incx, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/her.h: BLAS_BLIS_IMPL interface cannot be tested for row-major order.");
|
||||
#elif TEST_CBLAS
|
||||
cblas_her<T>( storage, uploa, n, alpha, xp, incx, ap, lda );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -92,7 +92,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zherGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -98,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
cher2Generic,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -65,6 +65,18 @@ static void her2_( char uploa, gtint_t n, T* alpha, T* xp, gtint_t incx,
|
||||
throw std::runtime_error("Error in testsuite/level2/her2.h: Invalid typename in her2_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void her2_blis_impl( char uploa, gtint_t n, T* alpha, T* xp, gtint_t incx,
|
||||
T* yp, gtint_t incy, T* ap, gtint_t lda )
|
||||
{
|
||||
if constexpr (std::is_same<T, scomplex>::value)
|
||||
cher2_blis_impl( &uploa, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
zher2_blis_impl( &uploa, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/her2.h: Invalid typename in her2_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_her2( char storage, char uploa, gtint_t n, T* alpha,
|
||||
T* xp, gtint_t incx, T* yp, gtint_t incy, T* ap, gtint_t lda )
|
||||
@@ -159,6 +171,11 @@ static void her2( char storage, char uploa, char conj_x, char conj_y, gtint_t n,
|
||||
her2_<T>( uploa, n, alpha, xp, incx, yp, incy, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/her2.h: BLAS interface cannot be tested for row-major order.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if( storage == 'c' || storage == 'C' )
|
||||
her2_blis_impl<T>( uploa, n, alpha, xp, incx, yp, incy, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/her2.h: BLAS_BLIS_IMPL interface cannot be tested for row-major order.");
|
||||
#elif TEST_CBLAS
|
||||
cblas_her2<T>( storage, uploa, n, alpha, xp, incx, yp, incy, ap, lda );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -98,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
zher2Generic,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -103,7 +103,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dsymvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -103,7 +103,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ssymvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -66,6 +66,18 @@ static void symv_( char uploa, gtint_t n, T* alpha, T* ap, gtint_t lda,
|
||||
throw std::runtime_error("Error in testsuite/level2/symv.h: Invalid typename in symv_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void symv_blis_impl( char uploa, gtint_t n, T* alpha, T* ap, gtint_t lda,
|
||||
T* xp, gtint_t incx, T* beta, T* yp, gtint_t incy )
|
||||
{
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
ssymv_blis_impl( &uploa, &n, alpha, ap, &lda, xp, &incx, beta, yp, &incy );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
dsymv_blis_impl( &uploa, &n, alpha, ap, &lda, xp, &incx, beta, yp, &incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/symv.h: Invalid typename in symv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_symv( char storage, char uploa, gtint_t n, T* alpha,
|
||||
T* ap, gtint_t lda, T* xp, gtint_t incx, T* beta, T* yp, gtint_t incy )
|
||||
@@ -162,6 +174,11 @@ static void symv( char storage, char uploa, char conja, char conjx, gtint_t n,
|
||||
symv_<T>( uploa, n, alpha, ap, lda, xp, incx, beta, yp, incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/symv.h: BLAS interface cannot be tested for row-major order.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if( storage == 'c' || storage == 'C' )
|
||||
symv_blis_impl<T>( uploa, n, alpha, ap, lda, xp, incx, beta, yp, incy );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/symv.h: BLAS_BLIS_IMPL interface cannot be tested for row-major order.");
|
||||
#elif TEST_CBLAS
|
||||
cblas_symv<T>( storage, uploa, n, alpha, ap, lda, xp, incx, beta, yp, incy );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -90,7 +90,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dsyrGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -90,7 +90,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ssyrGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -64,6 +64,18 @@ static void syr_( char uploa, gtint_t n, T* alpha, T* xp, gtint_t incx,
|
||||
throw std::runtime_error("Error in testsuite/level2/syr.h: Invalid typename in syr_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void syr_blis_impl( char uploa, gtint_t n, T* alpha, T* xp, gtint_t incx,
|
||||
T* ap, gtint_t lda )
|
||||
{
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
ssyr_blis_impl( &uploa, &n, alpha, xp, &incx, ap, &lda );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
dsyr_blis_impl( &uploa, &n, alpha, xp, &incx, ap, &lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/syr.h: Invalid typename in syr_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_syr( char storage, char uploa, gtint_t n, T* alpha,
|
||||
T* xp, gtint_t incx, T* ap, gtint_t lda )
|
||||
@@ -146,6 +158,11 @@ static void syr( char storage, char uploa, char conj_x, gtint_t n, T* alpha,
|
||||
syr_<T>( uploa, n, alpha, xp, incx, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/syr.h: BLAS interface cannot be tested for row-major order.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if( storage == 'c' || storage == 'C' )
|
||||
syr_blis_impl<T>( uploa, n, alpha, xp, incx, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/syr.h: BLAS_BLIS_IMPL interface cannot be tested for row-major order.");
|
||||
#elif TEST_CBLAS
|
||||
cblas_syr<T>( storage, uploa, n, alpha, xp, incx, ap, lda );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -96,7 +96,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dsyr2Generic,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -96,7 +96,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ssyr2Generic,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -65,6 +65,18 @@ static void syr2_( char uploa, gtint_t n, T* alpha, T* xp, gtint_t incx,
|
||||
throw std::runtime_error("Error in testsuite/level2/syr2.h: Invalid typename in syr2_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void syr2_blis_impl( char uploa, gtint_t n, T* alpha, T* xp, gtint_t incx,
|
||||
T* yp, gtint_t incy, T* ap, gtint_t lda )
|
||||
{
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
ssyr2_blis_impl( &uploa, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
dsyr2_blis_impl( &uploa, &n, alpha, xp, &incx, yp, &incy, ap, &lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/syr2.h: Invalid typename in syr2_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_syr2( char storage, char uploa, gtint_t n, T* alpha,
|
||||
T* xp, gtint_t incx, T* yp, gtint_t incy, T* ap, gtint_t lda )
|
||||
@@ -159,6 +171,11 @@ static void syr2( char storage, char uploa, char conj_x, char conj_y, gtint_t n,
|
||||
syr2_<T>( uploa, n, alpha, xp, incx, yp, incy, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/syr2.h: BLAS interface cannot be tested for row-major order.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if( storage == 'c' || storage == 'C' )
|
||||
syr2_blis_impl<T>( uploa, n, alpha, xp, incx, yp, incy, ap, lda );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/syr2.h: BLAS_BLIS_IMPL interface cannot be tested for row-major order.");
|
||||
#elif TEST_CBLAS
|
||||
cblas_syr2<T>( storage, uploa, n, alpha, xp, incx, yp, incy, ap, lda );
|
||||
#elif TEST_BLIS_TYPED
|
||||
|
||||
@@ -97,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ctrmvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -98,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dtrmvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -98,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
strmvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -70,6 +70,22 @@ static void trmv_( char uploa, char transa, char diaga, gtint_t n,
|
||||
throw std::runtime_error("Error in testsuite/level2/trmv.h: Invalid typename in trmv_().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void trmv_blis_impl( char uploa, char transa, char diaga, gtint_t n,
|
||||
T *ap, gtint_t lda, T *xp, gtint_t incx )
|
||||
{
|
||||
if constexpr (std::is_same<T, float>::value)
|
||||
strmv_blis_impl( &uploa, &transa, &diaga, &n, ap, &lda, xp, &incx );
|
||||
else if constexpr (std::is_same<T, double>::value)
|
||||
dtrmv_blis_impl( &uploa, &transa, &diaga, &n, ap, &lda, xp, &incx );
|
||||
else if constexpr (std::is_same<T, scomplex>::value)
|
||||
ctrmv_blis_impl( &uploa, &transa, &diaga, &n, ap, &lda, xp, &incx );
|
||||
else if constexpr (std::is_same<T, dcomplex>::value)
|
||||
ztrmv_blis_impl( &uploa, &transa, &diaga, &n, ap, &lda, xp, &incx );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/trmv.h: Invalid typename in trmv_blis_impl().");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void cblas_trmv( char storage, char uploa, char transa, char diaga,
|
||||
gtint_t n, T *ap, gtint_t lda, T *xp, gtint_t incx )
|
||||
@@ -135,7 +151,7 @@ template<typename T>
|
||||
static void trmv( char storage, char uploa, char transa, char diaga,
|
||||
gtint_t n, T *alpha, T *ap, gtint_t lda, T *xp, gtint_t incx )
|
||||
{
|
||||
#if (defined TEST_BLAS || defined TEST_CBLAS)
|
||||
#if (defined TEST_BLAS_LIKE || defined TEST_CBLAS)
|
||||
T one;
|
||||
testinghelpers::initone(one);
|
||||
#endif
|
||||
@@ -176,6 +192,14 @@ static void trmv( char storage, char uploa, char transa, char diaga,
|
||||
throw std::runtime_error("Error in testsuite/level2/trmv.h: BLAS interface cannot be tested for alpha != one.");
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/trmv.h: BLAS interface cannot be tested for row-major order.");
|
||||
#elif TEST_BLAS_BLIS_IMPL
|
||||
if(( storage == 'c' || storage == 'C' ))
|
||||
if( *alpha == one )
|
||||
trmv_blis_impl<T>( uploa, transa, diaga, n, ap, lda, xp, incx );
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/trmv.h: BLAS_BLIS_IMPL interface cannot be tested for alpha != one.");
|
||||
else
|
||||
throw std::runtime_error("Error in testsuite/level2/trmv.h: BLAS_BLIS_IMPL interface cannot be tested for row-major order.");
|
||||
#elif TEST_CBLAS
|
||||
if( *alpha == one )
|
||||
cblas_trmv<T>( storage, uploa, transa, diaga, n, ap, lda, xp, incx );
|
||||
|
||||
@@ -89,7 +89,7 @@ TYPED_TEST(trmv_IIT_ERS, invalid_storage)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
|
||||
/*
|
||||
Incorrect Input Testing(IIT)
|
||||
|
||||
@@ -97,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ztrmvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
@@ -89,7 +89,7 @@ TYPED_TEST(trsv_IIT_ERS, invalid_storage)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(TEST_BLAS) || defined(TEST_CBLAS)
|
||||
#if defined(TEST_BLAS_LIKE) || defined(TEST_CBLAS)
|
||||
|
||||
/*
|
||||
Incorrect Input Testing(IIT)
|
||||
|
||||
@@ -98,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ctrsvGeneric,
|
||||
::testing::Combine(
|
||||
::testing::Values('c'
|
||||
#ifndef TEST_BLAS
|
||||
#ifndef TEST_BLAS_LIKE
|
||||
,'r'
|
||||
#endif
|
||||
), // storage format
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user