Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
JitEngineDeviceCUDA.hpp
Go to the documentation of this file.
1//===-- JitEngineDeviceCUDA.hpp -- JIT Engine Device for CUDA header --===//
2//
3// Part of the Proteus Project, under the Apache License v2.0 with LLVM
4// Exceptions. See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef PROTEUS_JITENGINEDEVICECUDA_HPP
12#define PROTEUS_JITENGINEDEVICECUDA_HPP
13
15#include "proteus/Utils.h"
16#include <llvm/ADT/DenseMap.h>
17#include <llvm/ADT/SmallVector.h>
18#include <memory>
19
20namespace proteus {
21
22using namespace llvm;
23
30
31class JitEngineDeviceCUDA : public JitEngineDevice<JitEngineDeviceCUDA> {
32public:
34
36 int BlockSize);
37
38 void extractModules(BinaryInfo &BinInfo);
39
40 std::unique_ptr<Module> tryExtractKernelModule(BinaryInfo &BinInfo,
42 LLVMContext &Ctx);
43
46
48
49 std::unique_ptr<MemoryBuffer> compileOnly(Module &M,
50 bool DisableIROpt = false);
51
52private:
56
57 void extractLinkedBitcode(LLVMContext &Ctx, CUmodule &CUMod,
58 SmallVector<std::unique_ptr<Module>> &LinkedModules,
59 std::string &ModuleId);
60};
61
62} // namespace proteus
63
64#endif
void const char * ModuleId
Definition CompilerInterfaceDevice.cpp:33
void char * KernelName
Definition CompilerInterfaceDevice.cpp:52
Definition JitEngineDevice.hpp:79
Definition Hashing.hpp:20
Definition JitEngineDeviceCUDA.hpp:31
static JitEngineDeviceCUDA & instance()
Definition JitEngineDeviceCUDA.cpp:23
void setLaunchBoundsForKernel(Module &M, Function &F, size_t GridSize, int BlockSize)
void extractModules(BinaryInfo &BinInfo)
Definition JitEngineDeviceCUDA.cpp:110
std::unique_ptr< MemoryBuffer > compileOnly(Module &M, bool DisableIROpt=false)
Definition JitEngineDeviceCUDA.cpp:164
void codegenPTX(Module &M, StringRef DeviceArch, SmallVectorImpl< char > &PTXStr)
HashT getModuleHash(BinaryInfo &BinInfo)
Definition JitEngineDeviceCUDA.cpp:65
std::unique_ptr< Module > tryExtractKernelModule(BinaryInfo &BinInfo, StringRef KernelName, LLVMContext &Ctx)
Definition JitEngineDeviceCUDA.cpp:102
Definition JitEngineDevice.hpp:282
std::string DeviceArch
Definition JitEngineDevice.hpp:524
Definition Helpers.h:138
Definition StorageCache.cpp:24
T getRuntimeConstantValue(void *Arg)
Definition CompilerInterfaceRuntimeConstantInfo.h:114
CUfunction KernelFunction_t
Definition JitEngineDeviceCUDA.hpp:28
CUstream DeviceStream_t
Definition JitEngineDeviceCUDA.hpp:27
cudaError_t DeviceError_t
Definition JitEngineDeviceCUDA.hpp:26
Definition JitEngineDevice.hpp:280