MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / MakeCUDAGenerator

Function MakeCUDAGenerator

oneflow/core/framework/random_generator.cpp:177–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177Maybe<Generator> MakeCUDAGenerator(int device_index) {
178 static auto device_mgr =
179 Singleton<ep::DeviceManagerRegistry>::Get()->GetDeviceManager(DeviceType::kCUDA);
180 if (device_index == -1) { device_index = GlobalProcessCtx::LocalRank(); }
181 return std::make_shared<Generator>(
182 device_mgr->CreateRandomGenerator(default_rng_seed_val, device_index));
183}
184
185Maybe<void> ManualSeedAllCudaGenerator(uint64_t seed) {
186#ifdef WITH_CUDA

Callers

nothing calls this directly

Calls 3

GetFunction · 0.85
GetDeviceManagerMethod · 0.45
CreateRandomGeneratorMethod · 0.45

Tested by

no test coverage detected