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

Method Init

tensorflow/stream_executor/gpu/gpu_timer.cc:26–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace gpu {
25
26bool GpuTimer::Init() {
27 CHECK(start_event_ == nullptr && stop_event_ == nullptr);
28 GpuContext* context = parent_->gpu_context();
29 port::Status status = GpuDriver::InitEvent(context, &start_event_,
30 GpuDriver::EventFlags::kDefault);
31 if (!status.ok()) {
32 LOG(ERROR) << status;
33 return false;
34 }
35
36 status = GpuDriver::InitEvent(context, &stop_event_,
37 GpuDriver::EventFlags::kDefault);
38 if (!status.ok()) {
39 LOG(ERROR) << status;
40 status = GpuDriver::DestroyEvent(context, &start_event_);
41 if (!status.ok()) {
42 LOG(ERROR) << status;
43 }
44 return false;
45 }
46
47 CHECK(start_event_ != nullptr && stop_event_ != nullptr);
48 return true;
49}
50
51void GpuTimer::Destroy() {
52 GpuContext* context = parent_->gpu_context();

Callers

nothing calls this directly

Calls 2

gpu_contextMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected