MCPcopy Create free account
hub / github.com/ROCm/clr / append

Method append

rocclr/platform/commandqueue.cpp:317–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void HostQueue::append(Command& command) {
318 // We retain the command here. It will be released when its status
319 // changes to CL_COMPLETE
320 if ((command.getWaitBits() & 0x1) != 0) {
321 finish();
322 }
323 command.retain();
324 command.setStatus(CL_QUEUED);
325 queue_.enqueue(&command);
326 if (!IS_HIP) {
327 return;
328 }
329
330 // Set last submitted command
331 Command* prevLastEnqueueCommand = nullptr;
332
333 // Attach only real commands and skip internal notifications for CPU queue
334 if (command.waitingEvent() == nullptr) {
335 command.retain();
336
337 // lastCmdLock_ ensures that lastEnqueueCommand() can retain the command before it is swapped
338 // out. We want to keep this critical section as short as possible, so the command should be
339 // released outside this section.
340 ScopedLock l(lastCmdLock_);
341
342 prevLastEnqueueCommand = lastEnqueueCommand_;
343 lastEnqueueCommand_ = &command;
344 }
345
346 if (prevLastEnqueueCommand != nullptr) {
347 prevLastEnqueueCommand->release();
348 } else {
349 // The queue becomes active. Add it to the set of activeQueues.
350 device_.addToActiveQueues(this);
351 }
352}
353
354bool HostQueue::isEmpty() {
355 // Get a snapshot of queue size

Callers 15

processOptionFunction · 0.45
parseAllOptionsFunction · 0.45
postParseInitMethod · 0.45
loadLibraryMethod · 0.45
program.cppFile · 0.45
ParseAllOptionsMethod · 0.45
enqueueMethod · 0.45
appendToSourceMethod · 0.45
add_noteMethod · 0.45
getStringStringFunction · 0.45
cl_program.cppFile · 0.45
genShaderMethod · 0.45

Calls 8

getWaitBitsMethod · 0.80
waitingEventMethod · 0.80
addToActiveQueuesMethod · 0.80
finishFunction · 0.50
retainMethod · 0.45
setStatusMethod · 0.45
enqueueMethod · 0.45
releaseMethod · 0.45

Tested by 6

genShaderMethod · 0.36
genShaderMethod · 0.36
genShaderMethod · 0.36
genShaderMethod · 0.36
genShaderMethod · 0.36
oclSysInfoFunction · 0.36