diff --git a/tests/atomic_ref/atomic_ref_T_op_test_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_T_op_test_pointers_fp64.cpp new file mode 100644 index 000000000..1af1bddfc --- /dev/null +++ b/tests/atomic_ref/atomic_ref_T_op_test_pointers_fp64.cpp @@ -0,0 +1,55 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref::operator T() test for double * +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_T_op_test.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::api::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref::operator T() test. double *", "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto type_pack = + atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types(type_pack); +}); + +} // namespace atomic_ref::tests::api::core diff --git a/tests/atomic_ref/atomic_ref_add_sub_op_all_types_test_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_add_sub_op_all_types_test_pointers_fp64.cpp new file mode 100644 index 000000000..58e7d3481 --- /dev/null +++ b/tests/atomic_ref/atomic_ref_add_sub_op_all_types_test_pointers_fp64.cpp @@ -0,0 +1,56 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref operator+=()/operator-=() tests for double * +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_add_sub_op_all_types_test.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::api::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref operator+=()/operator-=() test. double *", "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto type_pack = + atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types( + type_pack); +}); + +} // namespace atomic_ref::tests::api::core diff --git a/tests/atomic_ref/atomic_ref_assign_op_test_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_assign_op_test_pointers_fp64.cpp new file mode 100644 index 000000000..f8f143a97 --- /dev/null +++ b/tests/atomic_ref/atomic_ref_assign_op_test_pointers_fp64.cpp @@ -0,0 +1,55 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref::operator=() tests for double * +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_assign_op_test.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::api::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref::operator=() test. double *", "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto type_pack = + atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types(type_pack); +}); + +} // namespace atomic_ref::tests::api::core diff --git a/tests/atomic_ref/atomic_ref_common.h b/tests/atomic_ref/atomic_ref_common.h index 0d2162f84..fd296e88e 100644 --- a/tests/atomic_ref/atomic_ref_common.h +++ b/tests/atomic_ref/atomic_ref_common.h @@ -166,11 +166,10 @@ inline auto get_conformance_type_pack() { inline auto get_full_conformance_pointers_type_pack() { static const auto types = named_type_pack::generate("int *", "unsigned int *", - "long int *", "unsigned long int *", - "long long *", "unsigned long long *", - "float *", "double *"); + long long*, unsigned long long*, + float*>::generate("int *", "unsigned int *", "long int *", + "unsigned long int *", "long long *", + "unsigned long long *", "float *"); return types; } @@ -183,6 +182,14 @@ inline auto get_lightweight_pointers_type_pack() { return types; } +/** + * @brief Factory function for getting type_pack with generic pointers types + */ +inline auto get_fp64_pointers_type_pack() { + static const auto types = named_type_pack::generate("double *"); + return types; +} + /** * @brief Factory function for getting type_pack with pointers types that * depends on full conformance mode enabling status diff --git a/tests/atomic_ref/atomic_ref_compare_exchange_test_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_compare_exchange_test_pointers_fp64.cpp new file mode 100644 index 000000000..f8d227931 --- /dev/null +++ b/tests/atomic_ref/atomic_ref_compare_exchange_test_pointers_fp64.cpp @@ -0,0 +1,58 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref compare_exchange_strong()/compare_exchange_weak() +// tests for double * +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_compare_exchange_test.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::api::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref compare_exchange_strong()/compare_exchange_weak() test. " + "double *", + "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto type_pack = + atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types(type_pack); +}); + +} // namespace atomic_ref::tests::api::core diff --git a/tests/atomic_ref/atomic_ref_constructors_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_constructors_pointers_fp64.cpp new file mode 100644 index 000000000..12e707d9f --- /dev/null +++ b/tests/atomic_ref/atomic_ref_constructors_pointers_fp64.cpp @@ -0,0 +1,54 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref constructors test for double *. +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_constructors.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::constructors::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref constructors. double *", "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto types = atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types(types); +}); + +} // namespace atomic_ref::tests::constructors::core diff --git a/tests/atomic_ref/atomic_ref_exchange_test_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_exchange_test_pointers_fp64.cpp new file mode 100644 index 000000000..b87a0b5a8 --- /dev/null +++ b/tests/atomic_ref/atomic_ref_exchange_test_pointers_fp64.cpp @@ -0,0 +1,55 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref::exchange() tests for double * +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_exchange_test.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::api::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref::exchange() test. double *", "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto type_pack = + atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types(type_pack); +}); + +} // namespace atomic_ref::tests::api::core diff --git a/tests/atomic_ref/atomic_ref_fetch_add_sub_all_types_test_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_fetch_add_sub_all_types_test_pointers_fp64.cpp new file mode 100644 index 000000000..fcf14ba7c --- /dev/null +++ b/tests/atomic_ref/atomic_ref_fetch_add_sub_all_types_test_pointers_fp64.cpp @@ -0,0 +1,56 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref fetch_add()/fetch_sub() tests for double * +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_fetch_add_sub_all_types_test.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::api::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref fetch_add()/fetch_sub() test. double *", "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto type_pack = + atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types( + type_pack); +}); + +} // namespace atomic_ref::tests::api::core diff --git a/tests/atomic_ref/atomic_ref_incr_decr_op_test_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_incr_decr_op_test_pointers_fp64.cpp new file mode 100644 index 000000000..f7a6039b2 --- /dev/null +++ b/tests/atomic_ref/atomic_ref_incr_decr_op_test_pointers_fp64.cpp @@ -0,0 +1,58 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref +// operator++(int)/operator++()/operator--(int)/operator--() tests +// for double * +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_incr_decr_op_test.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::api::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref increment/decrement operators test. double *", + "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto type_pack = + atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types(type_pack); +}); + +} // namespace atomic_ref::tests::api::core diff --git a/tests/atomic_ref/atomic_ref_is_lock_free_test_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_is_lock_free_test_pointers_fp64.cpp new file mode 100644 index 000000000..8012bfd19 --- /dev/null +++ b/tests/atomic_ref/atomic_ref_is_lock_free_test_pointers_fp64.cpp @@ -0,0 +1,55 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref::is_lock_free() test for double * +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_is_lock_free_test.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::api::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref::is_lock_free() test. double *", "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto type_pack = + atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types(type_pack); +}); + +} // namespace atomic_ref::tests::api::core diff --git a/tests/atomic_ref/atomic_ref_store_test_pointers_fp64.cpp b/tests/atomic_ref/atomic_ref_store_test_pointers_fp64.cpp new file mode 100644 index 000000000..c15bc5e83 --- /dev/null +++ b/tests/atomic_ref/atomic_ref_store_test_pointers_fp64.cpp @@ -0,0 +1,55 @@ +/******************************************************************************* +// +// SYCL 2020 Conformance Test Suite +// +// Copyright (c) 2024 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Provides sycl::atomic_ref::store() test for double * +// +*******************************************************************************/ +#include "../common/disabled_for_test_case.h" +#include "catch2/catch_test_macros.hpp" + +#if !SYCL_CTS_COMPILING_WITH_HIPSYCL + +#include "atomic_ref_store_test.h" + +#endif // !SYCL_CTS_COMPILING_WITH_HIPSYCL + +namespace atomic_ref::tests::api::core { + +// FIXME: re-enable for hipsycl +// when sycl::info::device::atomic_memory_order_capabilities and +// sycl::info::device::atomic_memory_scope_capabilities are implemented in +// hipsycl +DISABLED_FOR_TEST_CASE(hipSYCL) +("sycl::atomic_ref::store() test. double *", "[atomic_ref]")({ + auto queue = sycl_cts::util::get_cts_object::queue(); + if (!queue.get_device().has(sycl::aspect::fp64)) { + SKIP( + "Device does not support double precision floating point " + "operations."); + } + const auto type_pack = + atomic_ref::tests::common::get_fp64_pointers_type_pack(); + if (is_64_bits_pointer() && device_has_not_aspect_atomic64()) { + SKIP( + "Device does not support atomic64 operations. " + "Skipping the test case."); + } + for_all_types(type_pack); +}); + +} // namespace atomic_ref::tests::api::core diff --git a/tests/buffer/buffer_deduction_guides.cpp b/tests/buffer/buffer_deduction_guides.cpp index 7b1a5e4a9..84eea53ae 100644 --- a/tests/buffer/buffer_deduction_guides.cpp +++ b/tests/buffer/buffer_deduction_guides.cpp @@ -41,9 +41,9 @@ class check_buffer_deduction { void operator()(const std::string& type) { // create container // using this API because of no_cnstr and no_def_cnstr types - std::array arr = {user_def_types::get_init_value_helper(0), - user_def_types::get_init_value_helper(0), - user_def_types::get_init_value_helper(0)}; + std::array arr = {user_def_types::get_init_value(0), + user_def_types::get_init_value(0), + user_def_types::get_init_value(0)}; type_name = type; test_inputiterator(arr); @@ -123,9 +123,9 @@ class check_buffer_deduction { const int arr_size = r.size(); std::unique_ptr data( - new T[size]{user_def_types::get_init_value_helper(0), - user_def_types::get_init_value_helper(0), - user_def_types::get_init_value_helper(0)}); + new T[size]{user_def_types::get_init_value(0), + user_def_types::get_init_value(0), + user_def_types::get_init_value(0)}); INFO("buffer_ctors_deduction::test_type() " + type_name); // buffer with no alloccator and no property list diff --git a/tests/common/type_list.h b/tests/common/type_list.h index 64ad0f270..5c6dc344f 100644 --- a/tests/common/type_list.h +++ b/tests/common/type_list.h @@ -162,29 +162,50 @@ struct arrow_operator_overloaded { } }; +// Helper structure to extract element type of vec/marray +// Fallback for scalars, which returns unmodified T +template +struct vec_marray_element_type { + using type = T; +}; + +// vec and marray specializations +template +struct vec_marray_element_type> { + using type = T; +}; + +#ifndef SYCL_CTS_COMPILING_WITH_HIPSYCL +template +struct vec_marray_element_type> { + using type = T; +}; +#endif + // Returns instance of type T template -inline constexpr auto get_init_value_helper(int x) { - return x; +inline constexpr auto get_init_value(int x) { + // Explicit cast is required to silence a warning about narrowing conversion + // in case when T is smaller than int. + return T{static_cast::type>(x)}; } -// Returns instance of type bool +// Special case for bool template <> -inline constexpr auto get_init_value_helper(int x) { - return (x % 2 != 0); +inline constexpr auto get_init_value(int x) { + return x % 2 != 0; } -// Returns instance of user defined struct with no constructor +// Specializations for user-defined types template <> -inline constexpr auto get_init_value_helper(int x) { +inline constexpr auto get_init_value(int x) { no_cnstr instance{}; instance = x; return instance; } -// Returns instance of user defined struct default constructor template <> -inline constexpr auto get_init_value_helper(int x) { +inline constexpr auto get_init_value(int x) { def_cnstr instance; instance = x; return instance; diff --git a/tests/math_builtin_api/modules/sycl_functions.py b/tests/math_builtin_api/modules/sycl_functions.py index cc6661aa5..181a57582 100644 --- a/tests/math_builtin_api/modules/sycl_functions.py +++ b/tests/math_builtin_api/modules/sycl_functions.py @@ -950,31 +950,31 @@ def create_float_signatures(): sig_list.append(f_modf_3) - f_nan_1 = funsig("sycl", "float", "nan", ["unsigned"]) + f_nan_1 = funsig("sycl", "float", "nan", ["uint32_t"]) sig_list.append(f_nan_1) f_nan_2 = funsig("sycl", "vgenfloatf", "nan", ["ugenint"], "0", "", [], [["vgenfloatf", "ugenint", "base_type"]], template_arg_map=[0]) sig_list.append(f_nan_2) - f_nan_3 = funsig("sycl", "mgenfloatf", "nan", ["ugenint"], "0", "", [], [["mgenfloatf", "ugenint", "base_type"]], template_arg_map=[0]) + f_nan_3 = funsig("sycl", "mgenfloatf", "nan", ["muint32n"], "0", "", [], [["mgenfloatf", "muint32n", "base_type"]], template_arg_map=[0]) sig_list.append(f_nan_3) - f_nan_4 = funsig("sycl", "double", "nan", ["unsigned long"], "0") + f_nan_4 = funsig("sycl", "double", "nan", ["uint64_t"], "0") sig_list.append(f_nan_4) f_nan_5 = funsig("sycl", "vgenfloatd", "nan", ["ugenlonginteger"], "0", "", [], [["vgenfloatd", "ugenlonginteger", "base_type"]], template_arg_map=[0]) sig_list.append(f_nan_5) - f_nan_6 = funsig("sycl", "mgenfloatd", "nan", ["ugenlonginteger"], "0", "", [], [["mgenfloatd", "ugenlonginteger", "base_type"]], template_arg_map=[0]) + f_nan_6 = funsig("sycl", "mgenfloatd", "nan", ["muint64n"], "0", "", [], [["mgenfloatd", "muint64n", "base_type"]], template_arg_map=[0]) sig_list.append(f_nan_6) - f_nan_7 = funsig("sycl", "sycl::half", "nan", ["unsigned short"], "0") + f_nan_7 = funsig("sycl", "sycl::half", "nan", ["uint16_t"], "0") sig_list.append(f_nan_7) f_nan_8 = funsig("sycl", "vgenfloath", "nan", ["ugenshort"], "0", "", [], [["vgenfloath", "ugenshort", "base_type"]], template_arg_map=[0]) sig_list.append(f_nan_8) - f_nan_9 = funsig("sycl", "mgenfloath", "nan", ["ugenshort"], "0", "", [], [["mgenfloath", "ugenshort", "base_type"]], template_arg_map=[0]) + f_nan_9 = funsig("sycl", "mgenfloath", "nan", ["muint16n"], "0", "", [], [["mgenfloath", "muint16n", "base_type"]], template_arg_map=[0]) sig_list.append(f_nan_9) diff --git a/tests/math_builtin_api/modules/sycl_types.py b/tests/math_builtin_api/modules/sycl_types.py index 61adce53b..e192561f0 100644 --- a/tests/math_builtin_api/modules/sycl_types.py +++ b/tests/math_builtin_api/modules/sycl_types.py @@ -1250,6 +1250,9 @@ def create_types(): t_mushort_n = argtype("mushortn", "NULL", "NULL", 0, ["sycl::marray","sycl::marray","sycl::marray","sycl::marray","sycl::marray"]) type_dic["mushortn"] = t_mushort_n + t_muint16_n = argtype("muint16n", "NULL", "NULL", 0, ["sycl::marray","sycl::marray","sycl::marray","sycl::marray","sycl::marray"]) + type_dic["muint16n"] = t_muint16_n + t_ushort_n = argtype("ushortn", "NULL", "NULL", 0, ["vuint16n","mushortn"]) type_dic["ushortn"] = t_ushort_n @@ -1278,6 +1281,9 @@ def create_types(): t_muint_n = argtype("muintn", "NULL", "NULL", 0, ["sycl::marray","sycl::marray","sycl::marray","sycl::marray","sycl::marray"]) type_dic["muintn"] = t_muint_n + t_muint32_n = argtype("muint32n", "NULL", "NULL", 0, ["sycl::marray","sycl::marray","sycl::marray","sycl::marray","sycl::marray"]) + type_dic["muint32n"] = t_muint32_n + t_uint_n = argtype("uintn", "NULL", "NULL", 0, ["vuint32n","muintn"]) type_dic["uintn"] = t_uint_n @@ -1306,6 +1312,9 @@ def create_types(): t_mulong_n = argtype("mulongn", "NULL", "NULL", 0, ["sycl::marray","sycl::marray","sycl::marray","sycl::marray","sycl::marray"]) type_dic["mulongn"] = t_mulong_n + t_muint64_n = argtype("muint64n", "NULL", "NULL", 0, ["sycl::marray","sycl::marray","sycl::marray","sycl::marray","sycl::marray"]) + type_dic["muint64n"] = t_muint64_n + t_ulong_n = argtype("ulongn", "NULL", "NULL", 0, ["vuint64n","mulongn"]) type_dic["ulongn"] = t_ulong_n diff --git a/tests/multi_ptr/multi_ptr_access_members.h b/tests/multi_ptr/multi_ptr_access_members.h index 83f3e15fc..014eb047a 100644 --- a/tests/multi_ptr/multi_ptr_access_members.h +++ b/tests/multi_ptr/multi_ptr_access_members.h @@ -51,14 +51,10 @@ struct test_result { int value_to_init = 49; // Variables that will be used to check that access members returns correct // value - T dereference_ret_value = - user_def_types::get_init_value_helper(value_to_init); - T dereference_op_ret_value = - user_def_types::get_init_value_helper(value_to_init); - T get_member_ret_value = - user_def_types::get_init_value_helper(value_to_init); - T get_raw_member_ret_value = - user_def_types::get_init_value_helper(value_to_init); + T dereference_ret_value = user_def_types::get_init_value(value_to_init); + T dereference_op_ret_value = user_def_types::get_init_value(value_to_init); + T get_member_ret_value = user_def_types::get_init_value(value_to_init); + T get_raw_member_ret_value = user_def_types::get_init_value(value_to_init); }; } // namespace detail @@ -92,7 +88,7 @@ class run_access_members_tests { const std::string &is_decorated_name) { auto queue = once_per_unit::get_queue(); constexpr int val_to_init = 42; - T value = user_def_types::get_init_value_helper(val_to_init); + T value = user_def_types::get_init_value(val_to_init); // Variable that contains all variables that will be used to verify test // result @@ -170,7 +166,7 @@ class run_access_members_tests { } }); } - T expected_value = user_def_types::get_init_value_helper(val_to_init); + T expected_value = user_def_types::get_init_value(val_to_init); // Dereference and multi_ptr::operator->() available only when: // !std::is_void::value if constexpr (!std::is_void_v) { diff --git a/tests/multi_ptr/multi_ptr_accessor_constructor.h b/tests/multi_ptr/multi_ptr_accessor_constructor.h index 606211151..90092fb50 100644 --- a/tests/multi_ptr/multi_ptr_accessor_constructor.h +++ b/tests/multi_ptr/multi_ptr_accessor_constructor.h @@ -63,8 +63,7 @@ void run_tests(sycl_cts::util::logger& log, const std::string& type_name) { bool same_value = false; // default value - T init_value = - user_def_types::get_init_value_helper>(10); + T init_value = user_def_types::get_init_value>(10); auto queue = once_per_unit::get_queue(); diff --git a/tests/multi_ptr/multi_ptr_common_assignment_ops.h b/tests/multi_ptr/multi_ptr_common_assignment_ops.h index 42228569b..b7ea13b83 100644 --- a/tests/multi_ptr/multi_ptr_common_assignment_ops.h +++ b/tests/multi_ptr/multi_ptr_common_assignment_ops.h @@ -60,7 +60,7 @@ class run_common_assign_tests { const std::string &address_space_name, const std::string &is_decorated_name) { auto queue = once_per_unit::get_queue(); - T value = user_def_types::get_init_value_helper(expected_val); + T value = user_def_types::get_init_value(expected_val); sycl::range r(1); std::array res; res.fill(false); @@ -96,7 +96,7 @@ class run_common_assign_tests { check(const_mptr_in, mptr_in, ref, res_acc); } else { T private_val = - user_def_types::get_init_value_helper(expected_val); + user_def_types::get_init_value(expected_val); multi_ptr_t mptr_in = sycl::address_space_cast( diff --git a/tests/multi_ptr/multi_ptr_common_constructors.h b/tests/multi_ptr/multi_ptr_common_constructors.h index 9b41f9778..861eeddd3 100644 --- a/tests/multi_ptr/multi_ptr_common_constructors.h +++ b/tests/multi_ptr/multi_ptr_common_constructors.h @@ -79,7 +79,7 @@ void run_tests(sycl_cts::util::logger &log, const std::string &type_name) { // Arrays for result values bool same_type[types_size]{}; bool same_value[values_size]{}; - T ref_value{user_def_types::get_init_value_helper(0)}; + T ref_value{user_def_types::get_init_value(0)}; auto queue = once_per_unit::get_queue(); using GlobalAccType = sycl::accessor; diff --git a/tests/multi_ptr/multi_ptr_comparison_op.h b/tests/multi_ptr/multi_ptr_comparison_op.h index 9902f25ed..6994d9d9b 100644 --- a/tests/multi_ptr/multi_ptr_comparison_op.h +++ b/tests/multi_ptr/multi_ptr_comparison_op.h @@ -142,8 +142,8 @@ class run_multi_ptr_comparison_op_test { using multi_ptr_t = sycl::multi_ptr; - const T m_small_value = user_def_types::get_init_value_helper(1); - const T m_great_value = user_def_types::get_init_value_helper(2); + const T m_small_value = user_def_types::get_init_value(1); + const T m_great_value = user_def_types::get_init_value(2); // Use an array to be sure that we have two elements that has consecutive // memory addresses const T m_values_arr[2] = {m_small_value, m_great_value}; diff --git a/tests/multi_ptr/multi_ptr_convert_assignment_ops.h b/tests/multi_ptr/multi_ptr_convert_assignment_ops.h index d1acf7d9f..46766c130 100644 --- a/tests/multi_ptr/multi_ptr_convert_assignment_ops.h +++ b/tests/multi_ptr/multi_ptr_convert_assignment_ops.h @@ -59,7 +59,7 @@ class run_convert_assignment_operators_tests { const std::string &src_is_decorated_name, const std::string &dst_is_decorated_name) { auto queue = once_per_unit::get_queue(); - T value = user_def_types::get_init_value_helper(expected_val); + T value = user_def_types::get_init_value(expected_val); auto r = sycl::range(1); SECTION( sycl_cts::section_name( @@ -113,7 +113,7 @@ class run_convert_assignment_operators_tests { res_acc[0] = *(mptr_out.get_raw()) == ref; } else { T private_val = - user_def_types::get_init_value_helper(expected_val); + user_def_types::get_init_value(expected_val); const src_multi_ptr_t mptr_in( sycl::address_space_cast< @@ -184,7 +184,7 @@ class run_convert_assignment_operators_tests { res_acc[0] = *(mptr_out.get_raw()) == ref; } else { T private_val = - user_def_types::get_init_value_helper(expected_val); + user_def_types::get_init_value(expected_val); const src_multi_ptr_t mptr_in( sycl::address_space_cast< diff --git a/tests/multi_ptr/multi_ptr_deduction_guides.cpp b/tests/multi_ptr/multi_ptr_deduction_guides.cpp index 77bb17d35..9565e85c0 100644 --- a/tests/multi_ptr/multi_ptr_deduction_guides.cpp +++ b/tests/multi_ptr/multi_ptr_deduction_guides.cpp @@ -70,7 +70,7 @@ class check_multi_ptr_deduction { accessor, local_accessor>; bool res = false; - T data{user_def_types::get_init_value_helper(0)}; + T data{user_def_types::get_init_value(0)}; auto r = sycl_cts::util::get_cts_object::range::get(1, 1, 1); { sycl::buffer buf_res(&res, {1}); diff --git a/tests/multi_ptr/multi_ptr_explicit_conversions.h b/tests/multi_ptr/multi_ptr_explicit_conversions.h index 33d663129..a2853bd48 100644 --- a/tests/multi_ptr/multi_ptr_explicit_conversions.h +++ b/tests/multi_ptr/multi_ptr_explicit_conversions.h @@ -66,7 +66,7 @@ class run_explicit_convert_tests { template void run_test(sycl::queue &queue, sycl::range<1> &r) { bool res = false; - T value = user_def_types::get_init_value_helper(expected_val); + T value = user_def_types::get_init_value(expected_val); { sycl::buffer res_buf(&res, sycl::range<1>(1)); sycl::buffer val_buffer(&value, sycl::range<1>(1)); @@ -103,7 +103,7 @@ class run_explicit_convert_tests { res_acc[0] = (*(mptr_out.get()) == ref); } else { T private_val = - user_def_types::get_init_value_helper(expected_val); + user_def_types::get_init_value(expected_val); input_multi_ptr_t mptr_in = sycl::address_space_cast< sycl::access::address_space::generic_space, decorated, T>( diff --git a/tests/multi_ptr/multi_ptr_implicit_conversions.h b/tests/multi_ptr/multi_ptr_implicit_conversions.h index 0839abbda..0a92b5158 100644 --- a/tests/multi_ptr/multi_ptr_implicit_conversions.h +++ b/tests/multi_ptr/multi_ptr_implicit_conversions.h @@ -76,7 +76,7 @@ class run_implicit_convert_tests { template void preform_implicit_conversion_test() { auto queue = once_per_unit::get_queue(); - T value = user_def_types::get_init_value_helper(expected_val); + T value = user_def_types::get_init_value(expected_val); bool res = false; constexpr sycl::access::decorated src_multi_ptr_decorated = @@ -127,8 +127,8 @@ class run_implicit_convert_tests { // for cases, when dest_multi_ptr_t equals to multi_ptr const T value_dest = *(reinterpret_cast(mptr_dest.get())); - res_acc[0] = (value_dest == - user_def_types::get_init_value_helper(expected_val)); + res_acc[0] = + (value_dest == user_def_types::get_init_value(expected_val)); }; using kname = diff --git a/tests/multi_ptr/multi_ptr_prefetch_member.h b/tests/multi_ptr/multi_ptr_prefetch_member.h index 820ff34ea..17f9a081d 100644 --- a/tests/multi_ptr/multi_ptr_prefetch_member.h +++ b/tests/multi_ptr/multi_ptr_prefetch_member.h @@ -60,7 +60,7 @@ class run_prefetch_test { "Data type shouldn't be is same to void type"); auto queue = once_per_unit::get_queue(); - T value = user_def_types::get_init_value_helper(expected_val); + T value = user_def_types::get_init_value(expected_val); SECTION(sycl_cts::section_name("Check multi_ptr::prefetch()") .with("T", type_name) .with("address_space", "access::address_space::global_space") diff --git a/tests/queue/queue_shortcuts_usm.h b/tests/queue/queue_shortcuts_usm.h index 67351aaaf..1291f569d 100644 --- a/tests/queue/queue_shortcuts_usm.h +++ b/tests/queue/queue_shortcuts_usm.h @@ -258,11 +258,11 @@ void test_unified_shared_memory(sycl::queue q, unsigned int element_count) { T* ptr = sycl::malloc_device(element_count, q); constexpr int advice = 0; sycl::event advise_no_events = - q.mem_advise(ptr, element_count * sizeof(int), advice); - sycl::event advise_single_event = q.mem_advise( - ptr, element_count * sizeof(int), advice, advise_no_events); + q.mem_advise(ptr, element_count * sizeof(T), advice); + sycl::event advise_single_event = + q.mem_advise(ptr, element_count * sizeof(T), advice, advise_no_events); sycl::event advise_multiple_events = - q.mem_advise(ptr, element_count * sizeof(int), advice, + q.mem_advise(ptr, element_count * sizeof(T), advice, {advise_no_events, advise_single_event}); advise_multiple_events.wait(); advise_no_events.wait(); diff --git a/tests/spec_constants/spec_constants_common.h b/tests/spec_constants/spec_constants_common.h index ab4d8a1d3..9b53817e3 100644 --- a/tests/spec_constants/spec_constants_common.h +++ b/tests/spec_constants/spec_constants_common.h @@ -48,11 +48,11 @@ constexpr int default_val = 20; template constexpr sycl::specialization_id spec_const( - user_def_types::get_init_value_helper(default_val)); + user_def_types::get_init_value(default_val)); template void fill_init_values(T &result, int val) { - result = user_def_types::get_init_value_helper(val); + result = user_def_types::get_init_value(val); } template diff --git a/tests/spec_constants/spec_constants_defined_various_ways.h b/tests/spec_constants/spec_constants_defined_various_ways.h index 0f52b6f43..50a314b08 100644 --- a/tests/spec_constants/spec_constants_defined_various_ways.h +++ b/tests/spec_constants/spec_constants_defined_various_ways.h @@ -35,8 +35,8 @@ void perform_test(util::logger &log, const std::string &type_name, } } sycl::range<1> range(1); - T result { user_def_types::get_init_value_helper(0) }; - T ref { user_def_types::get_init_value_helper(0) }; + T result{user_def_types::get_init_value(0)}; + T ref{user_def_types::get_init_value(0)}; { fill_init_values(ref, case_num); sycl::buffer result_buffer(&result, range); diff --git a/tests/spec_constants/spec_constants_defined_various_ways_helper.h b/tests/spec_constants/spec_constants_defined_various_ways_helper.h index 7482205ce..16158a577 100644 --- a/tests/spec_constants/spec_constants_defined_various_ways_helper.h +++ b/tests/spec_constants/spec_constants_defined_various_ways_helper.h @@ -56,14 +56,14 @@ static std::string get_hint(sc_vw_id test_id) { // Defined in a non-global named namespace template constexpr sycl::specialization_id sc_nonglob( - user_def_types::get_init_value_helper(case_num)); + user_def_types::get_init_value(case_num)); // A static member variable of a struct in a non-global namespace struct struct_nonglob { constexpr struct_nonglob() {} template static constexpr sycl::specialization_id sc{ - user_def_types::get_init_value_helper(case_num)}; + user_def_types::get_init_value(case_num)}; }; } // namespace spec_const_help @@ -71,33 +71,33 @@ namespace { // Defined in an unnamed namespace template constexpr sycl::specialization_id sc_unnamed( - user_def_types::get_init_value_helper(case_num)); + user_def_types::get_init_value(case_num)); // A static member variable of a struct in an unnamed namespace struct struct_unnamed { constexpr struct_unnamed() {} template static constexpr sycl::specialization_id sc{ - user_def_types::get_init_value_helper(case_num)}; + user_def_types::get_init_value(case_num)}; }; } // unnamed namespace // Defined in the global namespace as inline constexpr template inline constexpr sycl::specialization_id sc_glob_inl( - user_def_types::get_init_value_helper(case_num)); + user_def_types::get_init_value(case_num)); // Defined in the global namespace as static constexpr template static constexpr sycl::specialization_id sc_glob_static( - user_def_types::get_init_value_helper(case_num)); + user_def_types::get_init_value(case_num)); // A static member variable of a struct in the global namespace struct struct_glob { constexpr struct_glob() {} template static constexpr sycl::specialization_id sc{ - user_def_types::get_init_value_helper(case_num)}; + user_def_types::get_init_value(case_num)}; }; // A static member variable declared inline constexpr of a struct in the global @@ -106,7 +106,7 @@ struct struct_glob_inl { constexpr struct_glob_inl() {} template static inline constexpr sycl::specialization_id sc{ - user_def_types::get_init_value_helper(case_num)}; + user_def_types::get_init_value(case_num)}; }; // A static member variable of a templated struct in the global namespace @@ -115,7 +115,7 @@ struct struct_glob_tmpl { constexpr struct_glob_tmpl() {} template static constexpr sycl::specialization_id sc{ - user_def_types::get_init_value_helper(case_num)}; + user_def_types::get_init_value(case_num)}; }; #endif // __SYCLCTS_TESTS_SPEC_CONST_DEFINED_VARIOUS_WAYS_HELPER_H diff --git a/tests/spec_constants/spec_constants_exceptions_throwing_common.h b/tests/spec_constants/spec_constants_exceptions_throwing_common.h index 63f13cbfa..8e92954f1 100644 --- a/tests/spec_constants/spec_constants_exceptions_throwing_common.h +++ b/tests/spec_constants/spec_constants_exceptions_throwing_common.h @@ -51,7 +51,7 @@ class check_spec_constant_exception_throw_for_type { // kernel_bundle { bool exception_was_thrown = false; - T res{user_def_types::get_init_value_helper(0)}; + T res{user_def_types::get_init_value(0)}; const int case_num = 1; auto queue = sycl_cts::util::get_cts_object::queue(); @@ -85,7 +85,7 @@ class check_spec_constant_exception_throw_for_type { // kernel_bundle { bool exception_was_thrown = false; - T sc_val{user_def_types::get_init_value_helper(0)}; + T sc_val{user_def_types::get_init_value(0)}; const int case_num = 2; auto queue = sycl_cts::util::get_cts_object::queue(); diff --git a/tests/spec_constants/spec_constants_external.h b/tests/spec_constants/spec_constants_external.h index 472af54e7..129e7f380 100644 --- a/tests/spec_constants/spec_constants_external.h +++ b/tests/spec_constants/spec_constants_external.h @@ -17,7 +17,7 @@ using namespace get_spec_const; template inline constexpr sycl::specialization_id spec_const_external( - user_def_types::get_init_value_helper(default_val)); + user_def_types::get_init_value(default_val)); #define FUNC_DECLARE(TYPE) \ SYCL_EXTERNAL bool check_kernel_handler_by_reference_external_handler( \ @@ -74,7 +74,7 @@ class check_specialization_constants_external { // handler bool passed = false; { - T ref { user_def_types::get_init_value_helper(5) }; + T ref{user_def_types::get_init_value(5)}; const int case_num = static_cast(test_cases_external::by_reference_via_handler); sycl::buffer result_buffer(&passed, range); @@ -99,7 +99,7 @@ class check_specialization_constants_external { // handler passed = false; { - T ref { user_def_types::get_init_value_helper(10) }; + T ref{user_def_types::get_init_value(10)}; const int case_num = static_cast(test_cases_external::by_value_via_handler); sycl::buffer result_buffer(&passed, range); @@ -128,7 +128,7 @@ class check_specialization_constants_external { // via kernel_bundle passed = false; { - T ref { user_def_types::get_init_value_helper(15) }; + T ref{user_def_types::get_init_value(15)}; const int case_num = static_cast(test_cases_external::by_reference_via_bundle); sycl::buffer result_buffer(&passed, range); @@ -170,7 +170,7 @@ class check_specialization_constants_external { // kernel_bundle passed = false; { - T ref { user_def_types::get_init_value_helper(20) }; + T ref{user_def_types::get_init_value(20)}; const int case_num = static_cast(test_cases_external::by_value_via_bundle); sycl::buffer result_buffer(&passed, range); diff --git a/tests/spec_constants/spec_constants_multiple.h b/tests/spec_constants/spec_constants_multiple.h index 71b8d8168..1396f9567 100644 --- a/tests/spec_constants/spec_constants_multiple.h +++ b/tests/spec_constants/spec_constants_multiple.h @@ -16,7 +16,7 @@ template constexpr sycl::specialization_id sc_multiple( - user_def_types::get_init_value_helper(def_val)); + user_def_types::get_init_value(def_val)); namespace specialization_constants_multiple { using namespace sycl_cts; @@ -57,9 +57,9 @@ class check_specialization_constants_multiple_for_type { int val_A = 5; int val_B = 10; int val_C = 30; - T ref1{user_def_types::get_init_value_helper(0)}; - T ref2{user_def_types::get_init_value_helper(0)}; - T ref3{user_def_types::get_init_value_helper(0)}; + T ref1{user_def_types::get_init_value(0)}; + T ref2{user_def_types::get_init_value(0)}; + T ref3{user_def_types::get_init_value(0)}; fill_init_values(ref1, val_A); fill_init_values(ref2, val_B); fill_init_values(ref3, val_C); @@ -114,15 +114,12 @@ class check_specialization_constants_multiple_for_type { if (!check_equal_values(ref1, result_vec[0].value) || !check_equal_values(ref2, result_vec[1].value) || !check_equal_values(ref3, result_vec[2].value) || - !check_equal_values( - T(user_def_types::get_init_value_helper(def_values[3])), - result_vec[3].value) || - !check_equal_values( - T(user_def_types::get_init_value_helper(def_values[4])), - result_vec[4].value) || - !check_equal_values( - T(user_def_types::get_init_value_helper(def_values[5])), - result_vec[5].value)) + !check_equal_values(user_def_types::get_init_value(def_values[3]), + result_vec[3].value) || + !check_equal_values(user_def_types::get_init_value(def_values[4]), + result_vec[4].value) || + !check_equal_values(user_def_types::get_init_value(def_values[5]), + result_vec[5].value)) FAIL(log, "multiple spec const for " + type_name_string::get(type_name)); } diff --git a/tests/spec_constants/spec_constants_same_command_group_common.h b/tests/spec_constants/spec_constants_same_command_group_common.h index 3cdfc3cff..6c2ab3ed5 100644 --- a/tests/spec_constants/spec_constants_same_command_group_common.h +++ b/tests/spec_constants/spec_constants_same_command_group_common.h @@ -46,13 +46,13 @@ template class check_specialization_constants_same_command_group { public: void operator()(util::logger &log, const std::string &type_name) { - T ref_A{user_def_types::get_init_value_helper(5)}; - T ref_B{user_def_types::get_init_value_helper(10)}; + T ref_A{user_def_types::get_init_value(5)}; + T ref_B{user_def_types::get_init_value(10)}; auto queue = util::get_cts_object::queue(); sycl::range<1> range(1); { - T result1{user_def_types::get_init_value_helper(0)}; - T result2{user_def_types::get_init_value_helper(0)}; + T result1{user_def_types::get_init_value(0)}; + T result2{user_def_types::get_init_value(0)}; { command_group_object cmo; sycl::buffer result_buffer1(&result1, range); @@ -73,8 +73,8 @@ class check_specialization_constants_same_command_group { } { - T result1{user_def_types::get_init_value_helper(0)}; - T result2{user_def_types::get_init_value_helper(0)}; + T result1{user_def_types::get_init_value(0)}; + T result2{user_def_types::get_init_value(0)}; { command_group_object cmo; sycl::buffer result_buffer1(&result1, range); @@ -90,9 +90,8 @@ class check_specialization_constants_same_command_group { } if (!check_equal_values(ref_A, result1)) FAIL(log, "case 2 failed for value A for " + type_name); - if (!check_equal_values( - T(user_def_types::get_init_value_helper(default_val)), - result2)) + if (!check_equal_values(user_def_types::get_init_value(default_val), + result2)) FAIL(log, "case 2 failed for default value for " + type_name); } } diff --git a/tests/spec_constants/spec_constants_same_name_inter_link.h b/tests/spec_constants/spec_constants_same_name_inter_link.h index d341294e3..0f6b70376 100644 --- a/tests/spec_constants/spec_constants_same_name_inter_link.h +++ b/tests/spec_constants/spec_constants_same_name_inter_link.h @@ -48,10 +48,10 @@ class check_specialization_constants_same_name_inter_link_for_type { } } sycl::range<1> range(1); - T def_value{user_def_types::get_init_value_helper(0)}; - T ref_def_value{user_def_types::get_init_value_helper(0)}; - T result{user_def_types::get_init_value_helper(0)}; - T ref{user_def_types::get_init_value_helper(0)}; + T def_value{user_def_types::get_init_value(0)}; + T ref_def_value{user_def_types::get_init_value(0)}; + T result{user_def_types::get_init_value(0)}; + T ref{user_def_types::get_init_value(0)}; { // Setting ref values according to TU number fill_init_values(ref_def_value, TestConfig::tu); diff --git a/tests/spec_constants/spec_constants_same_name_inter_link_helper.h b/tests/spec_constants/spec_constants_same_name_inter_link_helper.h index a47863335..6f56c0a51 100644 --- a/tests/spec_constants/spec_constants_same_name_inter_link_helper.h +++ b/tests/spec_constants/spec_constants_same_name_inter_link_helper.h @@ -30,7 +30,7 @@ namespace { // SC_SN_IL_TU_NUM is defined in every TU template constexpr sycl::specialization_id sc_same_name_inter_link( - user_def_types::get_init_value_helper(SC_SN_IL_TU_NUM)); + user_def_types::get_init_value(SC_SN_IL_TU_NUM)); } // namespace diff --git a/tests/spec_constants/spec_constants_same_name_stress_helper.h b/tests/spec_constants/spec_constants_same_name_stress_helper.h index db75b3d3d..4e3fb9c4c 100644 --- a/tests/spec_constants/spec_constants_same_name_stress_helper.h +++ b/tests/spec_constants/spec_constants_same_name_stress_helper.h @@ -56,21 +56,21 @@ static std::string get_hint(int test_id) { // Specialization constant defined in global namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::glob))); namespace g_outer { // Specialization constant defined in outer namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::outer))); namespace g_inner { // Specialization constant defined in outer::inner namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::outer_inner))); } // namespace g_inner @@ -78,7 +78,7 @@ namespace { // Specialization constant defined in outer::unnamed namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::outer_unnamed))); template @@ -88,7 +88,7 @@ namespace g_u_inner { // Specialization constant defined in outer::unnamed::inner namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::outer_unnamed_inner))); template @@ -99,7 +99,7 @@ namespace { // namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::outer_unnamed_inner_unnamed))); template @@ -113,7 +113,7 @@ namespace { // Specialization constant defined in unnamed namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::unnamed))); template @@ -123,7 +123,7 @@ namespace u_outer { // Specialization constant defined in unnamed::outer namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::unnamed_outer))); template @@ -133,7 +133,7 @@ namespace { // Specialization constant defined in unnamed::outer::unnamed namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::unnamed_outer_unnamed))); template @@ -144,7 +144,7 @@ namespace u_inner { // namespace template constexpr sycl::specialization_id sc_same_name( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( to_integral(spec_const_help::sc_st_id::unnamed_outer_unnamed_inner))); template diff --git a/tests/spec_constants/spec_constants_separate_unit.cpp b/tests/spec_constants/spec_constants_separate_unit.cpp index a801371d8..2d84f6e46 100644 --- a/tests/spec_constants/spec_constants_separate_unit.cpp +++ b/tests/spec_constants/spec_constants_separate_unit.cpp @@ -14,7 +14,7 @@ using namespace get_spec_const; template inline constexpr sycl::specialization_id spec_const_external( - user_def_types::get_init_value_helper(default_val)); + user_def_types::get_init_value(default_val)); template bool check_kernel_handler_by_reference_external(sycl::kernel_handler &h, diff --git a/tests/spec_constants/spec_constants_via_handler_common.h b/tests/spec_constants/spec_constants_via_handler_common.h index 410cade48..87a883796 100644 --- a/tests/spec_constants/spec_constants_via_handler_common.h +++ b/tests/spec_constants/spec_constants_via_handler_common.h @@ -22,14 +22,14 @@ inline constexpr int val_A = 5; template constexpr sycl::specialization_id sc_multiple( - user_def_types::get_init_value_helper(case_num)); + user_def_types::get_init_value(case_num)); template class kernel; template bool check_kernel_handler_by_reference(sycl::kernel_handler &h) { - T ref{user_def_types::get_init_value_helper(0)}; + T ref{user_def_types::get_init_value(0)}; fill_init_values(ref, val_A); return check_equal_values( ref, h.get_specialization_constant>()); @@ -37,7 +37,7 @@ bool check_kernel_handler_by_reference(sycl::kernel_handler &h) { template bool check_kernel_handler_by_value(sycl::kernel_handler h) { - T ref{user_def_types::get_init_value_helper(0)}; + T ref{user_def_types::get_init_value(0)}; fill_init_values(ref, val_A); return check_equal_values( ref, h.get_specialization_constant>()); @@ -49,9 +49,9 @@ class check_spec_constant_with_handler_for_type { void operator()(util::logger &log, const std::string &type_name) { auto queue = util::get_cts_object::queue(); sycl::range<1> range(1); - T result{user_def_types::get_init_value_helper(0)}; - T ref{user_def_types::get_init_value_helper(0)}; - T ref_other{user_def_types::get_init_value_helper(0)}; + T result{user_def_types::get_init_value(0)}; + T ref{user_def_types::get_init_value(0)}; + T ref_other{user_def_types::get_init_value(0)}; int val_B = 10; fill_init_values(ref, val_A); fill_init_values(ref_other, val_B); @@ -59,7 +59,7 @@ class check_spec_constant_with_handler_for_type { { const int case_num = 1; { - result = user_def_types::get_init_value_helper(0); + result = user_def_types::get_init_value(0); queue.submit([&](sycl::handler &cgh) { cgh.set_specialization_constant>(ref); result = cgh.get_specialization_constant>(); @@ -74,7 +74,7 @@ class check_spec_constant_with_handler_for_type { { const int case_num = 2; { - result = user_def_types::get_init_value_helper(0); + result = user_def_types::get_init_value(0); queue.submit([&](sycl::handler &cgh) { cgh.set_specialization_constant>(ref); cgh.set_specialization_constant>(ref_other); @@ -91,7 +91,7 @@ class check_spec_constant_with_handler_for_type { { const int case_num = 3; { - result = user_def_types::get_init_value_helper(0); + result = user_def_types::get_init_value(0); sycl::buffer result_buffer(&result, range); queue.submit([&](sycl::handler &cgh) { auto res_acc = @@ -113,7 +113,7 @@ class check_spec_constant_with_handler_for_type { { const int case_num = 4; { - result = user_def_types::get_init_value_helper(0); + result = user_def_types::get_init_value(0); sycl::buffer result_buffer(&result, range); queue.submit([&](sycl::handler &cgh) { auto res_acc = @@ -164,13 +164,13 @@ class check_spec_constant_with_handler_for_type { { const int case_num = 6; { - result = user_def_types::get_init_value_helper(0); + result = user_def_types::get_init_value(0); queue.submit([&](sycl::handler &cgh) { result = cgh.get_specialization_constant>(); }); } - if (!check_equal_values( - T(user_def_types::get_init_value_helper(default_val)), result)) + if (!check_equal_values(user_def_types::get_init_value(default_val), + result)) FAIL(log, "case " + std::to_string(case_num) + " for " + type_name_string::get(type_name)); } @@ -180,7 +180,7 @@ class check_spec_constant_with_handler_for_type { { const int case_num = 7; { - result = user_def_types::get_init_value_helper(0); + result = user_def_types::get_init_value(0); sycl::buffer result_buffer(&result, range); queue.submit([&](sycl::handler &cgh) { auto res_acc = @@ -191,8 +191,8 @@ class check_spec_constant_with_handler_for_type { }); }); } - if (!check_equal_values( - T(user_def_types::get_init_value_helper(default_val)), result)) + if (!check_equal_values(user_def_types::get_init_value(default_val), + result)) FAIL(log, "case " + std::to_string(case_num) + " for " + type_name_string::get(type_name)); } diff --git a/tests/spec_constants/spec_constants_via_kernel_bundle.h b/tests/spec_constants/spec_constants_via_kernel_bundle.h index caf2704a2..5f299a804 100644 --- a/tests/spec_constants/spec_constants_via_kernel_bundle.h +++ b/tests/spec_constants/spec_constants_via_kernel_bundle.h @@ -136,7 +136,7 @@ struct values> : values {}; */ template constexpr sycl::specialization_id spec_const_by_kernel_bundle( - user_def_types::get_init_value_helper( + user_def_types::get_init_value( specialization_constants_via_kernel_bundle::values::initial)); namespace specialization_constants_via_kernel_bundle { @@ -300,7 +300,7 @@ void set_value(sycl::kernel_bundle& bundle) { " set_specialization_constant"); for (int i = 0; i < id::n_set; ++i) { // Prepare value to store - T value { user_def_types::get_init_value_helper(0) }; + T value{user_def_types::get_init_value(0)}; fill_init_values(value, values::reference(i)); bundle.template set_specialization_constant< @@ -323,11 +323,11 @@ bool check_value(specStorageT&& storage) { using namespace get_spec_const; // Prepare to read value - T value { user_def_types::get_init_value_helper(0) }; + T value{user_def_types::get_init_value(0)}; fill_init_values(value, values::empty); // Prepare to compare values - T expected { user_def_types::get_init_value_helper(0) }; + T expected{user_def_types::get_init_value(0)}; if constexpr (id::n_set == 0) { fill_init_values(expected, values::initial); } else {