Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Revert workaround for mdspan with CUDA 12.9#8779

Merged
crtrott merged 1 commit intokokkos:developfrom
tpadioleau:fix-cuda-12-9-workaround-and-deprecated-code
Dec 24, 2025
Merged

Revert workaround for mdspan with CUDA 12.9#8779
crtrott merged 1 commit intokokkos:developfrom
tpadioleau:fix-cuda-12-9-workaround-and-deprecated-code

Conversation

@tpadioleau
Copy link
Member

Compiling Kokkos with cmake -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_DEPRECATED_CODE_5=OFF -B build-cuda and CUDA 12.9 results in the following error

 21%] Building CXX object core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_Core.cpp.o
nvcc warning : Support for offline compilation for architectures prior to '<compute/sm/lto>_75' will be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/home/TP026749/kokkos/core/src/View/Kokkos_ViewTraits.hpp(492): error: class "Kokkos::Impl::ViewDataAnalysis<uint32_t *, Kokkos::Cuda::array_layout, uint32_t>" has no member "type"
    using data_type = typename data_analysis::type;
                                              ^
          detected during:
            instantiation of class "Kokkos::ViewTraits<DataType, Properties...> [with DataType=uint32_t *, Properties=<Kokkos::CudaSpace>]" at line 214 of /home/TP026749/kokkos/core/src/View/Kokkos_ViewLegacy.hpp
            instantiation of class "Kokkos::View<DataType, Properties...> [with DataType=uint32_t *, Properties=<Kokkos::CudaSpace>]" at line 28 of /home/TP026749/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp

/home/TP026749/kokkos/core/src/View/Kokkos_ViewTraits.hpp(493): error: class "Kokkos::Impl::ViewDataAnalysis<uint32_t *, Kokkos::Cuda::array_layout, uint32_t>" has no member "const_type"
    using const_data_type = typename data_analysis::const_type;
                                                    ^
          detected during:
            instantiation of class "Kokkos::ViewTraits<DataType, Properties...> [with DataType=uint32_t *, Properties=<Kokkos::CudaSpace>]" at line 214 of /home/TP026749/kokkos/core/src/View/Kokkos_ViewLegacy.hpp
            instantiation of class "Kokkos::View<DataType, Properties...> [with DataType=uint32_t *, Properties=<Kokkos::CudaSpace>]" at line 28 of /home/TP026749/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp

/home/TP026749/kokkos/core/src/View/Kokkos_ViewTraits.hpp(494): error: class "Kokkos::Impl::ViewDataAnalysis<uint32_t *, Kokkos::Cuda::array_layout, uint32_t>" has no member "non_const_type"
    using non_const_data_type = typename data_analysis::non_const_type;
                                                        ^
          detected during:
            instantiation of class "Kokkos::ViewTraits<DataType, Properties...> [with DataType=uint32_t *, Properties=<Kokkos::CudaSpace>]" at line 214 of /home/TP026749/kokkos/core/src/View/Kokkos_ViewLegacy.hpp
            instantiation of class "Kokkos::View<DataType, Properties...> [with DataType=uint32_t *, Properties=<Kokkos::CudaSpace>]" at line 28 of /home/TP026749/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp

/home/TP026749/kokkos/core/src/View/Kokkos_ViewLegacy.hpp(242): error: class "Kokkos::ViewTraits<uint32_t *, Kokkos::CudaSpace>" has no member "scalar_array_type"
        View<typename traits::scalar_array_type, typename traits::array_layout,
                              ^
          detected during instantiation of class "Kokkos::View<DataType, Properties...> [with DataType=uint32_t *, Properties=<Kokkos::CudaSpace>]" at line 28 of /home/TP026749/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp

/home/TP026749/kokkos/core/src/View/Kokkos_ViewLegacy.hpp(245): error: class "Kokkos::ViewTraits<uint32_t *, Kokkos::CudaSpace>" has no member "scalar_array_type"
        View<typename traits::scalar_array_type, typename traits::array_layout,
                              ^
          detected during instantiation of class "Kokkos::View<DataType, Properties...> [with DataType=uint32_t *, Properties=<Kokkos::CudaSpace>]" at line 28 of /home/TP026749/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp

5 errors detected in the compilation of "/home/TP026749/kokkos/core/src/impl/Kokkos_Core.cpp".
gmake[2]: *** [core/src/CMakeFiles/kokkoscore.dir/build.make:121: core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_Core.cpp.o] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:1289: core/src/CMakeFiles/kokkoscore.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

In this PR I suggest to revert the workaround introduced in #8169 because there is a workaround available in mdspan to handle CUDA >=12.9, see #8615 and #8562.

The changes in core/src/View/Kokkos_ViewTraits.hpp and core/src/View/Kokkos_ViewLegacy.hpp make it possible to compile with Kokkos_ENABLE_DEPRECATED_CODE_5=OFF and Kokkos_ENABLE_IMPL_VIEW_LEGACY=ON.

@tpadioleau tpadioleau force-pushed the fix-cuda-12-9-workaround-and-deprecated-code branch from 5cc9a5c to 1bd91dc Compare December 20, 2025 14:48
@tpadioleau tpadioleau force-pushed the fix-cuda-12-9-workaround-and-deprecated-code branch from 1bd91dc to 1db67d4 Compare December 20, 2025 15:08
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.

Fine with me.

@crtrott crtrott merged commit 2a5217b into kokkos:develop Dec 24, 2025
44 of 55 checks passed
crtrott pushed a commit to crtrott/kokkos that referenced this pull request Dec 24, 2025
dalg24 added a commit that referenced this pull request Dec 29, 2025
[5.0.1] Revert mdspan with CUDA 12.9 workaround (#8779)
janciesko pushed a commit to janciesko/kokkos that referenced this pull request Jan 14, 2026
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.

4 participants