This repository was archived by the owner on Mar 28, 2023. It is now read-only.
forked from llvm/llvm-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL] Support query of free device memory extension #1162
Merged
Merged
Changes from all commits
Commits
Show all changes
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// REQUIRES: level_zero, level_zero_dev_kit | ||
|
||
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out | ||
// RUN: env ZES_ENABLE_SYSMAN=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER | ||
// | ||
// The test is to check that the free device memory is reported be Level Zero | ||
// backend | ||
// | ||
// CHECK: Free device memory | ||
|
||
#include <iostream> | ||
#include <sycl/sycl.hpp> | ||
using namespace sycl; | ||
|
||
int main() { | ||
|
||
queue Queue; | ||
auto dev = Queue.get_device(); | ||
std::cout << "Device: " << dev.get_info<info::device::name>() << std::endl; | ||
|
||
if (!dev.is_host() && dev.has(aspect::ext_intel_free_memory)) { | ||
auto FreeMemory = dev.get_info<info::device::ext_intel_free_memory>(); | ||
std::cout << "Free device memory: " << FreeMemory << std::endl; | ||
} else { | ||
std::cout | ||
<< "Query ext_intel_device_info_free_memory not supported by the device" | ||
<< std::endl; | ||
} | ||
|
||
return 0; | ||
} |
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.
CHECK will pass only if ext_intel_device_info_free_memory is supported by the device. I think we expect the test to pass even if device doesn't support it. The only option I see is to remove this CHECK, I guess we don't have dynamic checks.
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.
But we expect that ALL Level Zero devices support this extension.
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.
@againull : are you OK with the test? we need this to complete the new feature (the compiler fix was merged)
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.
Yes, I am ok with the test, thanks for clarification.