1#ifndef PROTEUS_FRONTEND_DISPATCHER_CUDA_HPP
2#define PROTEUS_FRONTEND_DISPATCHER_CUDA_HPP
18 std::unique_ptr<MemoryBuffer>
19 compile([[
maybe_unused]] std::unique_ptr<LLVMContext> Ctx,
20 std::unique_ptr<Module> Mod, HashT ModuleHash,
34 llvm::Linker::Flags::LinkOnlyNeeded);
36 std::unique_ptr<MemoryBuffer> ObjectModule =
41 ObjectCache.store(ModuleHash, ObjectModule->getMemBufferRef());
46 std::unique_ptr<CompiledLibrary>
47 lookupCompiledLibrary(HashT ModuleHash)
override {
48 return ObjectCache.lookup(ModuleHash);
64 StringRef getDeviceArch()
const override {
return Jit.getDeviceArch(); }
67 CompiledLibrary &Library)
override {
72 if (
auto KernelFunc = CodeCache.lookup(HashValue))
76 KernelName, Library.ObjectModule->getBufferStart(),
91 "Dispatch CUDA does not support registerDynamicLibrary");
95 CodeCache.printStats();
96 ObjectCache.printStats();
100 JitEngineDeviceCUDA &
Jit;
105 StorageCache ObjectCache{
"DispatcherCUDA"};
void char * KernelName
Definition CompilerInterfaceDevice.cpp:52
auto & Jit
Definition CompilerInterfaceDevice.cpp:56
#define PROTEUS_FATAL_ERROR(x)
Definition Error.h:7
Definition StorageCache.cpp:24
HashT hash(FirstT &&First, RestTs &&...Rest)
Definition Hashing.hpp:126
T getRuntimeConstantValue(void *Arg)
Definition CompilerInterfaceRuntimeConstantInfo.h:114
cudaError_t launchKernelFunction(CUfunction KernelFunc, dim3 GridDim, dim3 BlockDim, void **KernelArgs, uint64_t ShmemSize, CUstream Stream)
Definition CoreDeviceCUDA.hpp:56
CUfunction getKernelFunctionFromImage(StringRef KernelName, const void *Image, bool RelinkGlobalsByCopy, const std::unordered_map< std::string, GlobalVarInfo > &VarNameToGlobalInfo)
Definition CoreDeviceCUDA.hpp:28
Definition Dispatcher.hpp:16
unsigned Z
Definition Dispatcher.hpp:17
unsigned Y
Definition Dispatcher.hpp:17
unsigned X
Definition Dispatcher.hpp:17