13 #ifndef MLIR_TARGET_LLVM_NVVM_UTILS_H
14 #define MLIR_TARGET_LLVM_NVVM_UTILS_H
57 virtual std::optional<SmallVector<std::unique_ptr<llvm::Module>>>
Utility base class for transforming operations into binary objects, by default it returns the seriali...
Operation & module
Module to transform to a binary object.
Base class for all NVVM serializations from GPU modules into binary strings.
ArrayRef< std::string > getFileList() const
Returns the bitcode files to be loaded.
SerializeGPUModuleBase(Operation &module, NVVMTargetAttr target, const gpu::TargetOptions &targetOptions={})
Initializes the toolkitPath with the path in targetOptions or if empty with the path in getCUDAToolki...
SmallVector< std::string > fileList
List of LLVM bitcode files to link to.
NVVMTargetAttr target
NVVM target attribute.
std::string toolkitPath
CUDA toolkit path.
virtual std::optional< SmallVector< std::unique_ptr< llvm::Module > > > loadBitcodeFiles(llvm::Module &module) override
Loads the bitcode files in fileList.
LogicalResult appendStandardLibs()
Appends nvvm/libdevice.bc into fileList.
static void init()
Initializes the LLVM NVPTX target by safely calling LLVMInitializeNVPTX* methods if available.
StringRef getToolkitPath() const
Returns the CUDA toolkit path.
NVVMTargetAttr getTarget() const
Returns the target attribute.
Operation is the basic unit of execution within MLIR.
This class serves as an opaque interface for passing options to the TargetAttrInterface methods.
StringRef getCUDAToolkitPath()
Searches & returns the path CUDA toolkit path, the search order is:
Include the generated interface declarations.