-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit splits the testing of atomic_ref with double * into separate tests to allow for fp64 support checks. This is related to KhronosGroup/SYCL-Docs#526. Signed-off-by: Larsen, Steffen <[email protected]>
- Loading branch information
1 parent
9691bc0
commit ab143dd
Showing
11 changed files
with
571 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/******************************************************************************* | ||
// | ||
// SYCL 2020 Conformance Test Suite | ||
// | ||
// Copyright (c) 2023 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<void *>() && device_has_not_aspect_atomic64()) { | ||
SKIP( | ||
"Device does not support atomic64 operations. " | ||
"Skipping the test case."); | ||
} | ||
for_all_types<atomic_ref::tests::api::run_T_op_test>(type_pack); | ||
}); | ||
|
||
} // namespace atomic_ref::tests::api::core |
56 changes: 56 additions & 0 deletions
56
tests/atomic_ref/atomic_ref_add_sub_op_all_types_test_pointers_fp64.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/******************************************************************************* | ||
// | ||
// SYCL 2020 Conformance Test Suite | ||
// | ||
// Copyright (c) 2023 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<void*>() && device_has_not_aspect_atomic64()) { | ||
SKIP( | ||
"Device does not support atomic64 operations. " | ||
"Skipping the test case."); | ||
} | ||
for_all_types<atomic_ref::tests::api::run_add_sub_op_all_types_test>( | ||
type_pack); | ||
}); | ||
|
||
} // namespace atomic_ref::tests::api::core |
55 changes: 55 additions & 0 deletions
55
tests/atomic_ref/atomic_ref_assign_op_test_pointers_fp64.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/******************************************************************************* | ||
// | ||
// SYCL 2020 Conformance Test Suite | ||
// | ||
// Copyright (c) 2023 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<void *>() && device_has_not_aspect_atomic64()) { | ||
SKIP( | ||
"Device does not support atomic64 operations. " | ||
"Skipping the test case."); | ||
} | ||
for_all_types<atomic_ref::tests::api::run_assign_op_test>(type_pack); | ||
}); | ||
|
||
} // namespace atomic_ref::tests::api::core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
tests/atomic_ref/atomic_ref_compare_exchange_test_pointers_fp64.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/******************************************************************************* | ||
// | ||
// SYCL 2020 Conformance Test Suite | ||
// | ||
// Copyright (c) 2023 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<void *>() && device_has_not_aspect_atomic64()) { | ||
SKIP( | ||
"Device does not support atomic64 operations. " | ||
"Skipping the test case."); | ||
} | ||
for_all_types<atomic_ref::tests::api::run_compare_exchange_test>(type_pack); | ||
}); | ||
|
||
} // namespace atomic_ref::tests::api::core |
55 changes: 55 additions & 0 deletions
55
tests/atomic_ref/atomic_ref_constructors_pointers_fp64.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/******************************************************************************* | ||
// | ||
// SYCL 2020 Conformance Test Suite | ||
// | ||
// Copyright (c) 2023 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<void *>() && device_has_not_aspect_atomic64()) { | ||
SKIP( | ||
"Device does not support atomic64 operations. " | ||
"Skipping the test case."); | ||
} | ||
for_all_types<atomic_ref::tests::constructors::run_test>(types); | ||
}); | ||
|
||
} // namespace atomic_ref::tests::constructors::core |
55 changes: 55 additions & 0 deletions
55
tests/atomic_ref/atomic_ref_exchange_test_pointers_fp64.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/******************************************************************************* | ||
// | ||
// SYCL 2020 Conformance Test Suite | ||
// | ||
// Copyright (c) 2023 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<void *>() && device_has_not_aspect_atomic64()) { | ||
SKIP( | ||
"Device does not support atomic64 operations. " | ||
"Skipping the test case."); | ||
} | ||
for_all_types<atomic_ref::tests::api::run_exchange_test>(type_pack); | ||
}); | ||
|
||
} // namespace atomic_ref::tests::api::core |
Oops, something went wrong.