Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
proteus::JitEngineDevice< ImplT > Class Template Reference

#include <JitEngineDevice.hpp>

Inheritance diagram for proteus::JitEngineDevice< ImplT >:
Inheritance graph
[legend]
Collaboration diagram for proteus::JitEngineDevice< ImplT >:
Collaboration graph
[legend]

Public Types

using DeviceError_t = typename DeviceTraits< ImplT >::DeviceError_t
 
using DeviceStream_t = typename DeviceTraits< ImplT >::DeviceStream_t
 
using KernelFunction_t = typename DeviceTraits< ImplT >::KernelFunction_t
 

Public Member Functions

DeviceError_t compileAndRun (JITKernelInfo &KernelInfo, dim3 GridDim, dim3 BlockDim, void **KernelArgs, uint64_t ShmemSize, typename DeviceTraits< ImplT >::DeviceStream_t Stream)
 
Module & getModule (JITKernelInfo &KernelInfo)
 
void getLambdaJitValues (JITKernelInfo &KernelInfo, SmallVector< RuntimeConstant > &LambdaJitValuesVec)
 
void insertRegisterVar (const char *VarName, const void *Addr)
 
void registerLinkedBinary (FatbinWrapperT *FatbinWrapper, const char *ModuleId)
 
void registerFatBinary (void *Handle, FatbinWrapperT *FatbinWrapper, const char *ModuleId)
 
void registerFatBinaryEnd ()
 
void registerFunction (void *Handle, void *Kernel, char *KernelName, int32_t *RCIndices, int32_t *RCTypes, int32_t NumRCs)
 
bool containsJITKernelInfo (const void *Func)
 
std::optional< std::reference_wrapper< JITKernelInfo > > getJITKernelInfo (const void *Func)
 
HashT getStaticHash (JITKernelInfo &KernelInfo)
 
void finalize ()
 
- Public Member Functions inherited from proteus::JitEngine
void optimizeIR (Module &M, StringRef Arch, char OptLevel='3', unsigned CodegenOptLevel=3)
 
bool isProteusDisabled ()
 
void enable ()
 
void disable ()
 

Public Attributes

void * CurHandle = nullptr
 
std::unordered_map< std::string, FatbinWrapperT * > ModuleIdToFatBinary
 
std::unordered_map< const void *, BinaryInfoHandleToBinaryInfo
 
SmallVector< std::string > GlobalLinkedModuleIds
 
SmallPtrSet< void *, 8 > GlobalLinkedBinaries
 
- Public Attributes inherited from proteus::JitEngine
InitLLVMTargets Init
 

Protected Member Functions

 JitEngineDevice ()
 
 ~JitEngineDevice ()
 
std::unique_ptr< Module > linkJitModule (SmallVector< std::unique_ptr< Module > > &LinkedModules, std::unique_ptr< Module > LTOModule=nullptr)
 
LLVMContext & getLLVMContext ()
 
- Protected Member Functions inherited from proteus::JitEngine
void getRuntimeConstantValues (void **KernelArgs, const ArrayRef< int32_t > RCIndices, const ArrayRef< int32_t > RCTypes, SmallVector< RuntimeConstant > &RCVec)
 
void runCleanupPassPipeline (Module &M)
 
 JitEngine ()
 
std::string mangleSuffix (HashT &HashValue)
 

Protected Attributes

JitCache< KernelFunction_tCodeCache
 
JitStorageCache< KernelFunction_tStorageCache
 
std::string DeviceArch
 
std::unordered_map< std::string, const void * > VarNameToDevPtr
 
DenseMap< const void *, JITKernelInfoJITKernelInfoMap
 
- Protected Attributes inherited from proteus::JitEngine
struct { 
 
   bool   PROTEUS_USE_STORED_CACHE 
 
   bool   PROTEUS_SET_LAUNCH_BOUNDS 
 
   bool   PROTEUS_SPECIALIZE_ARGS 
 
   bool   PROTEUS_SPECIALIZE_DIMS 
 
   bool   PROTEUS_USE_HIP_RTC_CODEGEN 
 
   bool   PROTEUS_DISABLE 
 
   bool   PROTEUS_DUMP_LLVM_IR 
 
   bool   PROTEUS_RELINK_GLOBALS_BY_COPY 
 
   bool   PROTEUS_ASYNC_COMPILATION 
 
   int   PROTEUS_ASYNC_THREADS 
 
   bool   PROTEUS_ASYNC_TEST_BLOCKING 
 
