mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
[C++ API][Fix] support ray::Init without RayConfig (#17733)
This commit is contained in:
parent
ab53c5fc93
commit
63f9ba2858
2 changed files with 11 additions and 11 deletions
|
@ -28,9 +28,8 @@ class Counter {
|
|||
RAY_REMOTE(Counter::FactoryCreate, &Counter::Add);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
/// configuration and initialization
|
||||
ray::RayConfig config;
|
||||
ray::Init(config);
|
||||
/// initialization
|
||||
ray::Init();
|
||||
|
||||
/// put and get object
|
||||
auto object = ray::Put(100);
|
||||
|
|
|
@ -19,20 +19,21 @@
|
|||
|
||||
namespace ray {
|
||||
|
||||
void Init(ray::RayConfig &config, int *argc, char ***argv) {
|
||||
void Init(RayConfig &config, int *argc, char ***argv) {
|
||||
ray::internal::ConfigInternal::Instance().Init(config, argc, argv);
|
||||
Init();
|
||||
}
|
||||
|
||||
void Init(ray::RayConfig &config) { Init(config, nullptr, nullptr); }
|
||||
|
||||
void Init() {
|
||||
std::call_once(is_inited_, [] {
|
||||
auto runtime = ray::internal::AbstractRayRuntime::DoInit();
|
||||
ray::internal::RayRuntimeHolder::Instance().Init(runtime);
|
||||
});
|
||||
}
|
||||
|
||||
void Init(RayConfig &config) { Init(config, nullptr, nullptr); }
|
||||
|
||||
void Init() {
|
||||
RayConfig config;
|
||||
Init(config, nullptr, nullptr);
|
||||
}
|
||||
|
||||
void Shutdown() { ray::internal::AbstractRayRuntime::DoShutdown(); }
|
||||
|
||||
} // namespace ray
|
||||
} // namespace ray
|
||||
|
|
Loading…
Add table
Reference in a new issue