-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][SPIRV] Add support for dense_resource in arith to spirv #91318
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
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
38 changes: 38 additions & 0 deletions
38
mlir/test/Conversion/ArithToSPIRV/arith-to-spirv-le-specific.mlir
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,38 @@ | ||
// RUN: mlir-opt -split-input-file -convert-arith-to-spirv -verify-diagnostics %s | FileCheck %s | ||
|
||
|
||
//===----------------------------------------------------------------------===// | ||
// arith.constant dense_resource | ||
// | ||
// The decoding of dense_resource differs between little and big endian | ||
// machines. At the moment only litte endian is supported. | ||
// See https://github.com/llvm/llvm-project/issues/63469 for more infos. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// XFAIL: target=s390x-{{.*}} | ||
|
||
module attributes { | ||
spirv.target_env = #spirv.target_env< | ||
#spirv.vce<v1.0, [Int8, Int16, Int64, Float16, Float64], []>, #spirv.resource_limits<>> | ||
} { | ||
func.func @constant_dense_resource() { | ||
// CHECK: %{{.*}} = spirv.Constant dense<[0.203224242, -0.254296064, -0.365104556, -0.469196141, 0.466041982]> : tensor<5xf32> : !spirv.array<5 x f32> | ||
%0 = arith.constant dense_resource<dense_resource_test_5xf32> : tensor<5xf32> | ||
Groverkss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// CHECK: %{{.*}} = spirv.Constant dense<[1, 2]> : vector<2xi32> | ||
%1 = arith.constant dense_resource<dense_resource_test_2xi32> : vector<2xi32> | ||
Groverkss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// CHECK: %{{.*}} = spirv.Constant dense<[0.35476172, 0.351080596, -0.0795008316, 0.366843373]> : tensor<4xf32> : !spirv.array<4 x f32> | ||
%2 = arith.constant dense_resource<dense_resource_test_2x2xf32> : tensor<1x2x2xf32> | ||
return | ||
} | ||
} | ||
// Resources are kept at end of file. New tests should be added above this. | ||
{-# | ||
dialect_resources: { | ||
builtin: { | ||
dense_resource_test_2xi32: "0x400000000100000002000000", | ||
dense_resource_test_5xf32: "0x08000000041A503E183382BEFCEEBABE7A3AF0BE0E9DEE3E", | ||
dense_resource_test_2x2xf32: "0x0800000054A3B53ED6C0B33E55D1A2BDE5D2BB3E" | ||
} | ||
} | ||
#-} |
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.