Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
DispatcherHost.hpp
Go to the documentation of this file.
1#ifndef PROTEUS_FRONTEND_DISPATCHER_HOST_HPP
2#define PROTEUS_FRONTEND_DISPATCHER_HOST_HPP
3
6
7namespace proteus {
8
9class DispatcherHost : public Dispatcher {
10public:
12 static DispatcherHost D;
13 return D;
14 }
15
16 void compile(std::unique_ptr<Module> M) override {
17 Jit.compileOnly(std::move(M));
18 }
19
20 DispatchResult launch(StringRef, LaunchDims, LaunchDims, ArrayRef<void *>,
21 uint64_t, void *) override {
22 PROTEUS_FATAL_ERROR("Host does not support launch");
23 }
24
25protected:
26 void *getFunctionAddress(StringRef FnName) override {
27 return Jit.getFunctionAddress(FnName);
28 }
29
30private:
31 JitEngineHost &Jit;
33};
34
35} // namespace proteus
36
37#endif // PROTEUS_FRONTEND_DISPATCHER_HOST_HPP
auto & Jit
Definition CompilerInterfaceDevice.cpp:54
#define PROTEUS_FATAL_ERROR(x)
Definition Error.h:4
Definition DispatcherHost.hpp:9
static DispatcherHost & instance()
Definition DispatcherHost.hpp:11
void * getFunctionAddress(StringRef FnName) override
Definition DispatcherHost.hpp:26
void compile(std::unique_ptr< Module > M) override
Definition DispatcherHost.hpp:16
DispatchResult launch(StringRef, LaunchDims, LaunchDims, ArrayRef< void * >, uint64_t, void *) override
Definition DispatcherHost.hpp:20
Definition Dispatcher.hpp:45
Definition JitEngineHost.hpp:28
void * getFunctionAddress(StringRef FnName)
Definition JitEngineHost.cpp:366
void compileOnly(std::unique_ptr< Module > M)
Definition JitEngineHost.cpp:360
Definition Dispatcher.cpp:14
Definition Dispatcher.hpp:14
Definition Dispatcher.hpp:23