Skip to content

Commit

Permalink
updated readme, disabled complex support by default and removed extra…
Browse files Browse the repository at this point in the history
… haf guards
  • Loading branch information
OuadiElfarouki committed Feb 19, 2024
1 parent d29372e commit a8282b2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)*

Expand Down
11 changes: 1 addition & 10 deletions common/include/common/float_comparison.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <complex>
#endif

#ifdef BLAS_ENABLE_HALF
#if SYCL_LANGUAGE_VERSION < 202000
#include <CL/sycl.hpp>
inline std::ostream& operator<<(std::ostream& os, const cl::sycl::half& value) {
Expand All @@ -49,7 +48,6 @@ class numeric_limits<cl::sycl::half> {
};
} // namespace std
#endif // SYCL_LANGUAGE_VERSION
#endif // BLAS_ENABLE_HALF

namespace utils {

Expand Down Expand Up @@ -85,7 +83,6 @@ scalar_t abs(std::complex<scalar_t> value) noexcept {
}
#endif

#ifdef BLAS_ENABLE_HALF
template <>
inline bool isnan<cl::sycl::half>(cl::sycl::half value) noexcept {
return std::isnan(static_cast<float>(value));
Expand All @@ -101,8 +98,6 @@ inline cl::sycl::half abs<cl::sycl::half>(cl::sycl::half value) noexcept {
return std::abs(static_cast<float>(value));
}

#endif // BLAS_ENABLE_HALF

template <typename scalar_t>
scalar_t clamp_to_limits(scalar_t v) {
constexpr auto min_value = std::numeric_limits<scalar_t>::min();
Expand Down Expand Up @@ -139,14 +134,12 @@ inline double getRelativeErrorMargin<double>() {
return 0.0000000001; // 10^-10
}

#ifdef BLAS_ENABLE_HALF

template <>
inline cl::sycl::half getRelativeErrorMargin<cl::sycl::half>() {
// Measured empirically with gemm
return 0.05f;
}
#endif

/**
* Indicates the tolerated margin for absolute differences (used in case the
* scalars are close to 0)
Expand All @@ -168,14 +161,12 @@ inline double getAbsoluteErrorMargin<double>() {
*/
return 0.0000000001; // 10^-10
}
#ifdef BLAS_ENABLE_HALF

template <>
inline cl::sycl::half getAbsoluteErrorMargin<cl::sycl::half>() {
// Measured empirically with gemm.
return 1.0f;
}
#endif

/**
* Compare two scalars and returns false if the difference is not acceptable.
Expand Down
2 changes: 0 additions & 2 deletions include/operations/blas_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ struct constant<complex_sycl<value_t>, Indicator> {
};
#endif

#ifdef BLAS_ENABLE_HALF
template <>
struct constant<cl::sycl::half, const_val::zero>
: constant<float, const_val::zero> {};
Expand Down Expand Up @@ -252,7 +251,6 @@ struct constant<cl::sycl::half, const_val::abs_min>
template <>
struct constant<cl::sycl::half, const_val::collapse>
: constant<float, const_val::collapse> {};
#endif // BLAS_ENABLE_HALF

template <typename iv_type, const_val IndexIndicator, const_val ValueIndicator>
struct constant_pair {
Expand Down
2 changes: 0 additions & 2 deletions src/operations/blas1_trees.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ struct DetectScalar<double> {
static element_t get_scalar(element_t &scalar) { return scalar; }
};

#ifdef BLAS_ENABLE_HALF
/*! DetectScalar.
* @brief See Detect Scalar.
*/
Expand All @@ -89,7 +88,6 @@ struct DetectScalar<cl::sycl::half> {
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<value_t>)
Expand Down

0 comments on commit a8282b2

Please sign in to comment.