Skip to content

Commit 9e3b287

Browse files
committed
added static scope specifier
Signed-off-by: Byoungro So <[email protected]>
1 parent 7dd2c84 commit 9e3b287

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,11 @@ ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *CallStr,
406406
return mapError(Result);
407407
#define ZE_CALL_NOCHECK(Call) ZeCall().doCall(Call, #Call, false)
408408

409-
inline void piQueueRetainNoLock(pi_queue Queue) { Queue->RefCount++; }
409+
// This helper function increments the reference counter of the Queue
410+
// without guarding with a lock.
411+
// It is the caller's responsibility to make sure the lock is acquired
412+
// on the Queue that is passed in.
413+
inline static void piQueueRetainNoLock(pi_queue Queue) { Queue->RefCount++; }
410414

411415
// This helper function creates a pi_event and associate a pi_queue.
412416
// Note that the caller of this function must have acquired lock on the Queue
@@ -416,7 +420,7 @@ inline void piQueueRetainNoLock(pi_queue Queue) { Queue->RefCount++; }
416420
// \param CommandType various command type determined by the caller
417421
// \param ZeCommandList the handle to associate with the newly created event
418422
// \param ZeEvent the ZeEvent handle to be associated with the event
419-
inline pi_result createEventAndAssociateQueue(
423+
inline static pi_result createEventAndAssociateQueue(
420424
pi_queue Queue, pi_event *Event, pi_command_type CommandType,
421425
ze_command_list_handle_t ZeCommandList, ze_event_handle_t *ZeEvent) {
422426
pi_result Res = piEventCreate(Queue->Context, Event);
@@ -429,9 +433,10 @@ inline pi_result createEventAndAssociateQueue(
429433

430434
*ZeEvent = (*Event)->ZeEvent;
431435
// We need to increment the reference counter here to avoid pi_queue
432-
// being release before the associated pi_event is released because
436+
// being released before the associated pi_event is released because
433437
// piEventRelease requires access to the associated pi_queue.
434-
// In piEventRelease, the reference counter is decremented to release it.
438+
// In piEventRelease, the reference counter of the Queue is decremented
439+
// to release it.
435440
piQueueRetainNoLock(Queue);
436441
return PI_SUCCESS;
437442
}

0 commit comments

Comments
 (0)