Skip to content

Commit

Permalink
Ensure that we can test libcu++ against architectures < 70 (#1475)
Browse files Browse the repository at this point in the history
* Ensure that we can test libcu++ against architectures < 70

In our header test suite we compile headers that require a certain architecture only against those architectures that actually satisfy the requirement.

We missed the case when no architecture satisfy the constraints and we should not test that header at all.

Fixes nvbug4541374

* Use `NOT` instead of comparison with empty string
  • Loading branch information
miscco authored Mar 5, 2024
1 parent 4b8fb92 commit a5c4747
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libcudacxx/test/public_headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ function(libcudacxx_add_public_header_test header)
# Ensure that if this is an atomic header, we only include the right architectures
string(REGEX MATCH "atomic|barrier|latch|semaphore|annotated_ptr|pipeline" match "${header}")
if(match)
# Ensure that we only compile the header when we have some architectures enabled
if (NOT architectures_at_least_sm70)
return()
endif()
set_target_properties(headertest_${header_name} PROPERTIES CUDA_ARCHITECTURES "${architectures_at_least_sm70}")
endif()

Expand Down

0 comments on commit a5c4747

Please sign in to comment.