-
Notifications
You must be signed in to change notification settings - Fork 353
Add a test for <nv/target> to validate old dialect support. #7241
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
afa3219
Add a test for <nv/target> to validate old dialect support.
wmaxey 303c3fd
Check CMAKE_<LANG>_FEATURES for compatible standards
wmaxey b574a71
Merge branch 'main' into enh/nv_target_testing
wmaxey 155aaea
spelling fixup
wmaxey d31d3b6
Check host compiler compatibility for CUDA as well
wmaxey b375963
Merge branch 'main' into enh/nv_target_testing
wmaxey 3b0dafe
Merge remote-tracking branch 'origin/main' into enh/nv_target_testing
wmaxey 0aad4d2
Rename target for nvtarget test
wmaxey ebccff7
[pre-commit.ci] auto code formatting
pre-commit-ci[bot] b46f4a1
Merge branch 'main' into enh/nv_target_testing
wmaxey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,41 @@ | ||||||||
| # This unit just checks that nv/target can be used with the specified dialects. | ||||||||
|
|
||||||||
| set( | ||||||||
| nvtarget_dialects | ||||||||
| 11 | ||||||||
| 14 | ||||||||
| 17 | ||||||||
| 20 | ||||||||
| ) | ||||||||
|
|
||||||||
| set_directory_properties( | ||||||||
| PROPERTIES | ||||||||
| INCLUDE_DIRECTORIES "${libcudacxx_SOURCE_DIR}/include" | ||||||||
| ) | ||||||||
|
|
||||||||
| add_custom_target(libcudacxx.test.nvtarget) | ||||||||
|
|
||||||||
| foreach(dialect ${nvtarget_dialects}) | ||||||||
| if ("cxx_std_${dialect}" IN_LIST CMAKE_CXX_COMPILE_FEATURES) | ||||||||
| add_library("nvtarget_cpp${dialect}" OBJECT nvtargettest.cpp) | ||||||||
wmaxey marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
| # This is required to override CMAKE_CXX_STANDARD - target_compile_features is insufficient. | ||||||||
| set_target_properties( | ||||||||
| "nvtarget_cpp${dialect}" PROPERTIES | ||||||||
| CXX_STANDARD "${dialect}" | ||||||||
| CXX_STANDARD_REQUIRED ON | ||||||||
| ) | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| add_dependencies(libcudacxx.test.nvtarget "nvtarget_cpp${dialect}") | ||||||||
| endif() | ||||||||
|
|
||||||||
| if ("cuda_std_${dialect}" IN_LIST CMAKE_CUDA_COMPILE_FEATURES AND "cxx_std_${dialect}" IN_LIST CMAKE_CXX_COMPILE_FEATURES) | ||||||||
| add_library("nvtarget_cuda${dialect}" OBJECT nvtargettest.cu) | ||||||||
| # This is required to override CMAKE_CXX_STANDARD - target_compile_features is insufficient. | ||||||||
| set_target_properties( | ||||||||
| "nvtarget_cuda${dialect}" PROPERTIES | ||||||||
| CUDA_STANDARD "${dialect}" | ||||||||
| CUDA_STANDARD_REQUIRED ON | ||||||||
| ) | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| add_dependencies(libcudacxx.test.nvtarget "nvtarget_cuda${dialect}") | ||||||||
| endif() | ||||||||
|
|
||||||||
| endforeach() | ||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #include <nv/target> | ||
|
|
||
| int main() | ||
| { | ||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #include <nv/target> | ||
|
|
||
| int main() | ||
| { | ||
| return 0; | ||
| } | ||
wmaxey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up that this API is a bit of a footgun and will clobber any existing directories rather than append. Prefer
set_property(DIRECTORY APPEND PROPERTY ...)orinclude_directories(...).For consistency with the rest of CCCL, can we move this to a target property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was kind of hoping for the clobbering behavior.