Skip to content

Commit

Permalink
NVC++ clang-format fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed Aug 25, 2023
1 parent bb4e9e1 commit 7805bdc
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 22 deletions.
3 changes: 1 addition & 2 deletions algorithms/src/sorting/Kokkos_BinSortPublicAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ class BinSort {
Kokkos::View<typename SrcViewType::const_data_type,
typename SrcViewType::array_layout,
typename SrcViewType::device_type,
Kokkos::MemoryTraits<Kokkos::RandomAccess>
>,
Kokkos::MemoryTraits<Kokkos::RandomAccess> >,
typename SrcViewType::const_type>;

using perm_view_type = typename PermuteViewType::const_type;
Expand Down
6 changes: 3 additions & 3 deletions core/src/Kokkos_MathematicalFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ KOKKOS_INLINE_FUNCTION int abs(int n) {
}
KOKKOS_INLINE_FUNCTION long abs(long n) {
// FIXME_NVHPC ptxas fatal : unresolved extern function 'labs'
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC<230700
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC < 230700
return n > 0 ? n : -n;
#else
using KOKKOS_IMPL_MATH_FUNCTIONS_NAMESPACE::abs;
Expand All @@ -295,7 +295,7 @@ KOKKOS_INLINE_FUNCTION long abs(long n) {
}
KOKKOS_INLINE_FUNCTION long long abs(long long n) {
// FIXME_NVHPC ptxas fatal : unresolved extern function 'labs'
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC<230700
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC < 230700
return n > 0 ? n : -n;
#else
using KOKKOS_IMPL_MATH_FUNCTIONS_NAMESPACE::abs;
Expand Down Expand Up @@ -345,7 +345,7 @@ KOKKOS_IMPL_MATH_FUNCTIONS_DEFINED_IF_DEPRECATED_CODE_ENABLED(
// Exponential functions
KOKKOS_IMPL_MATH_UNARY_FUNCTION(exp)
// FIXME_NVHPC nvc++ has issues with exp2
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC<230700
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC < 230700
KOKKOS_INLINE_FUNCTION float exp2(float val) {
constexpr float ln2 = 0.693147180559945309417232121458176568L;
return exp(ln2 * val);
Expand Down
4 changes: 2 additions & 2 deletions core/src/Kokkos_Pair.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct pair {
///
/// This calls the copy constructors of T1 and T2. It won't compile
/// if those copy constructors are not defined and public.
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC<230700
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC < 230700
KOKKOS_FORCEINLINE_FUNCTION
#else
KOKKOS_FORCEINLINE_FUNCTION constexpr
Expand All @@ -74,7 +74,7 @@ struct pair {
/// This calls the copy constructors of T1 and T2. It won't compile
/// if those copy constructors are not defined and public.
template <class U, class V>
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC<230700
#if defined(KOKKOS_COMPILER_NVHPC) && KOKKOS_COMPILER_NVHPC < 230700
KOKKOS_FORCEINLINE_FUNCTION
#else
KOKKOS_FORCEINLINE_FUNCTION constexpr
Expand Down
6 changes: 2 additions & 4 deletions core/src/impl/Kokkos_HostThreadTeam.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ class HostThreadTeamData {

//----------------------------------------

constexpr
HostThreadTeamData() noexcept
constexpr HostThreadTeamData() noexcept
: m_work_range(-1, -1),
m_work_end(0),
m_scratch(nullptr),
Expand All @@ -177,8 +176,7 @@ class HostThreadTeamData {
m_work_chunk(0),
m_steal_rank(0),
m_pool_rendezvous_step(0),
m_team_rendezvous_step(0) {
}
m_team_rendezvous_step(0) {}

//----------------------------------------
// Organize array of members into a pool.
Expand Down
4 changes: 1 addition & 3 deletions core/unit_test/TestAtomics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,6 @@ struct TpetraUseCase {
}
};

TEST(TEST_CATEGORY, atomics_tpetra_max_abs) {
TpetraUseCase().check();
}
TEST(TEST_CATEGORY, atomics_tpetra_max_abs) { TpetraUseCase().check(); }

} // namespace Test
8 changes: 4 additions & 4 deletions core/unit_test/TestLocalDeepCopy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ void impl_test_local_deepcopy_rangepolicy_rank_7(const int N) {

#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA)
TEST(TEST_CATEGORY, local_deepcopy_teampolicy_layoutleft) {
#ifdef KOKKOS_COMPILER_NVHPC // 23.7
#ifdef KOKKOS_COMPILER_NVHPC // FIXME_NVHPC 23.7
GTEST_SKIP() << "FIXME_NVHPC (?)";
#endif

Expand Down Expand Up @@ -937,7 +937,7 @@ TEST(TEST_CATEGORY, local_deepcopy_teampolicy_layoutleft) {
}
//-------------------------------------------------------------------------------------------------------------
TEST(TEST_CATEGORY, local_deepcopy_rangepolicy_layoutleft) {
#ifdef KOKKOS_COMPILER_NVHPC // 23.7
#ifdef KOKKOS_COMPILER_NVHPC // FIXME_NVHPC 23.7
GTEST_SKIP() << "FIXME_NVHPC (?)";
#endif

Expand Down Expand Up @@ -968,7 +968,7 @@ TEST(TEST_CATEGORY, local_deepcopy_rangepolicy_layoutleft) {
}
//-------------------------------------------------------------------------------------------------------------
TEST(TEST_CATEGORY, local_deepcopy_teampolicy_layoutright) {
#ifdef KOKKOS_COMPILER_NVHPC // 23.7
#ifdef KOKKOS_COMPILER_NVHPC // FIXME_NVHPC 23.7
GTEST_SKIP() << "FIXME_NVHPC (?)";
#endif

Expand Down Expand Up @@ -999,7 +999,7 @@ TEST(TEST_CATEGORY, local_deepcopy_teampolicy_layoutright) {
}
//-------------------------------------------------------------------------------------------------------------
TEST(TEST_CATEGORY, local_deepcopy_rangepolicy_layoutright) {
#ifdef KOKKOS_COMPILER_NVHPC //23.7
#ifdef KOKKOS_COMPILER_NVHPC // FIXME_NVHPC 23.7
GTEST_SKIP() << "FIXME_NVHPC (?)";
#endif

Expand Down
3 changes: 2 additions & 1 deletion core/unit_test/TestMathematicalConstants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ struct TestMathematicalConstants {

KOKKOS_FUNCTION void use_on_device() const {
#if defined(KOKKOS_COMPILER_NVCC) || defined(KOKKOS_ENABLE_OPENMPTARGET) || \
defined(KOKKOS_ENABLE_OPENACC) || defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC 23.7
defined(KOKKOS_ENABLE_OPENACC) || \
defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC 23.7
take_by_value(Trait::value);
#else
(void)take_address_of(Trait::value);
Expand Down
7 changes: 4 additions & 3 deletions core/unit_test/TestNumericTraits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ struct extrema {
DEFINE_EXTREMA(double, -DBL_MAX, DBL_MAX);

// FIXME_NVHPC: with 23.3 using long double in KOKKOS_FUNCTION is hard error
#if !defined(KOKKOS_ENABLE_CUDA) || !defined(KOKKOS_COMPILER_NVHPC) // 23.7 long double
#if !defined(KOKKOS_ENABLE_CUDA) || \
!defined(KOKKOS_COMPILER_NVHPC) // 23.7 long double
DEFINE_EXTREMA(long double, -LDBL_MAX, LDBL_MAX);
#else
static long double min(long double) { return -LDBL_MAX; }
Expand Down Expand Up @@ -207,7 +208,7 @@ TEST(TEST_CATEGORY, numeric_traits_infinity) {
TestNumericTraits<TEST_EXECSPACE, float, Infinity>();
TestNumericTraits<TEST_EXECSPACE, double, Infinity>();
// FIXME_NVHPC long double not supported
#ifndef KOKKOS_COMPILER_NVHPC // 23.7 long double
#ifndef KOKKOS_COMPILER_NVHPC // 23.7 long double
TestNumericTraits<TEST_EXECSPACE, long double, Infinity>();
#endif
}
Expand All @@ -216,7 +217,7 @@ TEST(TEST_CATEGORY, numeric_traits_epsilon) {
TestNumericTraits<TEST_EXECSPACE, float, Epsilon>();
TestNumericTraits<TEST_EXECSPACE, double, Epsilon>();
// FIXME_NVHPC long double not supported
#ifndef KOKKOS_COMPILER_NVHPC // 23.7 long double:
#ifndef KOKKOS_COMPILER_NVHPC // 23.7 long double:
TestNumericTraits<TEST_EXECSPACE, long double, Epsilon>();
#endif
}
Expand Down

0 comments on commit 7805bdc

Please sign in to comment.