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,
35 std::unique_ptr<MemoryBuffer> ObjectModule =
40 StorageCache.store(ModuleHash, ObjectModule->getMemBufferRef());
45 std::unique_ptr<CompiledLibrary>
46 lookupCompiledLibrary(HashT ModuleHash)
override {
47 return StorageCache.lookup(ModuleHash);
63 StringRef getDeviceArch()
const override {
return Jit.getDeviceArch(); }
66 CompiledLibrary &Library)
override {
71 if (
auto KernelFunc = CodeCache.lookup(HashValue))
75 KernelName, Library.ObjectModule->getBufferStart(),
90 "Dispatch CUDA does not support registerDynamicLibrary");
94 CodeCache.printStats();
95 StorageCache.printStats();
99 JitEngineDeviceCUDA &
Jit;
104 JitStorageCache StorageCache;
void char * KernelName
Definition CompilerInterfaceDevice.cpp:50
auto & Jit
Definition CompilerInterfaceDevice.cpp:54
#define PROTEUS_FATAL_ERROR(x)
Definition Error.h:7
Definition BuiltinsCUDA.cpp:4
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:51
CUfunction getKernelFunctionFromImage(StringRef KernelName, const void *Image, bool RelinkGlobalsByCopy, const std::unordered_map< std::string, const void * > &VarNameToDevPtr)
Definition CoreDeviceCUDA.hpp:27
Definition Dispatcher.hpp:16
unsigned Z
Definition Dispatcher.hpp:17
unsigned Y
Definition Dispatcher.hpp:17
unsigned X
Definition Dispatcher.hpp:17