Skip to content

Commit 9273fac

Browse files
ziereiskeshavvinayak01
authored andcommitted
[HAL] Add hal.allocator.resolve_memory_properties (iree-org#21115)
Progress towards: iree-org#20856 Adds a new operation `hal.allocator.resolve_memory_properties` and a pass that tries to resolve it using the topology attribute. The same pass should aim to do the same thing for the `hal.allocator.select` op in a follow up. --------- Signed-off-by: default <[email protected]> Signed-off-by: Thomas Ziereis <[email protected]> Signed-off-by: keshavvinayak01 <[email protected]>
1 parent ef0d6dd commit 9273fac

File tree

23 files changed

+665
-163
lines changed

23 files changed

+665
-163
lines changed

compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.cpp

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66

77
#include "iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.h"
8-
98
#include "iree/compiler/Dialect/HAL/Analysis/Captures.h"
109
#include "iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Utils.h"
1110
#include "iree/compiler/Dialect/HAL/IR/HALDialect.h"
@@ -99,26 +98,23 @@ struct ResourceAllocOpPattern
9998
auto bufferType = rewriter.getType<IREE::HAL::BufferType>();
10099
auto resourceType =
101100
cast<IREE::Stream::ResourceType>(allocOp.getResult().getType());
102-
auto memoryTypes = IREE::HAL::MemoryTypeBitfield::None;
103-
auto bufferUsage = IREE::HAL::BufferUsageBitfield::None;
104-
if (failed(deriveAllowedResourceBufferBits(allocOp.getLoc(), resourceType,
105-
memoryTypes, bufferUsage))) {
106-
return failure();
107-
}
108101

109-
Value memoryTypeOp =
110-
rewriter.create<IREE::HAL::MemoryTypeOp>(allocOp.getLoc(), memoryTypes);
111-
Value bufferUsageOp = rewriter.create<IREE::HAL::BufferUsageOp>(
112-
allocOp.getLoc(), bufferUsage);
102+
auto resolveOp =
103+
rewriter.create<IREE::HAL::AllocatorResolveMemoryPropertiesOp>(
104+
allocOp.getLoc(), rewriter.getI32Type(), rewriter.getI32Type(),
105+
allocOp.getAffinity().value_or(nullptr),
106+
static_cast<IREE::HAL::Lifetime>(resourceType.getLifetime()));
113107

114108
// Lookup the appropriate allocator/queue for allocation based on the buffer
115109
// propreties.
116110
auto [allocator, queueAffinity] = lookupAllocatorAndQueueAffinityFor(
117-
allocOp, memoryTypeOp, bufferUsageOp, rewriter);
111+
allocOp, resolveOp.getMemoryTypes(), resolveOp.getBufferUsage(),
112+
rewriter);
118113

119114
rewriter.replaceOpWithNewOp<IREE::HAL::AllocatorAllocateOp>(
120-
allocOp, bufferType, allocator, queueAffinity, memoryTypeOp,
121-
bufferUsageOp, adaptor.getStorageSize());
115+
allocOp, bufferType, allocator, queueAffinity,
116+
resolveOp.getMemoryTypes(), resolveOp.getBufferUsage(),
117+
adaptor.getStorageSize());
122118
return success();
123119
}
124120
};
@@ -134,22 +130,19 @@ struct ResourceAllocaOpPattern
134130
// Derive buffer propreties from the resource type.
135131
auto resourceType =
136132
cast<IREE::Stream::ResourceType>(allocaOp.getResult().getType());
137-
auto memoryTypes = IREE::HAL::MemoryTypeBitfield::None;
138-
auto bufferUsage = IREE::HAL::BufferUsageBitfield::None;
139-
if (failed(deriveAllowedResourceBufferBits(loc, resourceType, memoryTypes,
140-
bufferUsage))) {
141-
return failure();
142-
}
143133
auto bufferType = rewriter.getType<IREE::HAL::BufferType>();
144-
Value memoryTypeOp =
145-
rewriter.create<IREE::HAL::MemoryTypeOp>(loc, memoryTypes);
146-
Value bufferUsageOp =
147-
rewriter.create<IREE::HAL::BufferUsageOp>(loc, bufferUsage);
148134

