Skip to content

Commit d4045a4

Browse files
authored
[mlir][spirv] Add .spv extension to validation files (#153440)
1 parent 3784bfa commit d4045a4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

mlir/include/mlir/Target/SPIRV/Serialization.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ struct SerializationOptions {
3838
/// or an absolute path followed by the prefix. For example:
3939
///
4040
/// * "foo" - Create files with a `foo` prefix in the current working
41-
/// directory. For example: `fooXYZ123`, `fooABC456` ... `fooXXXXXX`.
42-
/// The last 6 characters will be a unique combination as
43-
/// generated by `llvm::sys::fs::createUniqueFile`.
41+
/// directory. For example: `fooXYZ123.spv`, `fooABC456.spv` ...
42+
/// `fooXXXXXX.spv`. The last 6 characters will be a unique combination
43+
/// as generated by `llvm::sys::fs::createUniqueFile`.
4444
///
4545
/// * "my/dir/foo" - Create files in `my/dir` with a `foo` prefix. The
46-
/// `my/dir` need to exists. For example: `fooXYZ123`, `fooABC456` ...
47-
/// `fooXXXXXX` will be created and stored in `/my/dir`. Filenames
48-
/// follow the same pattern as above.
46+
/// `my/dir` need to exists. For example: `fooXYZ123.spv`,
47+
/// `fooABC456.spv` ... `fooXXXXXX.spv` will be created and stored in
48+
/// `/my/dir`. Filenames follow the same pattern as above.
4949
///
5050
/// * "/home/user/my/dir" - Same as above but using an absolute path.
5151
std::string validationFilePrefix = "";

mlir/lib/Target/SPIRV/TranslateRegistration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ serializeModule(spirv::ModuleOp moduleOp, raw_ostream &output,
106106
int fd = 0;
107107

108108
std::error_code errorCode = llvm::sys::fs::createUniqueFile(
109-
options.validationFilePrefix + "%%%%%%", fd, filename);
109+
options.validationFilePrefix + "%%%%%%.spv", fd, filename);
110110
if (errorCode)
111111
return moduleOp.emitError("error creating validation output file: ")
112112
<< errorCode.message() << "\n";

mlir/test/Target/SPIRV/mlir-translate.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: rm -rf %t
66
// RUN: mkdir %t && mlir-translate --serialize-spirv --no-implicit-module \
77
// RUN: --split-input-file --spirv-save-validation-files-with-prefix=%t/foo %s \
8-
// RUN: && ls %t | wc -l | FileCheck %s
8+
// RUN: && ls %t/foo*.spv | wc -l | FileCheck %s
99
// RUN: rm -rf %t
1010

1111
// CHECK: 4

0 commit comments

Comments
 (0)