diff --git a/tests/common/common_vec.h b/tests/common/common_vec.h index d07752960..e5f8d48ab 100644 --- a/tests/common/common_vec.h +++ b/tests/common/common_vec.h @@ -57,8 +57,7 @@ bool check_vector_size(sycl::vec vector) { * @brief Helper function to check vector values are correct. */ template -bool check_vector_values(sycl::vec vector, - vecType* vals) { +bool check_vector_values(sycl::vec vector, vecType* vals) { for (int i = 0; i < numOfElems; i++) { if ((vals[i] != vector[i])) { return false; @@ -72,14 +71,12 @@ bool check_vector_values(sycl::vec vector, * for division result are accurate enough */ template -typename std::enable_if::value, bool>::type -check_vector_values_div(sycl::vec vector, - vecType *vals) { +typename std::enable_if_t, bool> +check_vector_values_div(sycl::vec vector, vecType* vals) { for (int i = 0; i < numOfElems; i++) { vecType vectorValue = vector[i]; - if (vals[i] == vectorValue) - continue; - const vecType ulpsExpected = 2.5; // Min Accuracy for x / y + if (vals[i] == vectorValue) continue; + const vecType ulpsExpected = 2.5; // Min Accuracy for x / y const vecType difference = sycl::fabs(vectorValue - vals[i]); // using sycl functions to get ulp because it used in kernel const vecType differenceExpected = ulpsExpected * get_ulp_sycl(vals[i]); @@ -95,9 +92,8 @@ check_vector_values_div(sycl::vec vector, * @brief Helper function to check that vector values for division are correct */ template -typename std::enable_if::value, bool>::type -check_vector_values_div(sycl::vec vector, - vecType *vals) { +typename std::enable_if_t, bool>::type +check_vector_values_div(sycl::vec vector, vecType* vals) { return check_vector_values(vector, vals); } @@ -123,7 +119,8 @@ bool check_single_vector_op(vectorType vector1, lambdaFunc lambda) { template static constexpr bool if_FP_to_non_FP_conv_v = - is_sycl_floating_point::value && !is_sycl_floating_point::value; + is_sycl_scalar_floating_point::value && + !is_sycl_scalar_floating_point::value; template sycl::vec convert_vec(sycl::vec inputVec) { @@ -196,7 +193,7 @@ sycl::vec rtn(sycl::vec inputVec) { // values instead. template void handleFPToUnsignedConv(sycl::vec& inputVec) { - if constexpr (is_sycl_floating_point::value && + if constexpr (is_sycl_scalar_floating_point::value && std::is_unsigned_v) { for (size_t i = 0; i < N; ++i) { vecType elem = inputVec[i]; @@ -247,7 +244,7 @@ bool check_vector_convert_result_impl(sycl::vec inputVec, sycl::vec expectedVec; switch (mode) { case sycl::rounding_mode::automatic: - if constexpr (is_sycl_floating_point::value) { + if constexpr (is_sycl_scalar_floating_point::value) { expectedVec = rte(inputVec); } else { expectedVec = rtz(inputVec); @@ -291,9 +288,8 @@ bool check_vector_convert_result(sycl::vec inputVec) { template bool check_vector_convert_modes(sycl::vec inputVec) { bool flag = true; - flag &= - check_vector_convert_result(inputVec); + flag &= check_vector_convert_result(inputVec); #if SYCL_CTS_ENABLE_FULL_CONFORMANCE flag &= check_vector_convert_result(inputVec); diff --git a/tests/group_functions/group_functions_common.h b/tests/group_functions/group_functions_common.h index 2448d22e3..039eb2fdd 100644 --- a/tests/group_functions/group_functions_common.h +++ b/tests/group_functions/group_functions_common.h @@ -259,7 +259,7 @@ template inline auto get_op_types() { #if SYCL_CTS_ENABLE_FULL_CONFORMANCE static const auto types = []() { - if constexpr (is_sycl_floating_point_v) { + if constexpr (is_sycl_scalar_floating_point_v) { // Bitwise operations are not defined for floating point types. return named_type_pack, sycl::multiplies, sycl::logical_and, sycl::logical_or, diff --git a/tests/marray_basic/marray_operators.h b/tests/marray_basic/marray_operators.h index dba9b5449..828ceafe3 100644 --- a/tests/marray_basic/marray_operators.h +++ b/tests/marray_basic/marray_operators.h @@ -54,9 +54,10 @@ struct operators_helper { // similar to native::divide we can skip checking them. template struct skip_result_check - : std::bool_constant< - (std::is_same_v || std::is_same_v) && - is_sycl_floating_point_v> {}; + : std::bool_constant<( + std::is_same_v || + std::is_same_v< + OpT, op_assign_div>)&&is_sycl_scalar_floating_point_v> {}; template constexpr bool skip_result_check_v = skip_result_check::value; @@ -67,10 +68,10 @@ bool are_equal_ignore_division(const T1& lhs, const T1& rhs) { // similar to native::divide we can skip checking them here. constexpr bool is_div = std::is_same_v || std::is_same_v; - constexpr bool is_sycl_floating_point = std::is_same_v || - std::is_same_v || - std::is_same_v; - if constexpr (is_div && is_sycl_floating_point) return true; + constexpr bool is_sycl_scalar_floating_point = + std::is_same_v || std::is_same_v || + std::is_same_v; + if constexpr (is_div && is_sycl_scalar_floating_point) return true; return value_operations::are_equal(lhs, rhs); } diff --git a/tests/math_builtin_api/math_builtin.h b/tests/math_builtin_api/math_builtin.h index fa950d91e..170f79190 100644 --- a/tests/math_builtin_api/math_builtin.h +++ b/tests/math_builtin_api/math_builtin.h @@ -100,9 +100,9 @@ bool verify(sycl_cts::util::logger& log, T a, T b, float accuracy, AccuracyMode accuracy_mode, const std::string& comment); template -std::enable_if_t, bool> -verify(sycl_cts::util::logger& log, T value, sycl_cts::resultRef r, - float accuracy, AccuracyMode accuracy_mode, const std::string& comment) { +std::enable_if_t, bool> verify( + sycl_cts::util::logger& log, T value, sycl_cts::resultRef r, + float accuracy, AccuracyMode accuracy_mode, const std::string& comment) { const T reference = r.res; if (!r.undefined.empty()) diff --git a/tests/reduction/identity_helper.h b/tests/reduction/identity_helper.h index 179dfd544..c3cfabbee 100644 --- a/tests/reduction/identity_helper.h +++ b/tests/reduction/identity_helper.h @@ -107,11 +107,11 @@ AccumulatorT get_identity() { } /** minimum (floating point) */ -template > && - is_sycl_floating_point_v, - bool> = true> +template < + typename AccumulatorT, typename OperatorT, + std::enable_if_t> && + is_sycl_scalar_floating_point_v, + bool> = true> AccumulatorT get_identity() { return std::numeric_limits::infinity(); } diff --git a/tests/reduction/reduction_without_identity_param_common.h b/tests/reduction/reduction_without_identity_param_common.h index 968ff6352..9e10e7972 100644 --- a/tests/reduction/reduction_without_identity_param_common.h +++ b/tests/reduction/reduction_without_identity_param_common.h @@ -301,7 +301,7 @@ template ::value && + if constexpr (is_sycl_scalar_floating_point::value && (std::is_same>::value || std::is_same>::value || std::is_same>::value)) { diff --git a/util/type_traits.h b/util/type_traits.h index 68b4e0293..cf9842fee 100644 --- a/util/type_traits.h +++ b/util/type_traits.h @@ -50,7 +50,7 @@ using has_atomic_support = contains -using is_sycl_floating_point = +using is_sycl_scalar_floating_point = #if SYCL_CTS_ENABLE_HALF_TESTS std::bool_constant || std::is_same_v, sycl::half>>; @@ -59,8 +59,8 @@ using is_sycl_floating_point = #endif template -inline constexpr bool is_sycl_floating_point_v{ - is_sycl_floating_point::value}; +inline constexpr bool is_sycl_scalar_floating_point_v{ + is_sycl_scalar_floating_point::value}; template using is_nonconst_rvalue_reference = @@ -410,10 +410,10 @@ using is_legal_operator = std::bool_constant< std::is_same_v, bool>) || (std::is_same_v> && std::is_integral_v) || (std::is_same_v> && - is_sycl_floating_point_v) || + is_sycl_scalar_floating_point_v) || (std::is_same_v> && std::is_integral_v) || (std::is_same_v> && - is_sycl_floating_point_v)>; + is_sycl_scalar_floating_point_v)>; /** Checks whether \p T and \p OperatorT form a valid SYCL operator. */