149135
// Lookup the appropriate device/queue for allocation based on the buffer
150136
// propreties.
151-
auto [device, queueAffinity] = lookupDeviceAndQueueAffinityFor(
152-
allocaOp, memoryTypeOp, bufferUsageOp, rewriter);
137+
auto resolveOp =
138+
rewriter.create<IREE::HAL::AllocatorResolveMemoryPropertiesOp>(
139+
loc, rewriter.getI32Type(), rewriter.getI32Type(),
140+
allocaOp.getAffinity().value_or(nullptr),
141+
static_cast<IREE::HAL::Lifetime>(resourceType.getLifetime()));
142+
143+
auto [device, queueAffinity] =
144+
lookupDeviceAndQueueAffinityFor(allocaOp, resolveOp.getMemoryTypes(),
145+
resolveOp.getBufferUsage(), rewriter);
153146

154147
// Behavior flags.
155148
IREE::HAL::AllocaFlagBitfield flags = IREE::HAL::AllocaFlagBitfield::None;
@@ -167,7 +160,8 @@ struct ResourceAllocaOpPattern
167160
auto pool = rewriter.create<arith::ConstantIntOp>(loc, 0, 64);
168161
auto allocateOp = rewriter.create<IREE::HAL::DeviceQueueAllocaOp>(
169162
loc, bufferType, device, queueAffinity, waitFence, signalFence, pool,
170-
memoryTypeOp, bufferUsageOp, adaptor.getStorageSize(), flags);
163+
resolveOp.getMemoryTypes(), resolveOp.getBufferUsage(),
164+
adaptor.getStorageSize(), flags);
171165

172166
rewriter.replaceOp(allocaOp, {allocateOp.getResult(), signalFence});
173167
return success();
@@ -188,28 +182,24 @@ struct ResourceDeallocaOpPattern
188182
// prefer-origin mode.
189183
auto resourceType =
190184
cast<IREE::Stream::ResourceType>(deallocaOp.getOperand().getType());
191-
auto memoryTypes = IREE::HAL::MemoryTypeBitfield::None;
192-
auto bufferUsage = IREE::HAL::BufferUsageBitfield::None;
193-
bool preferOrigin = deallocaOp.getPreferOrigin();
194-
if (failed(deriveAllowedResourceBufferBits(loc, resourceType, memoryTypes,
195-
bufferUsage))) {
196-
preferOrigin = true;
197-
}
198185

199-
Value memoryTypeOp =
200-
rewriter.create<IREE::HAL::MemoryTypeOp>(loc, memoryTypes);
201-
Value bufferUsageOp =
202-
rewriter.create<IREE::HAL::BufferUsageOp>(loc, bufferUsage);
186+
auto resolveOp =
187+
rewriter.create<IREE::HAL::AllocatorResolveMemoryPropertiesOp>(
188+
loc, rewriter.getI32Type(), rewriter.getI32Type(),
189+
deallocaOp.getAffinity().value_or(nullptr),
190+
static_cast<IREE::HAL::Lifetime>(resourceType.getLifetime()));
203191

204-
auto [device, queueAffinity] = lookupDeviceAndQueueAffinityFor(
205-
deallocaOp, memoryTypeOp, bufferUsageOp, rewriter);
192+
auto [device, queueAffinity] =
193+
lookupDeviceAndQueueAffinityFor(deallocaOp, resolveOp.getMemoryTypes(),
194+
resolveOp.getBufferUsage(), rewriter);
206195

207196
// Gather wait/signal fence, which are optional.
208197
Value waitFence =
209198
getOrCreateWaitFence(loc, adaptor.getAwaitTimepoint(), rewriter);
210199
Value signalFence = getOrCreateSignalFence(
211200
loc, device, deallocaOp.getResultTimepoint(), rewriter);
212201

