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

Method Acquire

tensorflow/lite/delegates/gpu/cl/gl_interop.cc:124–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122AcquiredGlObjects::~AcquiredGlObjects() { Release({}, nullptr).IgnoreError(); }
123
124Status AcquiredGlObjects::Acquire(const std::vector<cl_mem>& memory,
125 cl_command_queue queue,
126 const std::vector<cl_event>& wait_events,
127 CLEvent* acquire_event,
128 AcquiredGlObjects* objects) {
129 if (!memory.empty()) {
130 cl_event new_event;
131 cl_int error_code = clEnqueueAcquireGLObjects(
132 queue, memory.size(), memory.data(), wait_events.size(),
133 wait_events.data(), acquire_event ? &new_event : nullptr);
134 if (error_code != CL_SUCCESS) {
135 return InternalError(absl::StrCat("Unable to acquire GL object. ",
136 CLErrorCodeToString(error_code)));
137 }
138 if (acquire_event) {
139 *acquire_event = CLEvent(new_event);
140 }
141 clFlush(queue);
142 }
143 *objects = AcquiredGlObjects(memory, queue);
144 return OkStatus();
145}
146
147Status AcquiredGlObjects::Release(const std::vector<cl_event>& wait_events,
148 CLEvent* release_event) {

Callers

nothing calls this directly

Calls 9

CLErrorCodeToStringFunction · 0.85
CLEventClass · 0.85
AcquiredGlObjectsClass · 0.85
OkStatusFunction · 0.85
InternalErrorFunction · 0.50
StrCatFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected