LLVM  4.0.0
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::orc::remote::OrcRemoteTargetClient< ChannelT > Class Template Reference

This class provides utilities (including memory manager, indirect stubs manager, and compile callback manager types) that support remote JITing in ORC. More...

#include <OrcRemoteTargetClient.h>

Inheritance diagram for llvm::orc::remote::OrcRemoteTargetClient< ChannelT >:
[legend]
Collaboration diagram for llvm::orc::remote::OrcRemoteTargetClient< ChannelT >:
[legend]

Classes

class  RCCompileCallbackManager
 Remote compile callback manager. More...
 
class  RCIndirectStubsManager
 Remote indirect stubs manager. More...
 
class  RCMemoryManager
 Remote memory manager. More...
 

Public Member Functions

Expected< int > callIntVoid (JITTargetAddress Addr)
 Call the int(void) function at the given address in the target and return its result. More...
 
Expected< int > callMain (JITTargetAddress Addr, const std::vector< std::string > &Args)
 Call the int(int, char*[]) function at the given address in the target and return its result. More...
 
Error callVoidVoid (JITTargetAddress Addr)
 Call the void() function at the given address in the target and wait for it to finish. More...
 
Error createRemoteMemoryManager (std::unique_ptr< RCMemoryManager > &MM)
 Create an RCMemoryManager which will allocate its memory on the remote target. More...
 
Error createIndirectStubsManager (std::unique_ptr< RCIndirectStubsManager > &I)
 Create an RCIndirectStubsManager that will allocate stubs on the remote target. More...
 
Expected
< RCCompileCallbackManager & > 
enableCompileCallbacks (JITTargetAddress ErrorHandlerAddress)
 
Expected< JITTargetAddressgetSymbolAddress (StringRef Name)
 Search for symbols in the remote process. More...
 
const std::string & getTargetTriple () const
 Get the triple for the remote target. More...
 
Error terminateSession ()
 
- Public Member Functions inherited from llvm::orc::remote::OrcRemoteTargetRPCAPI
 OrcRemoteTargetRPCAPI (rpc::RawByteChannel &C)
 
- Public Member Functions inherited from llvm::orc::rpc::SingleThreadedRPCEndpoint< rpc::RawByteChannel >
 SingleThreadedRPCEndpoint (rpc::RawByteChannel &C, bool LazyAutoNegotiation)
 
void addHandler (HandlerT Handler)
 
void addHandler (ClassT &Object, RetT(ClassT::*Method)(ArgTs...))
 
Error negotiateFunction (bool Retry=false)
 Negotiate a function id for Func with the other end of the channel. More...
 
detail::ResultTraits< AltRetT >
::ErrorReturnType 
callB (const ArgTs &...Args)
 
- Public Member Functions inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
 RPCEndpointBase (rpc::RawByteChannel &C, bool LazyAutoNegotiation)
 Construct an RPC instance on a channel. More...
 
Error appendCallAsync (HandlerT Handler, const ArgTs &...Args)
 Append a call Func, does not call send on the channel. More...
 
Error sendAppendedCalls ()
 
Error callAsync (HandlerT Handler, const ArgTs &...Args)
 
Error handleOne ()
 Handle one incoming call. More...
 
void abandonPendingResponses ()
 Abandon all outstanding result handlers. More...
 

Static Public Member Functions

static Expected
< std::unique_ptr
< OrcRemoteTargetClient > > 
Create (ChannelT &Channel)
 Create an OrcRemoteTargetClient. More...
 
- Static Public Member Functions inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
**static detail::ReadArgs
< ArgTs...> 
readArgs (ArgTs &...Args)
 Helper for handling setter procedures - this method returns a functor that sets the variables referred to by Args... More...
 

Additional Inherited Members

- Protected Types inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
using LaunchPolicy = std::function< Error(std::function< Error()>)>
 
using WrappedHandlerFn = std::function< Error(rpc::RawByteChannel &, uint32_t)>
 
- Protected Member Functions inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
uint32_t getInvalidFunctionId () const
 
void addHandlerImpl (HandlerT Handler, LaunchPolicy Launch)
 Add the given handler to the handler map and make it available for autonegotiation and execution. More...
 
Error handleResponse (uint32_tSeqNo)
 
uint32_t handleNegotiate (const std::string &Name)
 
Expected< uint32_tgetRemoteFunctionId ()
 
