Skip to content

Commit

Permalink
Disable failed bit manipulation tests when compiled by NVHPC (kokkos#…
Browse files Browse the repository at this point in the history
…6088)

* NVHPC compiler failed to correctly translate accelerator region for tests in
core/unit_test/TestBitManipulationBuiltins.hpp if the tested variable type is char
or short; disable those failed tests.

* Update so that the problematic bit manipulation tests are disabled only
when NVHPC compiles for the OpenACC backend.

* Fixed the missing indentation error regarding the SYCL tests
  • Loading branch information
seyonglee committed May 1, 2023
1 parent d30b04d commit 56ef02c
Showing 1 changed file with 124 additions and 28 deletions.
152 changes: 124 additions & 28 deletions core/unit_test/TestBitManipulationBuiltins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,16 @@ void test_bit_manip_countl_zero() {
}

TEST(TEST_CATEGORY, bit_manip_countl_zero) {
test_bit_manip_countl_zero<unsigned char>();
test_bit_manip_countl_zero<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_countl_zero<unsigned char>();
test_bit_manip_countl_zero<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_countl_zero<unsigned int>();
test_bit_manip_countl_zero<unsigned long>();
test_bit_manip_countl_zero<unsigned long long>();
Expand Down Expand Up @@ -170,8 +178,16 @@ void test_bit_manip_countl_one() {
}

TEST(TEST_CATEGORY, bit_manip_countl_one) {
test_bit_manip_countl_one<unsigned char>();
test_bit_manip_countl_one<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_countl_one<unsigned char>();
test_bit_manip_countl_one<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_countl_one<unsigned int>();
test_bit_manip_countl_one<unsigned long>();
test_bit_manip_countl_one<unsigned long long>();
Expand Down Expand Up @@ -205,12 +221,20 @@ void test_bit_manip_countr_zero() {
}

TEST(TEST_CATEGORY, bit_manip_countr_zero) {
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
#if defined(KOKKOS_ENABLE_SYCL) && \
!defined(KOKKOS_ARCH_INTEL_GPU) // FIXME_SYCL returns wrong result
if (!std::is_same_v<TEST_EXECSPACE, Kokkos::Experimental::SYCL>)
if (!std::is_same_v<TEST_EXECSPACE, Kokkos::Experimental::SYCL>)
#endif
test_bit_manip_countr_zero<unsigned char>();
test_bit_manip_countr_zero<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_countr_zero<unsigned char>();
test_bit_manip_countr_zero<unsigned short>();
test_bit_manip_countr_zero<unsigned int>();
test_bit_manip_countr_zero<unsigned long>();
test_bit_manip_countr_zero<unsigned long long>();
Expand Down Expand Up @@ -243,12 +267,20 @@ void test_bit_manip_countr_one() {
}

TEST(TEST_CATEGORY, bit_manip_countr_one) {
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
#if defined(KOKKOS_ENABLE_SYCL) && \
!defined(KOKKOS_ARCH_INTEL_GPU) // FIXME_SYCL returns wrong result
if (!std::is_same_v<TEST_EXECSPACE, Kokkos::Experimental::SYCL>)
if (!std::is_same_v<TEST_EXECSPACE, Kokkos::Experimental::SYCL>)
#endif
test_bit_manip_countr_one<unsigned char>();
test_bit_manip_countr_one<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_countr_one<unsigned char>();
test_bit_manip_countr_one<unsigned short>();
test_bit_manip_countr_one<unsigned int>();
test_bit_manip_countr_one<unsigned long>();
test_bit_manip_countr_one<unsigned long long>();
Expand Down Expand Up @@ -279,8 +311,16 @@ void test_bit_manip_popcount() {
}

TEST(TEST_CATEGORY, bit_manip_popcount) {
test_bit_manip_popcount<unsigned char>();
test_bit_manip_popcount<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_popcount<unsigned char>();
test_bit_manip_popcount<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_popcount<unsigned int>();
test_bit_manip_popcount<unsigned long>();
test_bit_manip_popcount<unsigned long long>();
Expand Down Expand Up @@ -320,8 +360,16 @@ void test_bit_manip_has_single_bit() {
}

TEST(TEST_CATEGORY, bit_manip_has_single_bit) {
test_bit_manip_has_single_bit<unsigned char>();
test_bit_manip_has_single_bit<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_has_single_bit<unsigned char>();
test_bit_manip_has_single_bit<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_has_single_bit<unsigned int>();
test_bit_manip_has_single_bit<unsigned long>();
test_bit_manip_has_single_bit<unsigned long long>();
Expand Down Expand Up @@ -355,8 +403,16 @@ void test_bit_manip_bit_floor() {
}

TEST(TEST_CATEGORY, bit_manip_bit_floor) {
test_bit_manip_bit_floor<unsigned char>();
test_bit_manip_bit_floor<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_bit_floor<unsigned char>();
test_bit_manip_bit_floor<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_bit_floor<unsigned int>();
test_bit_manip_bit_floor<unsigned long>();
test_bit_manip_bit_floor<unsigned long long>();
Expand Down Expand Up @@ -395,8 +451,16 @@ void test_bit_manip_bit_ceil() {
}

TEST(TEST_CATEGORY, bit_manip_bit_ceil) {
test_bit_manip_bit_ceil<unsigned char>();
test_bit_manip_bit_ceil<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_bit_ceil<unsigned char>();
test_bit_manip_bit_ceil<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_bit_ceil<unsigned int>();
test_bit_manip_bit_ceil<unsigned long>();
test_bit_manip_bit_ceil<unsigned long long>();
Expand Down Expand Up @@ -426,8 +490,16 @@ void test_bit_manip_bit_width() {
}

TEST(TEST_CATEGORY, bit_manip_bit_width) {
test_bit_manip_bit_width<unsigned char>();
test_bit_manip_bit_width<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_bit_width<unsigned char>();
test_bit_manip_bit_width<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_bit_width<unsigned int>();
test_bit_manip_bit_width<unsigned long>();
test_bit_manip_bit_width<unsigned long long>();
Expand Down Expand Up @@ -541,8 +613,16 @@ void test_bit_manip_rotl() {
}

TEST(TEST_CATEGORY, bit_manip_rotl) {
test_bit_manip_rotl<unsigned char>();
test_bit_manip_rotl<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_rotl<unsigned char>();
test_bit_manip_rotl<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_rotl<unsigned int>();
test_bit_manip_rotl<unsigned long>();
test_bit_manip_rotl<unsigned long long>();
Expand Down Expand Up @@ -595,8 +675,16 @@ void test_bit_manip_rotr() {
}

TEST(TEST_CATEGORY, bit_manip_rotr) {
test_bit_manip_rotr<unsigned char>();
test_bit_manip_rotr<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_rotr<unsigned char>();
test_bit_manip_rotr<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_rotr<unsigned int>();
test_bit_manip_rotr<unsigned long>();
test_bit_manip_rotr<unsigned long long>();
Expand Down Expand Up @@ -658,10 +746,18 @@ void test_bit_manip_byteswap() {
}

TEST(TEST_CATEGORY, bit_manip_byeswap) {
test_bit_manip_byteswap<char>();
test_bit_manip_byteswap<unsigned char>();
test_bit_manip_byteswap<short>();
test_bit_manip_byteswap<unsigned short>();
// FIXME_NVHPC: NVC++-W-0155-Compiler failed to translate accelerator region
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
if constexpr (!std::is_same_v<TEST_EXECSPACE,
Kokkos::Experimental::OpenACC>) {
#endif
test_bit_manip_byteswap<char>();
test_bit_manip_byteswap<unsigned char>();
test_bit_manip_byteswap<short>();
test_bit_manip_byteswap<unsigned short>();
#if defined(KOKKOS_ENABLE_OPENACC) && defined(KOKKOS_COMPILER_NVHPC)
}
#endif
test_bit_manip_byteswap<int>();
test_bit_manip_byteswap<unsigned int>();
test_bit_manip_byteswap<long>();
Expand Down

0 comments on commit 56ef02c

Please sign in to comment.