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

support use of mdspan/mdarray.hpp header #376

Merged
merged 2 commits into from
Feb 14, 2025
Merged

Conversation

cwsmith
Copy link
Contributor

@cwsmith cwsmith commented Jan 15, 2025

Using #include "mdspan/mdarray.hpp" provided by mdspan fails with the following error:

In file included from /space/cwsmith/mdspan/buildMdsCuda/install/include/mdspan/mdarray.hpp:29,
                 from /space/cwsmith/mdspan/mdarrayReproducer/mdarrayReproducer.cpp:17:         
/space/cwsmith/mdspan/buildMdsCuda/install/include/mdspan/../experimental/__p1684_bits/mdarray.hpp:19:10: fatal error: ../mdspan: No such file or directory
   19 | #include "../mdspan"                                                                                                            
      |          ^~~~~~~~~~~                                                                                                            
compilation terminated. 

A reproducer (mdarrayReproducer.cpp) is below:

#include "mdspan/mdarray.hpp"
int main(int argc, char* argv[]) {
  return 0;
}

and its CMakeLists.txt:

cmake_minimum_required(VERSION 3.16)
project(mdarrayReproducer CXX)
find_package(mdspan REQUIRED)
add_executable(reproducer mdarrayReproducer.cpp)
target_link_libraries(reproducer std::mdspan)

This PR fixes the compilation error, but I'm not sure if it is the correct fix. If it is merged and then brought into downstream Kokkos, it will resolve the issue discussed in kokkos/kokkos#7671.

All mdspan tests passed when using the following cmake commands with GCC 12.3.0 and CUDA 12.1.1.

bdir=$PWD/buildMdsCuda
cmake -S mdspan -B $bdir \
  -DCMAKE_INSTALL_PREFIX=$bdir/install \
  -DMDSPAN_CXX_STANDARD=17 \
  -DMDSPAN_ENABLE_TESTS=on \
  -DMDSPAN_ENABLE_EXAMPLES=on \
  -DMDSPAN_ENABLE_CUDA=on \
  -DCMAKE_CUDA_FLAGS=--expt-relaxed-constexpr \
  -DCMAKE_CUDA_ARCHITECTURES=86 
cmake --build buildMdsCuda -j20 --target install
ctest --test-dir buildMdsCuda/

@dalg24 dalg24 requested a review from nmm0 January 15, 2025 19:43
Copy link
Contributor

@nmm0 nmm0 left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this!

@nmm0
Copy link
Contributor

nmm0 commented Jan 16, 2025

CI Failure is unrelated, I suppose something changed and our CI broke...

@nmm0
Copy link
Contributor

nmm0 commented Feb 14, 2025

@cwsmith When you get a chance could you rebase this? I would like to get it in. We have the fixes for the CI in

@cwsmith
Copy link
Contributor Author

cwsmith commented Feb 14, 2025

@nmm0 All set.

@dalg24 dalg24 merged commit d34b447 into kokkos:stable Feb 14, 2025
15 checks passed
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.

3 participants