[cpp worker] support cluster mode (#9977)

This commit is contained in:
SongGuyang
2020-09-18 11:08:18 +08:00
committed by GitHub
parent 1b295a17cb
commit 5cbc411e38
27 changed files with 488 additions and 260 deletions
+4 -4
View File
@@ -85,7 +85,7 @@ class Ray {
#include "api/generated/create_actors.generated.h"
private:
static RayRuntime *runtime_;
static std::shared_ptr<RayRuntime> runtime_;
static std::once_flag is_inited_;
@@ -203,7 +203,7 @@ inline TaskCaller<ReturnType> Ray::TaskInternal(FuncType &func, ExecFuncType &ex
RemoteFunctionPtrHolder ptr;
ptr.function_pointer = reinterpret_cast<uintptr_t>(func);
ptr.exec_function_pointer = reinterpret_cast<uintptr_t>(exec_func);
return TaskCaller<ReturnType>(runtime_, ptr, buffer);
return TaskCaller<ReturnType>(runtime_.get(), ptr, buffer);
}
template <typename ActorType, typename FuncType, typename ExecFuncType,
@@ -217,7 +217,7 @@ inline ActorCreator<ActorType> Ray::CreateActorInternal(FuncType &create_func,
RemoteFunctionPtrHolder ptr;
ptr.function_pointer = reinterpret_cast<uintptr_t>(create_func);
ptr.exec_function_pointer = reinterpret_cast<uintptr_t>(exec_func);
return ActorCreator<ActorType>(runtime_, ptr, buffer);
return ActorCreator<ActorType>(runtime_.get(), ptr, buffer);
}
template <typename ReturnType, typename ActorType, typename FuncType,
@@ -233,7 +233,7 @@ inline ActorTaskCaller<ReturnType> Ray::CallActorInternal(FuncType &actor_func,
MemberFunctionPtrHolder holder = *(MemberFunctionPtrHolder *)(&actor_func);
ptr.function_pointer = reinterpret_cast<uintptr_t>(holder.value[0]);
ptr.exec_function_pointer = reinterpret_cast<uintptr_t>(exec_func);
return ActorTaskCaller<ReturnType>(runtime_, actor.ID(), ptr, buffer);
return ActorTaskCaller<ReturnType>(runtime_.get(), actor.ID(), ptr, buffer);
}
// TODO(barakmich): These includes are generated files that do not contain their