-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL][E2E] Add granularity test for sycl_ext_oneapi_virtual_mem extension
#15848
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
steffenlarsen
merged 15 commits into
intel:sycl
from
dyniols:memory_granularity_and_physical_granularity_checks
Oct 28, 2024
Merged
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a506752
added tests checking memory granularity for virtual memory extension
dyniols e9a131d
fix
dyniols 2cb74a1
formatting fixed
dyniols ecfbac8
added description for test
dyniols 662f8e5
formatting fix
dyniols 6975924
removed unnecessary headers
dyniols 27e66fa
new line
dyniols 0ff5854
Update sycl/test-e2e/VirtualMem/memory_granularity.cpp
dyniols 1649631
Update sycl/test-e2e/VirtualMem/memory_granularity.cpp
dyniols c6f0f37
adjusted according to suggestions
dyniols 7b0529d
formatting fixed
dyniols 7f087ea
added lit.local.cfg
dyniols 91ca5cd
added newline
dyniols bb1f4c2
removed unnecessary import
dyniols 5396f1b
fix
dyniols 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Tests are sharing same required aspect | ||
| config.required_features += ['aspect-ext_oneapi_virtual_mem'] |
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,48 @@ | ||
| // This test checks whether memory granularity returned is greater than 0 and | ||
| // that the recommended granularity is the same size or greater than the minimum | ||
| // granularity for virtual memory extension. | ||
|
|
||
| // RUN: %{build} -o %t.out | ||
| // RUN: %{run} %t.out | ||
|
|
||
| #include <sycl/detail/core.hpp> | ||
|
|
||
| #include <sycl/ext/oneapi/virtual_mem/virtual_mem.hpp> | ||
|
|
||
| #include <assert.h> | ||
|
|
||
| namespace syclext = sycl::ext::oneapi::experimental; | ||
|
|
||
| int main() { | ||
| sycl::queue Q; | ||
| sycl::context Context = Q.get_context(); | ||
| sycl::device Device = Q.get_device(); | ||
|
|
||
| size_t DevRecommended = syclext::get_mem_granularity( | ||
| Device, Context, syclext::granularity_mode::recommended); | ||
| size_t ContextRecommended = syclext::get_mem_granularity( | ||
| Context, syclext::granularity_mode::recommended); | ||
| size_t DevMinimum = syclext::get_mem_granularity( | ||
| Device, Context, syclext::granularity_mode::minimum); | ||
| size_t ContextMinimum = | ||
| syclext::get_mem_granularity(Context, syclext::granularity_mode::minimum); | ||
|
|
||
| assert(DevRecommended > 0 && | ||
| "recommended granularity for device should be greater than 0"); | ||
| assert(ContextRecommended > 0 && | ||
| "recommended granularity for context should be greater than 0"); | ||
|
|
||
| assert(DevMinimum > 0 && | ||
| "minimum granularity for device should be greater than 0"); | ||
| assert(ContextMinimum > 0 && | ||
| "minimum granularity for context should be greater than 0"); | ||
|
|
||
| assert(DevRecommended >= DevMinimum && | ||
| "recommended granularity size must be at least minimum granularity " | ||
| "for device"); | ||
| assert(ContextRecommended >= ContextMinimum && | ||
| "recommended granularity size must be at least minimum granularity " | ||
| "for context"); | ||
|
|
||
| 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
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.
Uh oh!
There was an error while loading. Please reload this page.