kokkos / kokkos-kernels

Kokkos C++ Performance Portability Programming Ecosystem: Math Kernels - Provides BLAS, Sparse BLAS and Graph Kernels
Other
310 stars 97 forks source link

Nightly build failure, cuda/11.1 + gcc/8.3.0: Test_Common_AlignPtrTo.hpp:138:36: error: 'RangePolicy' was not declared in this scope #2264

Closed ndellingwood closed 4 months ago

ndellingwood commented 4 months ago

Nightly cuda/11.1 + gcc/8.3.0 builds fail to compile Test_Common_AlignPtrTo.hpp following merge of #2262

Output:

21:09:24 /data/jenkins-new/workspace/KokkosKernels_semsrhel7gpu01_cuda111_gcc830_cpp17/kokkos-kernels/common/unit_test/Test_Common_AlignPtrTo.hpp: In instantiation of 'void _GLOBAL__N__53_tmpxft_00076a8e_00000000_7_Test_Serial_Common_cpp1_ii_08b379a2::test_alignPtrTo() [with int TEST_FN = 0; Device = Kokkos::Serial]':
21:09:24 /data/jenkins-new/workspace/KokkosKernels_semsrhel7gpu01_cuda111_gcc830_cpp17/kokkos-kernels/common/unit_test/Test_Common_AlignPtrTo.hpp:158:40:   required from here
21:09:24 /data/jenkins-new/workspace/KokkosKernels_semsrhel7gpu01_cuda111_gcc830_cpp17/kokkos-kernels/common/unit_test/Test_Common_AlignPtrTo.hpp:138:36: error: 'RangePolicy' was not declared in this scope
21:09:24    Kokkos::parallel_reduce(
21:09:24                          ~~         ^                   
21:09:24 /data/jenkins-new/workspace/KokkosKernels_semsrhel7gpu01_cuda111_gcc830_cpp17/kokkos-kernels/common/unit_test/Test_Common_AlignPtrTo.hpp:138:36: note: suggested alternative:
21:09:24 /data/jenkins-new/workspace/KokkosKernels_semsrhel7gpu01_cuda111_gcc830_cpp17/TestAll_2024-07-01_20.52.14/cuda/11.1.0/Cuda_Serial-release/kokkos-install/include/Kokkos_ExecPolicy.hpp:68:7: note:   'Kokkos::RangePolicy'
21:09:24  class RangePolicy : public Impl::PolicyTraits<Properties...> {
21:09:24        ^~~~~~~~~~~
21:09:24 /data/jenkins-new/workspace/KokkosKernels_semsrhel7gpu01_cuda111_gcc830_cpp17/kokkos-kernels/common/unit_test/Test_Common_AlignPtrTo.hpp: In instantiation of 'void _GLOBAL__N__53_tmpxft_00076a8e_00000000_7_Test_Serial_Common_cpp1_ii_08b379a2::test_alignPtrTo() [with int TEST_FN = 1; Device = Kokkos::Serial]':
...

Other Cuda+Gcc combos did not show this error, so this is likely a compiler issue and not a bug. @cwpearson can you investigate?

Reproducer configuration notes (machine sogpu01.sandia.gov):


module load sems-cmake sems-gcc/8.3.0 sems-cuda/11.1.0

$KOKKOSKERNELS_PATH/cm_generate_makefile.bash --with-devices=Cuda,Serial --arch=Volta70 --compiler=$KOKKOS_PATH/bin/nvcc_wrapper --cxxflags="-O3 -Wall -Wunused-parameter -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitialized " --cxxstandard="17" --kokkos-path=$KOKKOS_PATH --kokkoskernels-path=$KOKKOSKERNELS_PATH --with-scalars='double,complex_double' --with-ordinals=int --with-offsets=int,size_t --with-layouts=LayoutLeft
cwpearson commented 4 months ago

Do I need to be part of a metagroup to access that system? It's not letting me in.

cwpearson commented 4 months ago

or, could you please try this:

diff --git a/common/unit_test/Test_Common_AlignPtrTo.hpp b/common/unit_test/Test_Common_AlignPtrTo.hpp
index f60887cd8..760cddd5a 100644
--- a/common/unit_test/Test_Common_AlignPtrTo.hpp
+++ b/common/unit_test/Test_Common_AlignPtrTo.hpp
@@ -136,7 +136,7 @@ void test_alignPtrTo() {

   int errs;
   Kokkos::parallel_reduce(
-      Kokkos::RangePolicy(space, 0, teamSize),
+      Kokkos::RangePolicy<ExecSpace>(space, 0, teamSize),
       KOKKOS_LAMBDA(int i, int &lerr) { lerr += (results(i) != i); }, errs);

 // if SYCL is enabled, only TEST_FN 1 and 4 should work
ndellingwood commented 4 months ago

@cwpearson good catch, I forgot older versions of gcc struggle with ctad, I'll test that now Re: metagroup - I think you can put in a request through sems to be added as a user which will handle being added as necessary to metagroups etc. , here's the link: https://sems-atlassian-son.sandia.gov/jira/servicedesk/customer/portal/4

ndellingwood commented 4 months ago

@cwpearson that resolved it, would you like me to put in a PR or would you like to?

cwpearson commented 4 months ago

Go for it!