File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
include/mlir/Dialect/GPU/IR Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ class TargetOptions {
7979 std::pair<llvm::BumpPtrAllocator, SmallVector<const char *>>
8080 tokenizeCmdOptions () const ;
8181
82+ // / Returns a tokenization of the substr of the command line options that
83+ // / starts with `startsWith` and ends with end of the command line options and
84+ // / consumes it.
85+ std::pair<llvm::BumpPtrAllocator, SmallVector<const char *>>
86+ tokenizeAndRemoveSuffixCmdOptions (llvm::StringRef startsWith);
87+
8288 // / Returns the compilation target.
8389 CompilationTarget getCompilationTarget () const ;
8490
Original file line number Diff line number Diff line change @@ -2591,6 +2591,18 @@ TargetOptions::tokenizeCmdOptions() const {
25912591 return tokenizeCmdOptions (cmdOptions);
25922592}
25932593
2594+ std::pair<llvm::BumpPtrAllocator, SmallVector<const char *>>
2595+ TargetOptions::tokenizeAndRemoveSuffixCmdOptions (llvm::StringRef startsWith) {
2596+ size_t startPos = cmdOptions.find (startsWith);
2597+ if (startPos == std::string::npos)
2598+ return {llvm::BumpPtrAllocator (), SmallVector<const char *>()};
2599+
2600+ auto tokenized =
2601+ tokenizeCmdOptions (cmdOptions.substr (startPos + startsWith.size ()));
2602+ cmdOptions.resize (startPos);
2603+ return tokenized;
2604+ }
2605+
25942606MLIR_DEFINE_EXPLICIT_TYPE_ID (::mlir::gpu::TargetOptions)
25952607
25962608#include " mlir/Dialect/GPU/IR/GPUOpInterfaces.cpp.inc"
You can’t perform that action at this time.
0 commit comments