diff --git a/tests/common/common_vec.h b/tests/common/common_vec.h index b67870c36..d32ec20bc 100644 --- a/tests/common/common_vec.h +++ b/tests/common/common_vec.h @@ -44,6 +44,15 @@ namespace { +template +using rel_log_ret_t = std::conditional_t< + sizeof(T) == 1, std::int8_t, + std::conditional_t< + sizeof(T) == 2, std::int16_t, + std::conditional_t>>>; + /** * @brief Helper function to check the size of a vector is correct. */ diff --git a/tests/vector_operators/generate_vector_operators.py b/tests/vector_operators/generate_vector_operators.py index c6de167f1..f908323b9 100755 --- a/tests/vector_operators/generate_vector_operators.py +++ b/tests/vector_operators/generate_vector_operators.py @@ -431,6 +431,9 @@ """) specific_return_type_test_template = Template(""" +#if SYCL_CTS_COMPILING_WITH_SIMSYCL + FAIL_CHECK("SimSYCL has incorrect return types for logical/relational operators."); +#else /** Tests each logical and relational operator available to vector types */ auto testVec1 = sycl::vec<${type}, ${size}>(static_cast<${type}>(${test_value_1})); @@ -732,6 +735,7 @@ if (!check_vector_values(resVec, resArr)) { resAcc[0] = false; } +#endif """) non_fp_bitwise_test_template = Template(""" @@ -1355,7 +1359,7 @@ def generate_all_types_specific_return_type_test(type_str, size): type=type_str, size=str(size), swizzle=get_swizzle(size), - ret_type=Data.opencl_sized_return_type_dict[type_str], + ret_type=f'rel_log_ret_t<{type_str}>', test_value_1=1, test_value_2=2) return wrap_with_kernel( @@ -1419,6 +1423,15 @@ def generate_operator_tests(type_str, input_file, output_file): type_str, test_str, str(size)) func_calls += make_func_call(TEST_NAME + '_ALL_TYPES', type_str, str(size)) + + test_str = generate_all_types_specific_return_type_test( + type_str, size) + test_func_str += wrap_with_test_func( + TEST_NAME + '_SPECIFIC_RETURN_TYPES', type_str, test_str, + str(size)) + func_calls += make_func_call(TEST_NAME + '_SPECIFIC_RETURN_TYPES', + type_str, str(size)) + if not type_str in [ 'float', 'double', 'sycl::half' ]: