mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 17:45:08 +08:00
[cpp worker] support cluster mode (#9977)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user