-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Offload] Add check-offload-unit for liboffload unittests #137312
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 all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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,22 @@ | ||
# -*- Python -*- | ||
|
||
# Configuration file for the 'lit' test runner. | ||
|
||
import os | ||
import subprocess | ||
|
||
import lit.formats | ||
|
||
# name: The name of this test suite. | ||
config.name = "Offload-Unit" | ||
|
||
# suffixes: A list of file extensions to treat as test files. | ||
config.suffixes = [] | ||
|
||
# test_source_root: The root path where tests are located. | ||
# test_exec_root: The root path where tests should be run. | ||
config.test_exec_root = os.path.join(config.library_dir, "unittests") | ||
config.test_source_root = config.test_exec_root | ||
|
||
# testFormat: The test format to use to interpret tests. | ||
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, ".unittests") |
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,8 @@ | ||
@AUTO_GEN_COMMENT@ | ||
|
||
config.library_dir = "@LIBOMPTARGET_LIBRARY_DIR@" | ||
config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") | ||
|
||
# Let the main config do the real work. | ||
lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/unit/lit.cfg.py") | ||
|
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
add_custom_target(LibomptUnitTests) | ||
set_target_properties(LibomptUnitTests PROPERTIES FOLDER "Tests/UnitTests") | ||
add_custom_target(OffloadUnitTests) | ||
set_target_properties(OffloadUnitTests PROPERTIES FOLDER "Tests/UnitTests") | ||
|
||
function(add_libompt_unittest test_dirname) | ||
add_unittest(LibomptUnitTests ${test_dirname} ${ARGN}) | ||
function(add_offload_unittest test_dirname) | ||
add_unittest(OffloadUnitTests ${test_dirname} ${ARGN}) | ||
endfunction() | ||
|
||
# add_subdirectory(Plugins) | ||
add_subdirectory(OffloadAPI) |
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
Shouldn't we just be able to loop over all the discovered platforms? Most of this stuff is intended to be generic after all.
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.
It's definitely possible, it would require all tests being parameterized on the device, which wouldn't be a massive change.
One reason I added the explicit option was to avoid it auto selecting the host plugin, which is basically unsupported at this point. But I could make sure that the test environment filters it out of the device list, or even just filter it out at the liboffload implementation level since it's not really usable for anything just now.
Another reason was to allow the
check-offload-unit
tests to be broken down into a test suite config for each available platform (check-offload-unit-cuda
etc), in the same waycheck-offload
/check-libomptarget
has sub-targets for every configuration. I feel like it's a little bit easier to parse what's actually being tested rather than one test suite that runs on a variable number of configurations.I don't have strong feelings about it though so I'm happy to make the change if you want.
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.
Lol, forgot about the host plugin and I doubt anyone cares about it. Honestly, the
liboffload
API probably shouldn't even present it to the user until someone cares enough to update it.