aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
diff options
context:
space:
mode:
authorian Bearman <ianb@microsoft.com>2024-02-08 07:59:37 -0800
committerGitHub <noreply@github.com>2024-02-08 16:59:37 +0100
commit067d2779fcfc62dd429177f350b8cefe49b65b51 (patch)
treecf9a64fbcef9a8fdde9c298d3957e0078f8e5171 /mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
parentb14731fe93d0db9a59984783051880795ae0992d (diff)
downloadllvm-067d2779fcfc62dd429177f350b8cefe49b65b51.zip
llvm-067d2779fcfc62dd429177f350b8cefe49b65b51.tar.gz
llvm-067d2779fcfc62dd429177f350b8cefe49b65b51.tar.bz2
[MLIR] Setting MemorySpace During Bufferization (#78484)
Collection of changes with the goal of being able to convert `encoding` to `memorySpace` during bufferization - new API for encoder to allow implementation to select destination memory space - update existing bufferization implementations to support the new interface
Diffstat (limited to 'mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp')
-rw-r--r--mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp b/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
index eb4a96f..34a0c59 100644
--- a/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
+++ b/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
@@ -234,8 +234,8 @@ AllocTensorOp::getBufferType(Value value, const BufferizationOptions &options,
if (failed(copyBufferType))
return failure();
memorySpace = copyBufferType->getMemorySpace();
- } else if (options.defaultMemorySpace.has_value()) {
- memorySpace = *options.defaultMemorySpace;
+ } else if (auto ms = options.defaultMemorySpaceFn(getType())) {
+ memorySpace = *ms;
} else {
return getOperation()->emitError("could not infer memory space");
}