Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions mlir/include/mlir/Target/SPIRV/Serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ struct SerializationOptions {
/// or an absolute path followed by the prefix. For example:
///
/// * "foo" - Create files with a `foo` prefix in the current working
/// directory. For example: `fooXYZ123`, `fooABC456` ... `fooXXXXXX`.
/// The last 6 characters will be a unique combination as
/// generated by `llvm::sys::fs::createUniqueFile`.
/// directory. For example: `fooXYZ123.spv`, `fooABC456.spv` ...
/// `fooXXXXXX.spv`. The last 6 characters will be a unique combination
/// as generated by `llvm::sys::fs::createUniqueFile`.
///
/// * "my/dir/foo" - Create files in `my/dir` with a `foo` prefix. The
/// `my/dir` need to exists. For example: `fooXYZ123`, `fooABC456` ...
/// `fooXXXXXX` will be created and stored in `/my/dir`. Filenames
/// follow the same pattern as above.
/// `my/dir` need to exists. For example: `fooXYZ123.spv`,
/// `fooABC456.spv` ... `fooXXXXXX.spv` will be created and stored in
/// `/my/dir`. Filenames follow the same pattern as above.
///
/// * "/home/user/my/dir" - Same as above but using an absolute path.
std::string validationFilePrefix = "";
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Target/SPIRV/TranslateRegistration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ serializeModule(spirv::ModuleOp moduleOp, raw_ostream &output,
int fd = 0;

std::error_code errorCode = llvm::sys::fs::createUniqueFile(
options.validationFilePrefix + "%%%%%%", fd, filename);
options.validationFilePrefix + "%%%%%%.spv", fd, filename);
if (errorCode)
return moduleOp.emitError("error creating validation output file: ")
<< errorCode.message() << "\n";
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Target/SPIRV/mlir-translate.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// RUN: rm -rf %t
// RUN: mkdir %t && mlir-translate --serialize-spirv --no-implicit-module \
// RUN: --split-input-file --spirv-save-validation-files-with-prefix=%t/foo %s \
// RUN: && ls %t | wc -l | FileCheck %s
// RUN: && ls %t/foo*.spv | wc -l | FileCheck %s
// RUN: rm -rf %t

// CHECK: 4
Expand Down
Loading