Skip to content

Commit

Permalink
mdspan is currently not supported on MSVC outside of c++20
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Jan 18, 2024
1 parent 40b4a57 commit b5248a6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libcudacxx/test/internal_headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ file(GLOB_RECURSE internal_headers
# headers in `__cuda` are meant to come after the related "cuda" headers so they do not compile on their own
list(FILTER internal_headers EXCLUDE REGEX "__cuda/*")

# mdspan is currently not supported on msvc outside of C++20
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND NOT "${CMAKE_CXX_STANDARD}" MATCHES "20")
list(FILTER internal_headers EXCLUDE REGEX "mdspan")
endif()

function(libcudacxx_create_internal_header_test header_name, headertest_src, fallback)
if(fallback)
set(header_name "${header_name}_fallback")
Expand Down
5 changes: 5 additions & 0 deletions libcudacxx/test/public_headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ if ("${CMAKE_CUDA_COMPILER_VERSION}" MATCHES "11\.*\.*" OR
list(FILTER public_headers EXCLUDE REGEX "annotated_ptr")
endif()

# mdspan is currently not supported on msvc outside of C++20
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND NOT "${CMAKE_CXX_STANDARD}" MATCHES "20")
list(FILTER public_headers EXCLUDE REGEX "mdspan")
endif()

# We need to handle atomic headers differently as they do not compile on architectures below sm70
set(architectures_at_least_sm70)
foreach(item IN LISTS CMAKE_CUDA_ARCHITECTURES)
Expand Down
5 changes: 5 additions & 0 deletions libcudacxx/test/public_headers_host_only/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ file(GLOB public_headers_host_only
"${libcudacxx_SOURCE_DIR}/include/cuda/std/*"
)

# mdspan is currently not supported on msvc outside of C++20
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND NOT "${CMAKE_CXX_STANDARD}" MATCHES "20")
list(FILTER public_headers_host_only EXCLUDE REGEX "mdspan")
endif()

function(libcudacxx_add_std_header_test header)
# ${header} contains the "/" from the subfolder, replace by "_" for actual names
string(REPLACE "/" "_" header_name "${header}")
Expand Down

0 comments on commit b5248a6

Please sign in to comment.