-
Notifications
You must be signed in to change notification settings - Fork 797
[SYCL][Tests] Add more syclbin-dump tests #19272
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
10 commits
Select commit
Hold shift + click to select a range
09fc987
[SYCL][Tests] Add more syclbin-dump tests
dm-vodopyanov 7bca380
Merge branch 'intel:sycl' into syclbin-dump-tests
dm-vodopyanov e36d77b
Update tests
dm-vodopyanov 7e63495
Add syclbin-dump to install folder
dm-vodopyanov 75eec59
Merge branch 'sycl' into syclbin-dump-tests
dm-vodopyanov de0e9fa
Attempt to make syclbin-dump discoverable
dm-vodopyanov 0c28b44
Move test to sycl/test
dm-vodopyanov b82480e
Add support of syclbin-dump to E2E lit
dm-vodopyanov a012c28
Fix input_files.cpp test
dm-vodopyanov d3cab5a
Disable test on Windows
dm-vodopyanov 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// UNSUPPORTED: windows | ||
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/19373 | ||
|
||
// REQUIRES: ocloc | ||
|
||
// RUN: %clangxx --offload-new-driver -fsyclbin=input -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device bmg-g21" -o %t.input_bmg_g21_gpu_device_arch.syclbin %s | ||
// RUN: %clangxx --offload-new-driver -fsyclbin=input -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device *" -o %t.input_all_gpu_device_archs.syclbin %s | ||
// RUN: %clangxx --offload-new-driver -fsyclbin=object -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device bmg-g21" -o %t.object_bmg_g21_gpu_device_arch.syclbin %s | ||
// RUN: %clangxx --offload-new-driver -fsyclbin=executable -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device bmg-g21" -o %t.executable_bmg_g21_gpu_device_arch.syclbin %s | ||
// RUN: %clangxx --offload-new-driver -fsyclbin -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device bmg-g21" -o %t.default_bmg_g21_gpu_device_arch.syclbin %s | ||
|
||
// RUN: syclbin-dump %t.input_bmg_g21_gpu_device_arch.syclbin | FileCheck %s --check-prefix CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH | ||
// RUN: syclbin-dump %t.input_all_gpu_device_archs.syclbin | FileCheck %s --check-prefix CHECK-INPUT-ALL-GPU-DEVICE-ARCHS | ||
// RUN: syclbin-dump %t.object_bmg_g21_gpu_device_arch.syclbin | FileCheck %s --check-prefix CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH | ||
// RUN: syclbin-dump %t.executable_bmg_g21_gpu_device_arch.syclbin | FileCheck %s --check-prefix CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH | ||
// RUN: syclbin-dump %t.default_bmg_g21_gpu_device_arch.syclbin | FileCheck %s --check-prefix CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH | ||
|
||
// Checks the generated SYCLBIN contents of a simple SYCL free function kernel. | ||
|
||
#include <sycl/sycl.hpp> | ||
|
||
extern "C" { | ||
SYCL_EXT_ONEAPI_FUNCTION_PROPERTY( | ||
(sycl::ext::oneapi::experimental::single_task_kernel)) | ||
void TestKernel(int *Ptr, int Size) { | ||
for (size_t I = 0; I < Size; ++I) | ||
Ptr[I] = I; | ||
} | ||
} | ||
|
||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH: Version: {{[1-9]+}} | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Global metadata: | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: SYCLBIN/global metadata: | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: state: 0 | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Number of Abstract Modules: 1 | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Abstract Module 0: | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Metadata: | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH: Number of IR Modules: 0 | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Number of Native Device Code Images: 1 | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Native device code image 0: | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Metadata: | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: SYCLBIN/native device code image metadata: | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: arch:{{.*}} | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: target:{{.*}}spir64_gen-unknown | ||
// CHECK-INPUT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Raw native device code image bytes: <Binary blob of {{.*}} bytes> | ||
|
||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS: Version: {{[1-9]+}} | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: Global metadata: | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: SYCLBIN/global metadata: | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: state: 0 | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: Number of Abstract Modules: 1 | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: Abstract Module 0: | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: Metadata: | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS: Number of IR Modules: 0 | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: Number of Native Device Code Images: 1 | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: Native device code image 0: | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: Metadata: | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: SYCLBIN/native device code image metadata: | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: arch:{{.*}} | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: target:{{.*}}spir64_gen-unknown | ||
// CHECK-INPUT-ALL-GPU-DEVICE-ARCHS-NEXT: Raw native device code image bytes: <Binary blob of {{.*}} bytes> | ||
|
||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH: Version: {{[1-9]+}} | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Global metadata: | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: SYCLBIN/global metadata: | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: state: 1 | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Number of Abstract Modules: 1 | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Abstract Module 0: | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Metadata: | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH: Number of IR Modules: 0 | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Number of Native Device Code Images: 1 | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Native device code image 0: | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Metadata: | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: SYCLBIN/native device code image metadata: | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: arch:{{.*}} | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: target:{{.*}}spir64_gen-unknown | ||
// CHECK-OBJECT-BMG-G21-GPU-DEVICE-ARCH-NEXT: Raw native device code image bytes: <Binary blob of {{.*}} bytes> | ||
|
||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH: Version: {{[1-9]+}} | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: Global metadata: | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: SYCLBIN/global metadata: | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: state: 2 | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: Number of Abstract Modules: 1 | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: Abstract Module 0: | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: Metadata: | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH: Number of IR Modules: 0 | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: Number of Native Device Code Images: 1 | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: Native device code image 0: | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: Metadata: | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: SYCLBIN/native device code image metadata: | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: arch:{{.*}} | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: target:{{.*}}spir64_gen-unknown | ||
// CHECK-EXECUTABLE-BMG-G21-GPU-DEVICE-ARCH-NEXT: Raw native device code image bytes: <Binary blob of {{.*}} bytes> | ||
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
Binary file not shown.
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,5 @@ | ||
// RUN: not syclbin-dump nonexistent.syclbin 2>&1 | FileCheck %s --check-prefix CHECK-NONEXISTENT-FILE | ||
// RUN: not syclbin-dump %S/Inputs/malformed.syclbin 2>&1 | FileCheck %s --check-prefix CHECK-MALFORMED-FILE | ||
|
||
// CHECK-NONEXISTENT-FILE: Failed to open or read file nonexistent.syclbin | ||
// CHECK-MALFORMED-FILE: Invalid data was encountered while parsing the file |
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 |
---|---|---|
|
@@ -50,19 +50,6 @@ raw_ostream &operator<<(raw_ostream &OS, const ScopedIndent &) { | |
return OS.indent(CurrentIndentationLevel); | ||
} | ||
|
||
std::string_view StateToString(llvm::object::SYCLBIN::BundleState State) { | ||
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. Removed as it was not used and it was affecting the code coverage |
||
switch (State) { | ||
case llvm::object::SYCLBIN::BundleState::Input: | ||
return "input"; | ||
case llvm::object::SYCLBIN::BundleState::Object: | ||
return "object"; | ||
case llvm::object::SYCLBIN::BundleState::Executable: | ||
return "executable"; | ||
default: | ||
return "UNKNOWN"; | ||
} | ||
} | ||
|
||
std::string PropertyValueToString(const llvm::util::PropertyValue &PropVal) { | ||
switch (PropVal.getType()) { | ||
case llvm::util::PropertyValue::UINT32: | ||
|
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.
I think it would be fine to have this in sycl/test instead.
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.
Let's try, should work. Still investigating though why it doesn't work in CI - as it works locally. The binary now in the install folder, but still it didn't fix the issue, probably need to add to some other place in CMake files.
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.
The only reason I see not putting it to sycl/test folder is that the test has a dependency on NEO - especially on
ocloc
binary, and sycl/test tests should be device-agnostic (no backend runtimes should be present in the environment)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.
Hmm, good point. Should it have
//REQUIRES: ocloc
?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.
Maybe we need to do something like in https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/lit.cfg.py#L627?
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.
Thanks! It works now :)