   bool   PROTEUS_USE_LIGHTWEIGHT_KERNEL_CLONE 
 
Config 
 

Member Typedef Documentation

◆ DeviceError_t

template<typename ImplT >
using proteus::JitEngineDevice< ImplT >::DeviceError_t = typename DeviceTraits<ImplT>::DeviceError_t

◆ DeviceStream_t

template<typename ImplT >
using proteus::JitEngineDevice< ImplT >::DeviceStream_t = typename DeviceTraits<ImplT>::DeviceStream_t

◆ KernelFunction_t

template<typename ImplT >
using proteus::JitEngineDevice< ImplT >::KernelFunction_t = typename DeviceTraits<ImplT>::KernelFunction_t

Constructor & Destructor Documentation

◆ JitEngineDevice()

template<typename ImplT >
proteus::JitEngineDevice< ImplT >::JitEngineDevice ( )
inlineprotected

◆ ~JitEngineDevice()

template<typename ImplT >
proteus::JitEngineDevice< ImplT >::~JitEngineDevice ( )
inlineprotected

Member Function Documentation

◆ compileAndRun()

template<typename ImplT >
DeviceTraits< ImplT >::DeviceError_t proteus::JitEngineDevice< ImplT >::compileAndRun ( JITKernelInfo KernelInfo,
dim3  GridDim,
dim3  BlockDim,
void **  KernelArgs,
uint64_t  ShmemSize,
typename DeviceTraits< ImplT >::DeviceStream_t  Stream 
)

◆ containsJITKernelInfo()

template<typename ImplT >
bool proteus::JitEngineDevice< ImplT >::containsJITKernelInfo ( const void *  Func)
inline

◆ finalize()

template<typename ImplT >
void proteus::JitEngineDevice< ImplT >::finalize ( )
inline

◆ getJITKernelInfo()

template<typename ImplT >
std::optional< std::reference_wrapper< JITKernelInfo > > proteus::JitEngineDevice< ImplT >::getJITKernelInfo ( const void *  Func)
inline

◆ getLambdaJitValues()

template<typename ImplT >
void proteus::JitEngineDevice< ImplT >::getLambdaJitValues ( JITKernelInfo KernelInfo,
SmallVector< RuntimeConstant > &  LambdaJitValuesVec 
)
inline

◆ getLLVMContext()

template<typename ImplT >
LLVMContext & proteus::JitEngineDevice< ImplT >::getLLVMContext ( )
inlineprotected

◆ getModule()

template<typename ImplT >
Module & proteus::JitEngineDevice< ImplT >::getModule ( JITKernelInfo KernelInfo)
inline

◆ getStaticHash()

template<typename ImplT >
HashT proteus::JitEngineDevice< ImplT >::getStaticHash ( JITKernelInfo KernelInfo)
inline

◆ insertRegisterVar()

template<typename ImplT >
void proteus::JitEngineDevice< ImplT >::insertRegisterVar ( const char *  VarName,
const void *  Addr 
)
inline

◆ linkJitModule()

template<typename ImplT >
std::unique_ptr< Module > proteus::JitEngineDevice< ImplT >::linkJitModule ( SmallVector< std::unique_ptr< Module > > &  LinkedModules,
std::unique_ptr< Module >  LTOModule = nullptr 
)
protected

◆ registerFatBinary()

template<typename ImplT >
void proteus::JitEngineDevice< ImplT >::registerFatBinary ( void *  Handle,
FatbinWrapperT FatbinWrapper,
const char *  ModuleId 
)

◆ registerFatBinaryEnd()

template<typename ImplT >
void proteus::JitEngineDevice< ImplT >::registerFatBinaryEnd ( )

◆ registerFunction()

template<typename ImplT >
void proteus::JitEngineDevice< ImplT >::registerFunction ( void *  Handle,
void *  Kernel,
char *  KernelName,
int32_t *  RCIndices,
int32_t *  RCTypes,
int32_t  NumRCs 
)

◆ registerLinkedBinary()

template<typename ImplT >
void proteus::JitEngineDevice< ImplT >::registerLinkedBinary ( FatbinWrapperT FatbinWrapper,
const char *  ModuleId 
)

Member Data Documentation

◆ CodeCache

template<typename ImplT >
JitCache<KernelFunction_t> proteus::JitEngineDevice< ImplT >::CodeCache
protected

◆ CurHandle

template<typename ImplT >
void* proteus::JitEngineDevice< ImplT >::CurHandle = nullptr

◆ DeviceArch

template<typename ImplT >
std::string proteus::JitEngineDevice< ImplT >::DeviceArch
protected

◆ GlobalLinkedBinaries

template<typename ImplT >
SmallPtrSet<void *, 8> proteus::JitEngineDevice< ImplT >::GlobalLinkedBinaries

◆ GlobalLinkedModuleIds

template<typename ImplT >
SmallVector<std::string> proteus::JitEngineDevice< ImplT >::GlobalLinkedModuleIds

◆ HandleToBinaryInfo

template<typename ImplT >
std::unordered_map<const void *, BinaryInfo> proteus::JitEngineDevice< ImplT >::HandleToBinaryInfo

◆ JITKernelInfoMap

template<typename ImplT >
DenseMap<const void *, JITKernelInfo> proteus::JitEngineDevice< ImplT >::JITKernelInfoMap
protected

◆ ModuleIdToFatBinary

template<typename ImplT >
std::unordered_map<std::string, FatbinWrapperT *> proteus::JitEngineDevice< ImplT >::ModuleIdToFatBinary

◆ StorageCache

template<typename ImplT >
JitStorageCache<KernelFunction_t> proteus::JitEngineDevice< ImplT >::StorageCache
protected

◆ VarNameToDevPtr

template<typename ImplT >
std::unordered_map<std::string, const void *> proteus::JitEngineDevice< ImplT >::VarNameToDevPtr
protected

The documentation for this class was generated from the following file: