MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Init

Method Init

tensorflow/stream_executor/cuda/cuda_rng.cc:73–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73bool GpuRng::Init() {
74 absl::MutexLock lock(&mu_);
75 CHECK(rng_ == nullptr);
76
77 cuda::ScopedActivateExecutorContext sac(parent_);
78 curandStatus_t ret = curandCreateGenerator(&rng_, CURAND_RNG_PSEUDO_DEFAULT);
79 if (ret != CURAND_STATUS_SUCCESS) {
80 LOG(ERROR) << "failed to create random number generator: " << ret;
81 return false;
82 }
83
84 CHECK(rng_ != nullptr);
85 return true;
86}
87
88bool GpuRng::SetStream(Stream* stream) {
89 cuda::ScopedActivateExecutorContext sac(parent_);

Callers 1

initialize_curandFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected