-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrapping iree_status_t access with macros.
This makes it possible to change the type of iree_status_t with most code not caring about what its bits are. Progress on issue #265. PiperOrigin-RevId: 287847316
- Loading branch information
1 parent
c956c4c
commit 19cdf2d
Showing
123 changed files
with
1,039 additions
and
1,368 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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
8 changes: 4 additions & 4 deletions
8
iree/compiler/Dialect/HAL/Conversion/FlowToHAL/test/structural_ops.mlir
This file contains 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,11 +1,11 @@ | ||
// RUN: iree-opt -split-input-file -iree-convert-flow-to-hal %s | IreeFileCheck %s | ||
|
||
// CHECK-LABEL: func @tensorIO(%arg0: !ireex.ref<!hal.buffer>) -> !ireex.ref<!hal.buffer> | ||
// CHECK-LABEL: func @tensorIO(%arg0: !iree.ref<!hal.buffer>) -> !iree.ref<!hal.buffer> | ||
func @tensorIO(%arg0 : tensor<1x1xi32>) -> tensor<1x1xi32> { | ||
// CHECK-NEXT: br ^bb1(%arg0 : !ireex.ref<!hal.buffer>) | ||
// CHECK-NEXT: br ^bb1(%arg0 : !iree.ref<!hal.buffer>) | ||
br ^bb1(%arg0 : tensor<1x1xi32>) | ||
// CHECK-NEXT: ^bb1([[BB0:%.+]]: !ireex.ref<!hal.buffer>) | ||
// CHECK-NEXT: ^bb1([[BB0:%.+]]: !iree.ref<!hal.buffer>) | ||
^bb1(%0 : tensor<1x1xi32>): | ||
// CHECK-NEXT: return [[BB0]] : !ireex.ref<!hal.buffer> | ||
// CHECK-NEXT: return [[BB0]] : !iree.ref<!hal.buffer> | ||
return %0 : tensor<1x1xi32> | ||
} |
16 changes: 8 additions & 8 deletions
16
iree/compiler/Dialect/HAL/Conversion/FlowToHAL/test/variable_ops.mlir
This file contains 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
32 changes: 16 additions & 16 deletions
32
iree/compiler/Dialect/HAL/Conversion/HALToVM/test/allocator_ops.mlir
This file contains 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,41 +1,41 @@ | ||
// RUN: iree-opt -split-input-file -iree-convert-hal-to-vm %s | IreeFileCheck %s | ||
|
||
// CHECK-LABEL: @allocatorComputeSize | ||
func @allocatorComputeSize(%arg0 : !ireex.ref<!hal.allocator>) -> i32 { | ||
func @allocatorComputeSize(%arg0 : !iree.ref<!hal.allocator>) -> i32 { | ||
%c1024_i32 = constant 1024 : i32 | ||
// CHECK: %0 = vm.call.variadic @hal.allocator.compute_size(%arg0, %c6, %c15, [%c1024, %c1024], %c4) : (!ireex.ref<!hal.allocator>, i32, i32, i32..., i32) -> i32 | ||
// CHECK: %0 = vm.call.variadic @hal.allocator.compute_size(%arg0, %c6, %c15, [%c1024, %c1024], %c4) : (!iree.ref<!hal.allocator>, i32, i32, i32..., i32) -> i32 | ||
%0 = hal.allocator.compute_size %arg0, "HostLocal", "All", shape=[%c1024_i32, %c1024_i32], element_size=4 | ||
return %0 : i32 | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: @allocatorAllocate | ||
func @allocatorAllocate(%arg0 : !ireex.ref<!hal.allocator>) -> !ireex.ref<!hal.buffer> { | ||
func @allocatorAllocate(%arg0 : !iree.ref<!hal.allocator>) -> !iree.ref<!hal.buffer> { | ||
%c1024_i32 = constant 1024 : i32 | ||
// CHECK: %ref = vm.call @hal.allocator.allocate(%arg0, %c6, %c15, %c1024) : (!ireex.ref<!hal.allocator>, i32, i32, i32) -> !ireex.ref<!hal.buffer> | ||
%0 = hal.allocator.allocate %arg0, "HostLocal", "All", %c1024_i32 : !ireex.ref<!hal.buffer> | ||
return %0 : !ireex.ref<!hal.buffer> | ||
// CHECK: %ref = vm.call @hal.allocator.allocate(%arg0, %c6, %c15, %c1024) : (!iree.ref<!hal.allocator>, i32, i32, i32) -> !iree.ref<!hal.buffer> | ||
%0 = hal.allocator.allocate %arg0, "HostLocal", "All", %c1024_i32 : !iree.ref<!hal.buffer> | ||
return %0 : !iree.ref<!hal.buffer> | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK: vm.rodata @allocatorAllocateConst_const_0 dense<123> : tensor<4x4xi32> | ||
// CHECK-LABEL: func @allocatorAllocateConst | ||
func @allocatorAllocateConst() -> !ireex.ref<!hal.buffer> { | ||
%allocator = "test_hal.allocator"() : () -> !ireex.ref<!hal.allocator> | ||
// CHECK: %allocatorAllocateConst_const_0 = vm.const.ref.rodata @allocatorAllocateConst_const_0 : !ireex.byte_buffer_ref | ||
// CHECK: %ref = vm.call.variadic @hal.allocator.allocate.const(%0, %c6, %c2, [%c4, %c4_0], %c4_1, %allocatorAllocateConst_const_0) : (!ireex.ref<!hal.allocator>, i32, i32, i32..., i32, !ireex.byte_buffer_ref) -> !ireex.ref<!hal.buffer> | ||
%buffer = hal.allocator.allocate.const %allocator, "HostVisible|HostCoherent", "Transfer" : !ireex.ref<!hal.buffer> = dense<123> : tensor<4x4xi32> | ||
return %buffer : !ireex.ref<!hal.buffer> | ||
func @allocatorAllocateConst() -> !iree.ref<!hal.buffer> { | ||
%allocator = "test_hal.allocator"() : () -> !iree.ref<!hal.allocator> | ||
// CHECK: %allocatorAllocateConst_const_0 = vm.const.ref.rodata @allocatorAllocateConst_const_0 : !iree.byte_buffer_ref | ||
// CHECK: %ref = vm.call.variadic @hal.allocator.allocate.const(%0, %c6, %c2, [%c4, %c4_0], %c4_1, %allocatorAllocateConst_const_0) : (!iree.ref<!hal.allocator>, i32, i32, i32..., i32, !iree.byte_buffer_ref) -> !iree.ref<!hal.buffer> | ||
%buffer = hal.allocator.allocate.const %allocator, "HostVisible|HostCoherent", "Transfer" : !iree.ref<!hal.buffer> = dense<123> : tensor<4x4xi32> | ||
return %buffer : !iree.ref<!hal.buffer> | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: @allocatorAllocateShaped | ||
func @allocatorAllocateShaped(%arg0 : !ireex.ref<!hal.allocator>) -> !ireex.ref<!hal.buffer> { | ||
func @allocatorAllocateShaped(%arg0 : !iree.ref<!hal.allocator>) -> !iree.ref<!hal.buffer> { | ||
%c1024_i32 = constant 1024 : i32 | ||
// CHECK: %ref = vm.call.variadic @hal.allocator.allocate.shaped(%arg0, %c6, %c15, [%c1024, %c1024], %c4) : (!ireex.ref<!hal.allocator>, i32, i32, i32..., i32) -> !ireex.ref<!hal.buffer> | ||
%0 = hal.allocator.allocate.shaped %arg0, "HostLocal", "All", shape=[%c1024_i32, %c1024_i32], element_size=4 : !ireex.ref<!hal.buffer> | ||
return %0 : !ireex.ref<!hal.buffer> | ||
// CHECK: %ref = vm.call.variadic @hal.allocator.allocate.shaped(%arg0, %c6, %c15, [%c1024, %c1024], %c4) : (!iree.ref<!hal.allocator>, i32, i32, i32..., i32) -> !iree.ref<!hal.buffer> | ||
%0 = hal.allocator.allocate.shaped %arg0, "HostLocal", "All", shape=[%c1024_i32, %c1024_i32], element_size=4 : !iree.ref<!hal.buffer> | ||
return %0 : !iree.ref<!hal.buffer> | ||
} |
Oops, something went wrong.