WrappedHandlerFn wrapHandler (HandlerT Handler, LaunchPolicy Launch)
 
- Protected Attributes inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
rpc::RawByteChannelC
 
bool LazyAutoNegotiation
 
RPCFunctionIdAllocator< uint32_tFnIdAllocator
 
uint32_t ResponseId
 
std::map< std::string, uint32_tLocalFunctionIds
 
std::map< const char *, uint32_tRemoteFunctionIds
 
std::map< uint32_t,
WrappedHandlerFn
Handlers
 
std::mutex ResponsesMutex
 
detail::SequenceNumberManager
< uint32_t
SequenceNumberMgr
 
std::map< uint32_t,
std::unique_ptr
< detail::ResponseHandler
< rpc::RawByteChannel > > > 
PendingResponses
 

Detailed Description

template<typename ChannelT>
class llvm::orc::remote::OrcRemoteTargetClient< ChannelT >

This class provides utilities (including memory manager, indirect stubs manager, and compile callback manager types) that support remote JITing in ORC.

Each of the utility classes talks to a JIT server (an instance of the OrcRemoteTargetServer class) via an RPC system (see RPCUtils.h) to carry out its actions.

Definition at line 37 of file OrcRemoteTargetClient.h.

Member Function Documentation

template<typename ChannelT >
Expected<int> llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::callIntVoid ( JITTargetAddress  Addr)
inline

Call the int(void) function at the given address in the target and return its result.

Definition at line 555 of file OrcRemoteTargetClient.h.

References llvm::dbgs(), DEBUG, and llvm::format().

template<typename ChannelT >
Expected<int> llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::callMain ( JITTargetAddress  Addr,
const std::vector< std::string > &  Args 
)
inline

Call the int(int, char*[]) function at the given address in the target and return its result.

Definition at line 562 of file OrcRemoteTargetClient.h.

References AMDGPU::RuntimeMD::KeyName::Args, llvm::dbgs(), DEBUG, and llvm::format().

template<typename ChannelT >
Error llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::callVoidVoid ( JITTargetAddress  Addr)
inline

Call the void() function at the given address in the target and wait for it to finish.

Definition at line 571 of file OrcRemoteTargetClient.h.

References llvm::dbgs(), DEBUG, and llvm::format().

template<typename ChannelT >
static Expected<std::unique_ptr<OrcRemoteTargetClient> > llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::Create ( ChannelT &  Channel)
inlinestatic

Create an OrcRemoteTargetClient.

Channel is the ChannelT instance to communicate on. It is assumed that the channel is ready to be read from and written to.

Definition at line 544 of file OrcRemoteTargetClient.h.

References llvm::Error::success().

template<typename ChannelT >
Error llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::createIndirectStubsManager ( std::unique_ptr< RCIndirectStubsManager > &  I)
inline

Create an RCIndirectStubsManager that will allocate stubs on the remote target.

Definition at line 591 of file OrcRemoteTargetClient.h.

References assert(), llvm::orc::remote::OrcRemoteTargetRPCAPI::ResourceIdMgr::getNext(), and llvm::Error::success().

template<typename ChannelT >
Error llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::createRemoteMemoryManager ( std::unique_ptr< RCMemoryManager > &  MM)
inline

Create an RCMemoryManager which will allocate its memory on the remote target.

Definition at line 579 of file OrcRemoteTargetClient.h.

References assert(), llvm::orc::remote::OrcRemoteTargetRPCAPI::ResourceIdMgr::getNext(), and llvm::Error::success().

template<typename ChannelT >
Expected<RCCompileCallbackManager &> llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::enableCompileCallbacks ( JITTargetAddress  ErrorHandlerAddress)
inline

Definition at line 601 of file OrcRemoteTargetClient.h.

template<typename ChannelT >
Expected<JITTargetAddress> llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::getSymbolAddress ( StringRef  Name)
inline

Search for symbols in the remote process.

Note: This should be used by symbol resolvers after they've searched the local symbol table in the JIT stack.

Definition at line 619 of file OrcRemoteTargetClient.h.

template<typename ChannelT >
const std::string& llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::getTargetTriple ( ) const
inline

Get the triple for the remote target.

Definition at line 628 of file OrcRemoteTargetClient.h.

template<typename ChannelT >
Error llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::terminateSession ( )
inline

Definition at line 630 of file OrcRemoteTargetClient.h.


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