Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building with NVCC as the CXX compiler while the CUDA backend is not enabled #5115

Merged

Conversation

dalg24
Copy link
Member

@dalg24 dalg24 commented Jun 14, 2022

Fix #5093

@ndellingwood would you please add a nightly build with -DCMAKE_CXX_COMPILER=<prefix>/bin/nvcc_wrapper -DKokkos_ENABLE_CUDA=OFF?

Co-Authored-By: Arno Mayrhofer <arno.mayrhofer@dcs-computing.com>
Copy link
Contributor

@JBludau JBludau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the guard in the TestNumericTraits.hpp really related to the issue or something that came up along the way? Do we know why it needs to be guarded?

sry, I fucked up with the brackets

@dalg24
Copy link
Member Author

dalg24 commented Jun 14, 2022

Is the guard in the TestNumericTraits.hpp really related to the issue or something that came up along the way? Do we know why it needs to be guarded?

First change is rather obvious, without it you get an error because the OpenMPTarget execution space is not defined.

Second one we hit a known bug

// Workaround compiler issue error: expression must have a constant value
// See kokkos/kokkos#4574

CUDA_VERSION is not defined so I opted for "unconditional" removal when using NVCC with the CUDA backend disabled

Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me.

Copy link
Contributor

@JBludau JBludau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@ndellingwood
Copy link
Contributor

@ndellingwood would you please add a nightly build with -DCMAKE_CXX_COMPILER=<prefix>/bin/nvcc_wrapper -DKokkos_ENABLE_CUDA=OFF?

Will do

@dalg24 dalg24 merged commit 75feb42 into kokkos:develop Jun 15, 2022
@dalg24 dalg24 deleted the fix_building_with_nvcc_without_cuda_enabled branch June 15, 2022 01:55
@ndellingwood
Copy link
Contributor

@dalg24 I'm testing a local build with the desired config (compile with nvcc_wrapper, cuda backend disabled) to prep for the new nightly build.
Successful compilation (tested with cuda/10.1+gcc/7.3.0), I encountered warning messages related to desul:

/ascldap/users/ndellin/kokkos/core/src/../../tpls/desul/include/desul/atomics/Compare_Exchange_ScopeCaller.hpp(39): warning: calling a constexpr __host__ function("operator==") from a __host__ __device__ function("atomic_compare_exchange") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
          detected during:
            instantiation of "T desul::atomic_compare_exchange(T *, T, T, desul::MemoryOrderRelaxed, desul::MemoryScopeCaller) [with T=Kokkos::Impl::HostThreadTeamData::pair_int_t]" 
/ascldap/users/ndellin/kokkos/core/src/Kokkos_Atomics_Desul_Wrapper.hpp(227): here
            instantiation of "T Kokkos::atomic_compare_exchange(T *, desul::Impl::dont_deduce_this_parameter_t<const T>, desul::Impl::dont_deduce_this_parameter_t<const T>) [with T=Kokkos::Impl::HostThreadTeamData::pair_int_t]" 
/ascldap/users/ndellin/kokkos/core/src/impl/Kokkos_HostThreadTeam.cpp(225): here

/ascldap/users/ndellin/kokkos/core/src/../../tpls/desul/include/desul/atomics/Compare_Exchange_ScopeCaller.hpp(39): warning: calling a constexpr __host__ function from a __host__ __device__ function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
          detected during:
            instantiation of "T desul::atomic_compare_exchange(T *, T, T, desul::MemoryOrderRelaxed, desul::MemoryScopeCaller) [with T=Kokkos::Impl::HostThreadTeamData::pair_int_t]" 
/ascldap/users/ndellin/kokkos/core/src/Kokkos_Atomics_Desul_Wrapper.hpp(227): here
            instantiation of "T Kokkos::atomic_compare_exchange(T *, desul::Impl::dont_deduce_this_parameter_t<const T>, desul::Impl::dont_deduce_this_parameter_t<const T>) [with T=Kokkos::Impl::HostThreadTeamData::pair_int_t]" 
/ascldap/users/ndellin/kokkos/core/src/impl/Kokkos_HostThreadTeam.cpp(225): here

Should I open an issue (and if so does this go to the kokkos repo or an external desul repo)?

@dalg24
Copy link
Member Author

dalg24 commented Jun 15, 2022

Plz add to the developer meeting agenda today. It is technically a desul issue, which detect CUDA rather than taking it as a configuration option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants