MLIR
20.0.0git
|
This class serves as an opaque interface for passing options to the TargetAttrInterface
methods.
More...
#include "mlir/Dialect/GPU/IR/CompilationInterfaces.h"
Public Member Functions | |
TargetOptions (StringRef toolkitPath={}, ArrayRef< std::string > linkFiles={}, StringRef cmdOptions={}, CompilationTarget compilationTarget=getDefaultCompilationTarget(), function_ref< SymbolTable *()> getSymbolTableCallback={}) | |
Constructor initializing the toolkit path, the list of files to link to, extra command line options, the compilation target and a callback for obtaining the parent symbol table. More... | |
TypeID | getTypeID () const |
Returns the typeID. More... | |
StringRef | getToolkitPath () const |
Returns the toolkit path. More... | |
ArrayRef< std::string > | getLinkFiles () const |
Returns the files to link to. More... | |
StringRef | getCmdOptions () const |
Returns the command line options. More... | |
std::pair< llvm::BumpPtrAllocator, SmallVector< const char * > > | tokenizeCmdOptions () const |
Returns a tokenization of the command line options. More... | |
CompilationTarget | getCompilationTarget () const |
Returns the compilation target. More... | |
SymbolTable * | getSymbolTable () const |
Returns the result of the getSymbolTableCallback callback or a nullptr if no callback was provided. More... | |
Static Public Member Functions | |
static CompilationTarget | getDefaultCompilationTarget () |
Returns the default compilation target: CompilationTarget::Fatbin . More... | |
Protected Member Functions | |
TargetOptions (TypeID typeID, StringRef toolkitPath={}, ArrayRef< std::string > linkFiles={}, StringRef cmdOptions={}, CompilationTarget compilationTarget=getDefaultCompilationTarget(), function_ref< SymbolTable *()> getSymbolTableCallback={}) | |
Derived classes must use this constructor to initialize typeID to the appropiate value: ie. More... | |
Protected Attributes | |
std::string | toolkitPath |
Path to the target toolkit. More... | |
SmallVector< std::string > | linkFiles |
List of files to link with the LLVM module. More... | |
std::string | cmdOptions |
An optional set of command line options to be used by the compilation process. More... | |
CompilationTarget | compilationTarget |
Compilation process target format. More... | |
function_ref< SymbolTable *()> | getSymbolTableCallback |
Callback for obtaining the parent symbol table of all the GPU modules being serialized. More... | |
This class serves as an opaque interface for passing options to the TargetAttrInterface
methods.
Users of this class must implement the classof
method as well as using the macros MLIR_*_EXPLICIT_TYPE_ID
to ensure type safeness. Targets are free to ignore these options.
Definition at line 45 of file CompilationInterfaces.h.
TargetOptions::TargetOptions | ( | StringRef | toolkitPath = {} , |
ArrayRef< std::string > | linkFiles = {} , |
||
StringRef | cmdOptions = {} , |
||
CompilationTarget | compilationTarget = getDefaultCompilationTarget() , |
||
function_ref< SymbolTable *()> | getSymbolTableCallback = {} |
||
) |
Constructor initializing the toolkit path, the list of files to link to, extra command line options, the compilation target and a callback for obtaining the parent symbol table.
The default compilation target is Fatbin
.
Definition at line 2303 of file GPUDialect.cpp.
|
protected |
Derived classes must use this constructor to initialize typeID
to the appropiate value: ie.
TargetOptions(TypeID::get<DerivedClass>())
.
Definition at line 2310 of file GPUDialect.cpp.
StringRef TargetOptions::getCmdOptions | ( | ) | const |
Returns the command line options.
Definition at line 2324 of file GPUDialect.cpp.
CompilationTarget TargetOptions::getCompilationTarget | ( | ) | const |
Returns the compilation target.
Definition at line 2330 of file GPUDialect.cpp.
Referenced by mlir::ROCDL::SerializeGPUModuleBase::moduleToObjectImpl().
|
static |
Returns the default compilation target: CompilationTarget::Fatbin
.
Definition at line 2334 of file GPUDialect.cpp.
ArrayRef< std::string > TargetOptions::getLinkFiles | ( | ) | const |
Returns the files to link to.
Definition at line 2322 of file GPUDialect.cpp.
SymbolTable * TargetOptions::getSymbolTable | ( | ) | const |
Returns the result of the getSymbolTableCallback
callback or a nullptr if no callback was provided.
Note: The callback itself can return nullptr. It is up to the target how to react to getting a nullptr, e.g., emitting an error or constructing the table.
Definition at line 2326 of file GPUDialect.cpp.
StringRef TargetOptions::getToolkitPath | ( | ) | const |
Returns the toolkit path.
Definition at line 2320 of file GPUDialect.cpp.
TypeID TargetOptions::getTypeID | ( | ) | const |
Returns the typeID.
Definition at line 2318 of file GPUDialect.cpp.
std::pair< llvm::BumpPtrAllocator, SmallVector< const char * > > TargetOptions::tokenizeCmdOptions | ( | ) | const |
Returns a tokenization of the command line options.
Definition at line 2339 of file GPUDialect.cpp.
|
protected |
An optional set of command line options to be used by the compilation process.
Definition at line 103 of file CompilationInterfaces.h.
|
protected |
Compilation process target format.
Definition at line 106 of file CompilationInterfaces.h.
|
protected |
Callback for obtaining the parent symbol table of all the GPU modules being serialized.
Definition at line 110 of file CompilationInterfaces.h.
|
protected |
List of files to link with the LLVM module.
Definition at line 99 of file CompilationInterfaces.h.
|
protected |
Path to the target toolkit.
Definition at line 96 of file CompilationInterfaces.h.