File tree 2 files changed +18
-0
lines changed
include/mlir/Dialect/GPU/IR
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ class TargetOptions {
79
79
std::pair<llvm::BumpPtrAllocator, SmallVector<const char *>>
80
80
tokenizeCmdOptions () const ;
81
81
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
+
82
88
// / Returns the compilation target.
83
89
CompilationTarget getCompilationTarget () const ;
84
90
Original file line number Diff line number Diff line change @@ -2591,6 +2591,18 @@ TargetOptions::tokenizeCmdOptions() const {
2591
2591
return tokenizeCmdOptions (cmdOptions);
2592
2592
}
2593
2593
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
+
2594
2606
MLIR_DEFINE_EXPLICIT_TYPE_ID (::mlir::gpu::TargetOptions)
2595
2607
2596
2608
#include " mlir/Dialect/GPU/IR/GPUOpInterfaces.cpp.inc"
You can’t perform that action at this time.
0 commit comments