Skip to content

Commit

Permalink
Merge pull request #108 from krasznaa/SYCLFP64Skip-main-20231006
Browse files Browse the repository at this point in the history
SYCL FP64 Test Skips, main branch (2023.10.06.)
  • Loading branch information
krasznaa authored Oct 6, 2023
2 parents 0edc97c + 7248482 commit 0f39b27
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion tests/accelerator/sycl/common/test_sycl_basics.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Algebra plugins library, part of the ACTS project
*
* (c) 2020-2022 CERN for the benefit of the ACTS project
* (c) 2020-2023 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand Down Expand Up @@ -42,6 +42,13 @@ TYPED_TEST_SUITE_P(test_sycl_basics);
/// Test for some basic 2D "vector operations"
TYPED_TEST_P(test_sycl_basics, vector_2d_ops) {

// Don't run the test at double precision, if the SYCL device doesn't
// support it.
if ((typeid(typename TypeParam::scalar) == typeid(double)) &&
(this->m_queue.get_device().has(cl::sycl::aspect::fp64) == false)) {
GTEST_SKIP();
}

// Run the test on the host, and on the/a device.
execute_host_test<vector_2d_ops_functor<TypeParam> >(
this->m_p1->size(), vecmem::get_data(*(this->m_p1)),
Expand All @@ -59,6 +66,13 @@ TYPED_TEST_P(test_sycl_basics, vector_2d_ops) {
/// Test for some basic 3D "vector operations"
TYPED_TEST_P(test_sycl_basics, vector_3d_ops) {

// Don't run the test at double precision, if the SYCL device doesn't
// support it.
if ((typeid(typename TypeParam::scalar) == typeid(double)) &&
(this->m_queue.get_device().has(cl::sycl::aspect::fp64) == false)) {
GTEST_SKIP();
}

// This test is just not numerically stable at float precision in optimized
// mode on some backends. :-( (Cough... HIP... cough...)
#ifdef NDEBUG
Expand All @@ -84,6 +98,13 @@ TYPED_TEST_P(test_sycl_basics, vector_3d_ops) {
/// Test for handling matrices
TYPED_TEST_P(test_sycl_basics, matrix64_ops) {

// Don't run the test at double precision, if the SYCL device doesn't
// support it.
if ((typeid(typename TypeParam::scalar) == typeid(double)) &&
(this->m_queue.get_device().has(cl::sycl::aspect::fp64) == false)) {
GTEST_SKIP();
}

// Run the test on the host, and on the/a device.
execute_host_test<matrix64_ops_functor<TypeParam> >(
this->m_m1->size(), vecmem::get_data(*(this->m_m1)),
Expand All @@ -99,6 +120,13 @@ TYPED_TEST_P(test_sycl_basics, matrix64_ops) {
/// Test for handling matrices
TYPED_TEST_P(test_sycl_basics, matrix22_ops) {

// Don't run the test at double precision, if the SYCL device doesn't
// support it.
if ((typeid(typename TypeParam::scalar) == typeid(double)) &&
(this->m_queue.get_device().has(cl::sycl::aspect::fp64) == false)) {
GTEST_SKIP();
}

// Run the test on the host, and on the/a device.
execute_host_test<matrix22_ops_functor<TypeParam> >(
this->m_m2->size(), vecmem::get_data(*(this->m_m2)),
Expand All @@ -114,6 +142,13 @@ TYPED_TEST_P(test_sycl_basics, matrix22_ops) {
/// Test for some operations with @c transform3
TYPED_TEST_P(test_sycl_basics, transform3) {

// Don't run the test at double precision, if the SYCL device doesn't
// support it.
if ((typeid(typename TypeParam::scalar) == typeid(double)) &&
(this->m_queue.get_device().has(cl::sycl::aspect::fp64) == false)) {
GTEST_SKIP();
}

// Run the test on the host, and on the/a device.
execute_host_test<transform3_ops_functor<TypeParam> >(
this->m_t1->size(), vecmem::get_data(*(this->m_t1)),
Expand Down

0 comments on commit 0f39b27

Please sign in to comment.