From a8282b25054bfbd138adde1c51f2c2b2ec79e1f5 Mon Sep 17 00:00:00 2001 From: Ouadie EL FAROUKI Date: Mon, 19 Feb 2024 10:19:43 +0000 Subject: [PATCH] updated readme, disabled complex support by default and removed extra haf guards --- CMakeLists.txt | 2 +- README.md | 5 +++-- common/include/common/float_comparison.hpp | 11 +---------- include/operations/blas_constants.h | 2 -- src/operations/blas1_trees.hpp | 2 -- 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7ad71a73..c69888bb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,7 +106,7 @@ if(IMGDNN_DIR) endif() option(BLAS_ENABLE_EXTENSIONS "Whether to enable portBLAS extensions" ON) -option(BLAS_ENABLE_COMPLEX "Whether to enable complex data type for supported operators" ON) +option(BLAS_ENABLE_COMPLEX "Whether to enable complex data type for GEMM" OFF) option(BLAS_ENABLE_HALF "Whether to enable sycl::half data type for supported operators" OFF) if(${TUNING_TARGET} STREQUAL "DEFAULT_CPU") diff --git a/README.md b/README.md index bba1a6bc0..5186b98d0 100644 --- a/README.md +++ b/README.md @@ -462,9 +462,10 @@ Some of the supported options are: | `BLAS_MEMPOOL_BENCHMARK` | `ON`/`OFF` | Determines whether to enable the scratchpad memory pool for benchmark execution. `OFF` by default | | `BLAS_ENABLE_CONST_INPUT` | `ON`/`OFF` | Determines whether to enable kernel instantiation with const input buffer (`ON` by default) | | `BLAS_ENABLE_EXTENSIONS` | `ON`/`OFF` | Determines whether to enable portBLAS extensions (`ON` by default) | -| `BLAS_DATA_TYPES` | `half;float;double` | Determines the floating-point types to instantiate BLAS operations for. Default is `float` | +| `BLAS_DATA_TYPES` | `float;double` | Determines the floating-point types to instantiate BLAS operations for. Default is `float` | | `BLAS_INDEX_TYPES` | `int32_t;int64_t` | Determines the type(s) to use for `index_t` and `increment_t`. Default is `int` | -| `BLAS_ENABLE_COMPLEX` | `ON`/`OFF` | Determines whether to enable Complex data type support *(GEMM Operators only)* (`ON` by default) | +| `BLAS_ENABLE_COMPLEX` | `ON`/`OFF` | Determines whether to enable Complex data type support *(GEMM Operators only)* (`OFF` by default) | +| `BLAS_ENABLE_HALF` | `ON`/`OFF` | Determines whether to enable Half data type support *(Support is limited to some Level 1 operators and Gemm)* (`OFF` by default) | ## ComputeCpp Compilation *(Deprecated)* diff --git a/common/include/common/float_comparison.hpp b/common/include/common/float_comparison.hpp index b6873af51..3cfc0885e 100644 --- a/common/include/common/float_comparison.hpp +++ b/common/include/common/float_comparison.hpp @@ -32,7 +32,6 @@ #include #endif -#ifdef BLAS_ENABLE_HALF #if SYCL_LANGUAGE_VERSION < 202000 #include inline std::ostream& operator<<(std::ostream& os, const cl::sycl::half& value) { @@ -49,7 +48,6 @@ class numeric_limits { }; } // namespace std #endif // SYCL_LANGUAGE_VERSION -#endif // BLAS_ENABLE_HALF namespace utils { @@ -85,7 +83,6 @@ scalar_t abs(std::complex value) noexcept { } #endif -#ifdef BLAS_ENABLE_HALF template <> inline bool isnan(cl::sycl::half value) noexcept { return std::isnan(static_cast(value)); @@ -101,8 +98,6 @@ inline cl::sycl::half abs(cl::sycl::half value) noexcept { return std::abs(static_cast(value)); } -#endif // BLAS_ENABLE_HALF - template scalar_t clamp_to_limits(scalar_t v) { constexpr auto min_value = std::numeric_limits::min(); @@ -139,14 +134,12 @@ inline double getRelativeErrorMargin() { return 0.0000000001; // 10^-10 } -#ifdef BLAS_ENABLE_HALF - template <> inline cl::sycl::half getRelativeErrorMargin() { // Measured empirically with gemm return 0.05f; } -#endif + /** * Indicates the tolerated margin for absolute differences (used in case the * scalars are close to 0) @@ -168,14 +161,12 @@ inline double getAbsoluteErrorMargin() { */ return 0.0000000001; // 10^-10 } -#ifdef BLAS_ENABLE_HALF template <> inline cl::sycl::half getAbsoluteErrorMargin() { // Measured empirically with gemm. return 1.0f; } -#endif /** * Compare two scalars and returns false if the difference is not acceptable. diff --git a/include/operations/blas_constants.h b/include/operations/blas_constants.h index 56e01b374..229cd6721 100644 --- a/include/operations/blas_constants.h +++ b/include/operations/blas_constants.h @@ -212,7 +212,6 @@ struct constant, Indicator> { }; #endif -#ifdef BLAS_ENABLE_HALF template <> struct constant : constant {}; @@ -252,7 +251,6 @@ struct constant template <> struct constant : constant {}; -#endif // BLAS_ENABLE_HALF template struct constant_pair { diff --git a/src/operations/blas1_trees.hpp b/src/operations/blas1_trees.hpp index 21b88b006..01b094ebc 100644 --- a/src/operations/blas1_trees.hpp +++ b/src/operations/blas1_trees.hpp @@ -80,7 +80,6 @@ struct DetectScalar { static element_t get_scalar(element_t &scalar) { return scalar; } }; -#ifdef BLAS_ENABLE_HALF /*! DetectScalar. * @brief See Detect Scalar. */ @@ -89,7 +88,6 @@ struct DetectScalar { using element_t = cl::sycl::half; static element_t get_scalar(element_t &scalar) { return scalar; } }; -#endif // BLAS_ENABLE_HALF #ifdef BLAS_ENABLE_COMPLEX /*! DetectScalar (for sycl::complex)