@@ -1608,18 +1608,28 @@ cl_int CL_API_CALL clGetEventInfo(cl_event event,
16081608 size_t paramValueSize,
16091609 void *paramValue,
16101610 size_t *paramValueSizeRet) {
1611- API_ENTER (0 );
1611+ auto retVal = CL_SUCCESS;
1612+ API_ENTER (&retVal);
1613+
1614+ DBG_LOG_INPUTS (" event" , event,
1615+ " paramName" , paramName,
1616+ " paramValueSize" , paramValueSize,
1617+ " paramValue" , DebugManager.infoPointerToString (paramValue, paramValueSize),
1618+ " paramValueSizeRet" , paramValueSizeRet);
1619+
16121620 Event *neoEvent = castToObject<Event>(event);
16131621 if (neoEvent == nullptr ) {
1614- return CL_INVALID_EVENT;
1622+ retVal = CL_INVALID_EVENT;
1623+ return retVal;
16151624 }
16161625
16171626 GetInfoHelper info (paramValue, paramValueSize, paramValueSizeRet);
16181627
16191628 switch (paramName) {
1620- default :
1621- return CL_INVALID_VALUE;
1622-
1629+ default : {
1630+ retVal = CL_INVALID_VALUE;
1631+ return retVal;
1632+ }
16231633 // From OCL spec :
16241634 // "Return the command-queue associated with event. For user event objects,"
16251635 // a nullptr value is returned."
@@ -1655,7 +1665,10 @@ cl_int CL_API_CALL clGetEventInfo(cl_event event,
16551665
16561666cl_event CL_API_CALL clCreateUserEvent (cl_context context,
16571667 cl_int *errcodeRet) {
1658- API_ENTER (0 );
1668+ API_ENTER (errcodeRet);
1669+
1670+ DBG_LOG_INPUTS (" context" , context);
1671+
16591672 ErrorCodeHelper err (errcodeRet, CL_SUCCESS);
16601673
16611674 Context *ctx = castToObject<Context>(context);
@@ -1672,91 +1685,116 @@ cl_event CL_API_CALL clCreateUserEvent(cl_context context,
16721685}
16731686
16741687cl_int CL_API_CALL clRetainEvent (cl_event event) {
1675- API_ENTER (0 );
1688+ auto retVal = CL_SUCCESS;
1689+ API_ENTER (&retVal);
1690+
1691+ DBG_LOG_INPUTS (" event" , event);
1692+
16761693 auto pEvent = castToObject<Event>(event);
16771694 DebugManager.logInputs (" cl_event" , event, " Event" , pEvent);
16781695
16791696 if (pEvent) {
16801697 pEvent->retain ();
1681- return CL_SUCCESS ;
1698+ return retVal ;
16821699 }
1683-
1684- return CL_INVALID_EVENT ;
1700+ retVal = CL_INVALID_EVENT;
1701+ return retVal ;
16851702}
16861703
16871704cl_int CL_API_CALL clReleaseEvent (cl_event event) {
1688- API_ENTER (0 );
1705+ auto retVal = CL_SUCCESS;
1706+ API_ENTER (&retVal);
16891707 DBG_LOG_INPUTS (" cl_event" , event);
16901708 auto pEvent = castToObject<Event>(event);
16911709 DebugManager.logInputs (" cl_event" , event, " Event" , pEvent);
16921710
16931711 if (pEvent) {
16941712 pEvent->release ();
1695- return CL_SUCCESS ;
1713+ return retVal ;
16961714 }
1697-
1698- return CL_INVALID_EVENT ;
1715+ retVal = CL_INVALID_EVENT;
1716+ return retVal ;
16991717}
17001718
17011719cl_int CL_API_CALL clSetUserEventStatus (cl_event event,
17021720 cl_int executionStatus) {
1703- API_ENTER (0 );
1721+ auto retVal = CL_SUCCESS;
1722+ API_ENTER (&retVal);
17041723 auto userEvent = castToObject<UserEvent>(event);
17051724 DBG_LOG_INPUTS (" cl_event" , event, " executionStatus" , executionStatus, " UserEvent" , userEvent);
17061725
1707- if (userEvent == nullptr )
1708- return CL_INVALID_EVENT;
1726+ if (userEvent == nullptr ) {
1727+ retVal = CL_INVALID_EVENT;
1728+ return retVal;
1729+ }
17091730
17101731 if (executionStatus > CL_COMPLETE) {
1711- return CL_INVALID_VALUE;
1732+ retVal = CL_INVALID_VALUE;
1733+ return retVal;
17121734 }
17131735
17141736 if (!userEvent->isInitialEventStatus ()) {
1715- return CL_INVALID_OPERATION;
1737+ retVal = CL_INVALID_OPERATION;
1738+ return retVal;
17161739 }
17171740
17181741 TakeOwnershipWrapper<Device> deviceOwnership (*userEvent->getContext ()->getDevice (0 ));
17191742
17201743 userEvent->setStatus (executionStatus);
1721- return CL_SUCCESS ;
1744+ return retVal ;
17221745}
17231746
17241747cl_int CL_API_CALL clSetEventCallback (cl_event event,
17251748 cl_int commandExecCallbackType,
17261749 void (CL_CALLBACK *funcNotify)(cl_event, cl_int, void *),
17271750 void *userData) {
1728- API_ENTER (0 );
1751+ auto retVal = CL_SUCCESS;
1752+ API_ENTER (&retVal);
17291753 auto eventObject = castToObject<Event>(event);
17301754 DBG_LOG_INPUTS (" cl_event" , event, " commandExecCallbackType" , commandExecCallbackType, " Event" , eventObject);
17311755
1732- if (eventObject == nullptr )
1733- return CL_INVALID_EVENT;
1756+ if (eventObject == nullptr ) {
1757+ retVal = CL_INVALID_EVENT;
1758+ return retVal;
1759+ }
17341760 switch (commandExecCallbackType) {
17351761 case CL_COMPLETE:
17361762 case CL_SUBMITTED:
17371763 case CL_RUNNING:
17381764 break ;
1739- default :
1740- return CL_INVALID_VALUE;
1765+ default : {
1766+ retVal = CL_INVALID_VALUE;
1767+ return retVal;
1768+ }
1769+ }
1770+ if (funcNotify == nullptr ) {
1771+ retVal = CL_INVALID_VALUE;
1772+ return retVal;
17411773 }
1742- if (funcNotify == nullptr )
1743- return CL_INVALID_VALUE;
17441774
17451775 eventObject->tryFlushEvent ();
17461776 eventObject->addCallback (funcNotify, commandExecCallbackType, userData);
1747- return CL_SUCCESS ;
1777+ return retVal ;
17481778}
17491779
17501780cl_int CL_API_CALL clGetEventProfilingInfo (cl_event event,
17511781 cl_profiling_info paramName,
17521782 size_t paramValueSize,
17531783 void *paramValue,
17541784 size_t *paramValueSizeRet) {
1755- API_ENTER (0 );
1785+ auto retVal = CL_SUCCESS;
1786+ API_ENTER (&retVal);
1787+ DBG_LOG_INPUTS (" event" , event,
1788+ " paramName" , paramName,
1789+ " paramValueSize" , paramValueSize,
1790+ " paramValue" , DebugManager.infoPointerToString (paramValue, paramValueSize),
1791+ " paramValueSizeRet" , paramValueSizeRet);
17561792 auto eventObject = castToObject<Event>(event);
17571793
1758- if (eventObject == nullptr )
1759- return CL_INVALID_EVENT;
1794+ if (eventObject == nullptr ) {
1795+ retVal = CL_INVALID_EVENT;
1796+ return retVal;
1797+ }
17601798
17611799 return eventObject->getEventProfilingInfo (paramName,
17621800 paramValueSize,
@@ -1851,6 +1889,26 @@ cl_int CL_API_CALL clEnqueueReadBufferRect(cl_command_queue commandQueue,
18511889 cl_event *event) {
18521890 cl_int retVal = CL_SUCCESS;
18531891 API_ENTER (&retVal);
1892+ DBG_LOG_INPUTS (" commandQueue" , commandQueue,
1893+ " buffer" , buffer,
1894+ " blockingRead" , blockingRead,
1895+ " bufferOrigin[0]" , DebugManager.getInput (bufferOrigin, 0 ),
1896+ " bufferOrigin[1]" , DebugManager.getInput (bufferOrigin, 1 ),
1897+ " bufferOrigin[2]" , DebugManager.getInput (bufferOrigin, 2 ),
1898+ " hostOrigin[0]" , DebugManager.getInput (hostOrigin, 0 ),
1899+ " hostOrigin[1]" , DebugManager.getInput (hostOrigin, 1 ),
1900+ " hostOrigin[2]" , DebugManager.getInput (hostOrigin, 2 ),
1901+ " region[0]" , DebugManager.getInput (region, 0 ),
1902+ " region[1]" , DebugManager.getInput (region, 1 ),
1903+ " region[2]" , DebugManager.getInput (region, 2 ),
1904+ " bufferRowPitch" , bufferRowPitch,
1905+ " bufferSlicePitch" , bufferSlicePitch,
1906+ " hostRowPitch" , hostRowPitch,
1907+ " hostSlicePitch" , hostSlicePitch,
1908+ " ptr" , ptr,
1909+ " numEventsInWaitList" , numEventsInWaitList,
1910+ " eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
1911+ " event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
18541912
18551913 CommandQueue *pCommandQueue = nullptr ;
18561914 Buffer *pBuffer = nullptr ;
@@ -1961,6 +2019,16 @@ cl_int CL_API_CALL clEnqueueWriteBufferRect(cl_command_queue commandQueue,
19612019 cl_int retVal = CL_SUCCESS;
19622020 API_ENTER (&retVal);
19632021
2022+ DBG_LOG_INPUTS (" commandQueue" , commandQueue, " buffer" , buffer, " blockingWrite" , blockingWrite,
2023+ " bufferOrigin[0]" , DebugManager.getInput (bufferOrigin, 0 ), " bufferOrigin[1]" , DebugManager.getInput (bufferOrigin, 1 ), " bufferOrigin[2]" , DebugManager.getInput (bufferOrigin, 2 ),
2024+ " hostOrigin[0]" , DebugManager.getInput (hostOrigin, 0 ), " hostOrigin[1]" , DebugManager.getInput (hostOrigin, 1 ), " hostOrigin[2]" , DebugManager.getInput (hostOrigin, 2 ),
2025+ " region[0]" , DebugManager.getInput (region, 0 ), " region[1]" , DebugManager.getInput (region, 1 ), " region[2]" , DebugManager.getInput (region, 2 ),
2026+ " bufferRowPitch" , bufferRowPitch, " bufferSlicePitch" , bufferSlicePitch,
2027+ " hostRowPitch" , hostRowPitch, " hostSlicePitch" , hostSlicePitch, " ptr" , ptr,
2028+ " numEventsInWaitList" , numEventsInWaitList,
2029+ " eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2030+ " event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
2031+
19642032 CommandQueue *pCommandQueue = nullptr ;
19652033 Buffer *pBuffer = nullptr ;
19662034
@@ -2018,6 +2086,13 @@ cl_int CL_API_CALL clEnqueueFillBuffer(cl_command_queue commandQueue,
20182086 cl_int retVal = CL_SUCCESS;
20192087 API_ENTER (&retVal);
20202088
2089+ DBG_LOG_INPUTS (" commandQueue" , commandQueue, " buffer" , buffer,
2090+ " pattern" , DebugManager.infoPointerToString (pattern, patternSize), " patternSize" , patternSize,
2091+ " offset" , offset, " size" , size,
2092+ " numEventsInWaitList" , numEventsInWaitList,
2093+ " eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2094+ " event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
2095+
20212096 CommandQueue *pCommandQueue = nullptr ;
20222097 Buffer *pBuffer = nullptr ;
20232098
0 commit comments