202+
bool preferOrigin = deallocaOp.getPreferOrigin();
213203
// Route to the origin of the allocation (if available).
214204
IREE::HAL::DeallocaFlagBitfield flags =
215205
IREE::HAL::DeallocaFlagBitfield::None;
@@ -467,8 +457,9 @@ buildStorageAssertions(Location loc, Value buffer, StringAttr message,
467457
OpBuilder &builder) {
468458
auto memoryTypes = IREE::HAL::MemoryTypeBitfield::None;
469459
auto bufferUsage = IREE::HAL::BufferUsageBitfield::None;
470-
if (failed(deriveRequiredResourceBufferBits(loc, resourceType, memoryTypes,
471-
bufferUsage))) {
460+
if (failed(deriveRequiredResourceBufferBits(
461+
loc, static_cast<IREE::HAL::Lifetime>(resourceType.getLifetime()),
462+
memoryTypes, bufferUsage))) {
472463
return failure();
473464
}
474465

compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Utils.cpp

Lines changed: 10 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,9 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66

77
#include "iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Utils.h"
8-
98
#include "iree/compiler/Dialect/HAL/Analysis/Captures.h"
9+
#include "iree/compiler/Dialect/HAL/IR/HALOps.h"
1010
#include "iree/compiler/Dialect/Util/IR/UtilOps.h"
11-
#include "llvm/Support/CommandLine.h"
12-
#include "mlir/Dialect/Arith/IR/Arith.h"
13-
#include "mlir/Dialect/SCF/IR/SCF.h"
14-
15-
static llvm::cl::opt<bool> clExternalResourcesMappable(
16-
"iree-stream-external-resources-mappable",
17-
llvm::cl::desc("Allocates external resources as host-visible and mappable. "
18-
"This can degrade performance and introduce allocation "
19-
"overhead and staging buffers for readback on the host "
20-
"should be managed by the calling application instead."),
21-
llvm::cl::init(false));
2211

2312
namespace mlir::iree_compiler {
2413

@@ -199,36 +188,34 @@ IREE::HAL::CommandCategoryBitfield deriveCommandCategories(Region &region) {
199188
}
200189

201190
LogicalResult
202-
deriveRequiredResourceBufferBits(Location loc,
203-
IREE::Stream::ResourceType resourceType,
191+
deriveRequiredResourceBufferBits(Location loc, IREE::HAL::Lifetime lifetime,
204192
IREE::HAL::MemoryTypeBitfield &memoryTypes,
205193
IREE::HAL::BufferUsageBitfield &bufferUsage) {
206194
memoryTypes = IREE::HAL::MemoryTypeBitfield::None;
207195
bufferUsage = IREE::HAL::BufferUsageBitfield::None;
208-
switch (resourceType.getLifetime()) {
196+
switch (lifetime) {
209197
default:
210-
return mlir::emitError(loc)
211-
<< "unsupported resource lifetime: "
212-
<< IREE::Stream::stringifyLifetime(resourceType.getLifetime());
213-
case IREE::Stream::Lifetime::Constant:
198+
return mlir::emitError(loc) << "unsupported resource lifetime: "
199+
<< IREE::HAL::stringifyLifetime(lifetime);
200+
case IREE::HAL::Lifetime::Constant:
214201
// Device local; copies required to get into external resources.
215202
memoryTypes = memoryTypes | IREE::HAL::MemoryTypeBitfield::DeviceLocal;
216203
bufferUsage =
217204
bufferUsage | IREE::HAL::BufferUsageBitfield::SharingImmutable;
218205
break;
219-
case IREE::Stream::Lifetime::Variable:
206+
case IREE::HAL::Lifetime::Variable:
220207
// Device local; copies required to get into external resources.
221208
memoryTypes = memoryTypes | IREE::HAL::MemoryTypeBitfield::DeviceLocal;
222209
break;
223-
case IREE::Stream::Lifetime::External:
210+
case IREE::HAL::Lifetime::External:
224211
// We only require device-visible for external buffers (as we don't today
225212
// do anything else with them on the host). They may be mappable for user
226213
// convenience. Ideally they would have been placed in device-local memory
227214
// but so long as they are device visible the program will execute
228215
// correctly.
229216
memoryTypes = memoryTypes | IREE::HAL::MemoryTypeBitfield::DeviceVisible;
230217
break;
231-
case IREE::Stream::Lifetime::Staging:
218+
case IREE::HAL::Lifetime::Staging:
232219
// Host local; copies required to get into device resources.
233220
// We could vary this based on staging usage (upload/download) by
234221
// making it device-local|host-visible, but host-local means we have
@@ -238,7 +225,7 @@ deriveRequiredResourceBufferBits(Location loc,
238225
bufferUsage = bufferUsage | IREE::HAL::BufferUsageBitfield::Transfer |
239226
IREE::HAL::BufferUsageBitfield::Mapping;
240227
break;
241-
case IREE::Stream::Lifetime::Transient:
228+
case IREE::HAL::Lifetime::Transient:
242229
// Device local; copies required to get into external resources.
243230
memoryTypes = memoryTypes | IREE::HAL::MemoryTypeBitfield::DeviceLocal;
244231
break;
@@ -251,41 +238,6 @@ deriveRequiredResourceBufferBits(Location loc,
251238
return success();
252239
}
253240

254-
LogicalResult
255-
deriveAllowedResourceBufferBits(Location loc,
256-
IREE::Stream::ResourceType resourceType,
257-
IREE::HAL::MemoryTypeBitfield &memoryTypes,
258-
IREE::HAL::BufferUsageBitfield &bufferUsage) {
259-
memoryTypes = IREE::HAL::MemoryTypeBitfield::None;
260-
bufferUsage = IREE::HAL::BufferUsageBitfield::None;
261-
if (failed(deriveRequiredResourceBufferBits(loc, resourceType, memoryTypes,
262-
bufferUsage))) {
263-
return failure();
264-
}
265-
switch (resourceType.getLifetime()) {
266-
default:
267-
break;
268-
case IREE::Stream::Lifetime::External:
269-
if (clExternalResourcesMappable) {
270-
// #yolo; these come from/go to outside the program.
271-
// Today we assume they are device-local|host-visible just for
272-
// practical purposes but that does not have to be true. We really
273-
// want this to be something we analyze and handle on the edges
274-
// (transferring devices/etc if needed).
275-
memoryTypes = memoryTypes | IREE::HAL::MemoryTypeBitfield::DeviceLocal |
276-
IREE::HAL::MemoryTypeBitfield::HostVisible;
277-
// NOTE: we may not map it but users may after they get them back.
278-
// Another reason we should annotate this - having a buffer be
279-
// mappable is potentially expensive (may get a 2nd copy in memory!).
280-
bufferUsage = bufferUsage | IREE::HAL::BufferUsageBitfield::Mapping;
281-
} else {
282-
memoryTypes = memoryTypes | IREE::HAL::MemoryTypeBitfield::DeviceLocal;
283-
}
284-
break;
285-
}
286-
return success();
287-
}
288-
289241
BindingTable::BindingTable(IREE::Stream::CmdExecuteOp executeOp,
290242
ValueRange bufferValues, ValueRange bufferSizes,
291243
IndexSet &indexSet) {

compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Utils.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
#ifndef IREE_COMPILER_DIALECT_HAL_CONVERSION_STREAMTOHAL_UTILS_H_
88
#define IREE_COMPILER_DIALECT_HAL_CONVERSION_STREAMTOHAL_UTILS_H_
99

10-
#include "iree/compiler/Dialect/HAL/IR/HALOps.h"
1110
#include "iree/compiler/Dialect/HAL/IR/HALTypes.h"
1211
#include "iree/compiler/Dialect/Stream/IR/StreamOps.h"
13-
#include "iree/compiler/Dialect/Stream/IR/StreamTypes.h"
1412
#include "mlir/IR/Builders.h"
1513
#include "mlir/IR/Operation.h"
1614
#include "mlir/IR/PatternMatch.h"
@@ -61,22 +59,10 @@ IREE::HAL::CommandCategoryBitfield deriveCommandCategories(Region &region);
6159
// The bits set here are those that must be set for the buffer to be used as the
6260
// buffer within the program with its defined resource lifetime.
6361
LogicalResult
64-
deriveRequiredResourceBufferBits(Location loc,
65-
IREE::Stream::ResourceType resourceType,
62+
deriveRequiredResourceBufferBits(Location loc, IREE::HAL::Lifetime lifetime,
6663
IREE::HAL::MemoryTypeBitfield &memoryTypes,
6764
IREE::HAL::BufferUsageBitfield &bufferUsage);
6865

69-
// Maps a resource type to the corresponding HAL memory types and buffer usage.
70-
// This will fail if the resource type is not directly mappable to HAL bits.
71-
// The bits set here represent the superset of required and allowed bits and
72-
// are useful for providing buffers back to users via the ABI that may need to
73-
// be used for more than just what the internal program requires.
74-
LogicalResult
75-
deriveAllowedResourceBufferBits(Location loc,
76-
IREE::Stream::ResourceType resourceType,
77-
IREE::HAL::MemoryTypeBitfield &memoryTypes,
78-
IREE::HAL::BufferUsageBitfield &bufferUsage);
79-
8066
class BindingTable {
8167
public:
8268
BindingTable() = default;

compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/test/resource_ops.mlir

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ util.global private @device : !hal.device
44

55
// CHECK-LABEL: @resourceAlloc
66
util.func public @resourceAlloc(%arg0: index) -> !stream.resource<transient> {
7-
// CHECK: %[[MEMORY_TYPE:.+]] = hal.memory_type<"DeviceVisible|DeviceLocal"> : i32
8-
// CHECK: %[[BUFFER_USAGE:.+]] = hal.buffer_usage<"{{.+}}Transfer{{.+}}Dispatch{{.+}}"> : i32
7+
// CHECK: %[[MEMORY_TYPES:.+]], %[[BUFFER_USAGE:.+]] = hal.allocator.resolve_memory_properties
8+
// CHECK-SAME: for(#hal.device.affinity<@device>)
9+
// CHECK-SAME: lifetime(transient) : i32, i32
910
// CHECK: %[[RET0:.+]] = hal.allocator.allocate
10-
// CHECK-SAME: type(%[[MEMORY_TYPE]])
11+
// CHECK-SAME: type(%[[MEMORY_TYPES]])
1112
// CHECK-SAME: usage(%[[BUFFER_USAGE]])
1213
// CHECK-SAME: : !hal.buffer{%arg0}
1314
%0 = stream.resource.alloc uninitialized on(#hal.device.affinity<@device>) : !stream.resource<transient>{%arg0}
@@ -22,16 +23,17 @@ util.global private @device : !hal.device
2223
// CHECK-LABEL: @resourceAlloca
2324
// CHECK-SAME: (%[[SIZE:.+]]: index)
2425
util.func public @resourceAlloca(%size: index) -> (!stream.resource<transient>, !stream.timepoint) {
25-
// CHECK: %[[MEMORY_TYPE:.+]] = hal.memory_type<"DeviceVisible|DeviceLocal"> : i32
26-
// CHECK: %[[BUFFER_USAGE:.+]] = hal.buffer_usage<"{{.+}}Transfer{{.+}}DispatchStorage"> : i32
26+
// CHECK: %[[MEMORY_TYPES:.+]], %[[BUFFER_USAGE:.+]] = hal.allocator.resolve_memory_properties
27+
// CHECK-SAME: for(#hal.device.affinity<@device>)
28+
// CHECK-SAME: lifetime(transient) : i32, i32
2729
// CHECK: %[[WAIT_FENCE:.+]] = util.null : !hal.fence
2830
// CHECK: %[[SIGNAL_FENCE:.+]] = hal.fence.create
2931
// CHECK: %[[RET0:.+]] = hal.device.queue.alloca
3032
// CHECK-SAME: affinity(%c-1
3133
// CHECK-SAME: wait(%[[WAIT_FENCE]])
3234
// CHECK-SAME: signal(%[[SIGNAL_FENCE]])
3335
// CHECK-SAME: pool(%c0
34-
// CHECK-SAME: type(%[[MEMORY_TYPE]])
36+
// CHECK-SAME: type(%[[MEMORY_TYPES]])
3537
// CHECK-SAME: usage(%[[BUFFER_USAGE]])
3638
// CHECK-SAME: flags("None")
3739
// CHECK-SAME: : !hal.buffer{%[[SIZE]]}
@@ -47,15 +49,16 @@ util.global private @device : !hal.device
4749
// CHECK-LABEL: @resourceAllocaAwait
4850
// CHECK-SAME: (%[[SIZE:.+]]: index, %[[WAIT_FENCE:.+]]: !hal.fence)
4951
util.func public @resourceAllocaAwait(%size: index, %await_timepoint: !stream.timepoint) -> (!stream.resource<transient>, !stream.timepoint) {
50-
// CHECK: %[[MEMORY_TYPE:.+]] = hal.memory_type<"DeviceVisible|DeviceLocal"> : i32
51-
// CHECK: %[[BUFFER_USAGE:.+]] = hal.buffer_usage<"{{.+}}Transfer{{.+}}DispatchStorage"> : i32
52+
// CHECK: %[[MEMORY_TYPES:.+]], %[[BUFFER_USAGE:.+]] = hal.allocator.resolve_memory_properties
53+
// CHECK-SAME: for(#hal.device.affinity<@device>)
54+
// CHECK-SAME: lifetime(transient) : i32, i32
5255
// CHECK: %[[SIGNAL_FENCE:.+]] = hal.fence.create
5356
// CHECK: %[[RET0:.+]] = hal.device.queue.alloca
5457
// CHECK-SAME: affinity(%c-1
5558
// CHECK-SAME: wait(%[[WAIT_FENCE]])
5659
// CHECK-SAME: signal(%[[SIGNAL_FENCE]])
5760
// CHECK-SAME: pool(%c0
58-
// CHECK-SAME: type(%[[MEMORY_TYPE]])
61+
// CHECK-SAME: type(%[[MEMORY_TYPES]])
5962
// CHECK-SAME: usage(%[[BUFFER_USAGE]])
6063
// CHECK-SAME: flags("None")
6164
// CHECK-SAME: : !hal.buffer{%[[SIZE]]}
@@ -72,16 +75,15 @@ util.global private @device_b : !hal.device
7275
// CHECK-LABEL: @resourceAllocaOptimal
7376
// CHECK-SAME: (%[[SIZE:.+]]: index)
7477
util.func public @resourceAllocaOptimal(%size: index) -> (!stream.resource<transient>, !stream.timepoint) {
75-
// CHECK: %[[MEMORY_TYPE:.+]] = hal.memory_type<"DeviceVisible|DeviceLocal"> : i32
76-
// CHECK: %[[BUFFER_USAGE:.+]] = hal.buffer_usage<"{{.+}}Transfer{{.+}}DispatchStorage"> : i32
78+
// CHECK: %[[MEMORY_TYPES:.+]], %[[BUFFER_USAGE:.+]] = hal.allocator.resolve_memory_properties
7779
// CHECK: %[[DEVICE_A:.+]] = util.global.load immutable @device_a : !hal.device
7880
// CHECK: %[[AFFINITY_A:.+]] = arith.constant -1 : i64
7981
// CHECK: %[[DEVICE_B:.+]] = util.global.load immutable @device_b : !hal.device
8082
// CHECK: %[[AFFINITY_B:.+]] = arith.constant -1 : i64
8183
// CHECK: %[[DEVICE:.+]], %[[QUEUE_AFFINITY:.+]] = hal.allocator.select from([
8284
// CHECK: (%[[DEVICE_A]], %[[AFFINITY_A]] : !hal.device, i64),
8385
// CHECK: (%[[DEVICE_B]], %[[AFFINITY_B]] : !hal.device, i64)
84-
// CHECK: ]) type(%[[MEMORY_TYPE]]) usage(%[[BUFFER_USAGE]]) : !hal.device, i64
86+
// CHECK: ]) type(%[[MEMORY_TYPES]]) usage(%[[BUFFER_USAGE]]) : !hal.device, i64
8587
// CHECK: %[[WAIT_FENCE:.+]] = util.null : !hal.fence
8688
// CHECK: %[[SIGNAL_FENCE:.+]] = hal.fence.create device(%[[DEVICE]] : !hal.device)
8789
// CHECK: %[[POOL:.+]] = arith.constant 0 : i64
@@ -91,7 +93,7 @@ util.func public @resourceAllocaOptimal(%size: index) -> (!stream.resource<trans
9193
// CHECK-SAME: wait(%[[WAIT_FENCE]])
9294
// CHECK-SAME: signal(%[[SIGNAL_FENCE]])
9395
// CHECK-SAME: pool(%[[POOL]])
94-
// CHECK-SAME: type(%[[MEMORY_TYPE]])
96+
// CHECK-SAME: type(%[[MEMORY_TYPES]])
9597
// CHECK-SAME: usage(%[[BUFFER_USAGE]])
9698
// CHECK-SAME: flags("None")
9799
// CHECK-SAME: : !hal.buffer{%[[SIZE]]}

0 commit comments

Comments
 (0)