@@ -3551,18 +3551,19 @@ cl_int CL_API_CALL clEnqueueSVMMap(cl_command_queue commandQueue,
35513551 DBG_LOG_INPUTS (" commandQueue" , commandQueue,
35523552 " blockingMap" , blockingMap,
35533553 " mapFlags" , mapFlags,
3554- " svmPtr" , svmPtr,
3554+ " svmPtr" , DebugManager. infoPointerToString ( svmPtr, size) ,
35553555 " size" , size,
35563556 " numEventsInWaitList" , numEventsInWaitList,
3557- " eventWaitList" , eventWaitList,
3558- " event" , event);
3557+ " eventWaitList" , DebugManager. getEvents ( reinterpret_cast < const uintptr_t *>( eventWaitList), numEventsInWaitList) ,
3558+ " event" , DebugManager. getEvents ( reinterpret_cast < const uintptr_t *>( event), 1 ) );
35593559
35603560 if (CL_SUCCESS != retVal) {
35613561 return retVal;
35623562 }
35633563
35643564 if ((svmPtr == nullptr ) || (size == 0 )) {
3565- return CL_INVALID_VALUE;
3565+ retVal = CL_INVALID_VALUE;
3566+ return retVal;
35663567 }
35673568
35683569 retVal = pCommandQueue->enqueueSVMMap (
@@ -3595,8 +3596,8 @@ cl_int CL_API_CALL clEnqueueSVMUnmap(cl_command_queue commandQueue,
35953596 DBG_LOG_INPUTS (" commandQueue" , commandQueue,
35963597 " svmPtr" , svmPtr,
35973598 " numEventsInWaitList" , numEventsInWaitList,
3598- " eventWaitList" , eventWaitList,
3599- " event" , event);
3599+ " eventWaitList" , DebugManager. getEvents ( reinterpret_cast < const uintptr_t *>( eventWaitList), numEventsInWaitList) ,
3600+ " event" , DebugManager. getEvents ( reinterpret_cast < const uintptr_t *>( event), 1 ) );
36003601
36013602 if (retVal != CL_SUCCESS) {
36023603 return retVal;
@@ -3627,24 +3628,27 @@ cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
36273628 }
36283629
36293630 if (argIndex >= pKernel->getKernelArgsNumber ()) {
3630- return CL_INVALID_ARG_INDEX;
3631+ retVal = CL_INVALID_ARG_INDEX;
3632+ return retVal;
36313633 }
36323634
36333635 cl_int kernelArgAddressQualifier = pKernel->getKernelArgAddressQualifier (argIndex);
36343636 if ((kernelArgAddressQualifier != CL_KERNEL_ARG_ADDRESS_GLOBAL) &&
36353637 (kernelArgAddressQualifier != CL_KERNEL_ARG_ADDRESS_CONSTANT)) {
3636- return CL_INVALID_ARG_VALUE;
3638+ retVal = CL_INVALID_ARG_VALUE;
3639+ return retVal;
36373640 }
36383641
36393642 GraphicsAllocation *pSvmAlloc = nullptr ;
36403643 if (argValue != nullptr ) {
36413644 pSvmAlloc = pKernel->getContext ().getSVMAllocsManager ()->getSVMAlloc (argValue);
36423645 if (pSvmAlloc == nullptr ) {
3643- return CL_INVALID_ARG_VALUE;
3646+ retVal = CL_INVALID_ARG_VALUE;
3647+ return retVal;
36443648 }
36453649 }
3646-
3647- return pKernel-> setArgSvmAlloc (argIndex, const_cast < void *>(argValue), pSvmAlloc) ;
3650+ retVal = pKernel-> setArgSvmAlloc (argIndex, const_cast < void *>(argValue), pSvmAlloc);
3651+ return retVal ;
36483652}
36493653
36503654cl_int CL_API_CALL clSetKernelExecInfo (cl_kernel kernel,
@@ -3657,7 +3661,7 @@ cl_int CL_API_CALL clSetKernelExecInfo(cl_kernel kernel,
36573661 API_ENTER (&retVal);
36583662
36593663 DBG_LOG_INPUTS (" kernel" , kernel, " paramName" , paramName,
3660- " paramValueSize" , paramValueSize, " paramValue" , paramValue);
3664+ " paramValueSize" , paramValueSize, " paramValue" , DebugManager. infoPointerToString ( paramValue, paramValueSize) );
36613665
36623666 if (CL_SUCCESS != retVal) {
36633667 return retVal;
@@ -3668,7 +3672,8 @@ cl_int CL_API_CALL clSetKernelExecInfo(cl_kernel kernel,
36683672 if ((paramValueSize == 0 ) ||
36693673 (paramValueSize % sizeof (void *)) ||
36703674 (paramValue == nullptr )) {
3671- return CL_INVALID_VALUE;
3675+ retVal = CL_INVALID_VALUE;
3676+ return retVal;
36723677 }
36733678 size_t numPointers = paramValueSize / sizeof (void *);
36743679 size_t *pSvmPtrList = (size_t *)paramValue;
@@ -3678,16 +3683,21 @@ cl_int CL_API_CALL clSetKernelExecInfo(cl_kernel kernel,
36783683 OCLRT::GraphicsAllocation *pSvmAlloc =
36793684 pKernel->getContext ().getSVMAllocsManager ()->getSVMAlloc ((const void *)pSvmPtrList[i]);
36803685 if (pSvmAlloc == nullptr ) {
3681- return CL_INVALID_VALUE;
3686+ retVal = CL_INVALID_VALUE;
3687+ return retVal;
36823688 }
36833689 pKernel->setKernelExecInfo (pSvmAlloc);
36843690 }
36853691 break ;
36863692 }
3687- case CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM:
3688- return CL_INVALID_OPERATION;
3689- default :
3690- return CL_INVALID_VALUE;
3693+ case CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM: {
3694+ retVal = CL_INVALID_OPERATION;
3695+ return retVal;
3696+ }
3697+ default : {
3698+ retVal = CL_INVALID_VALUE;
3699+ return retVal;
3700+ }
36913701 }
36923702
36933703 return retVal;
@@ -3767,7 +3777,7 @@ cl_int CL_API_CALL clGetPipeInfo(cl_mem pipe,
37673777 DBG_LOG_INPUTS (" cl_mem" , pipe,
37683778 " cl_pipe_info" , paramName,
37693779 " size_t" , paramValueSize,
3770- " void *" , paramValue,
3780+ " void *" , DebugManager. infoPointerToString ( paramValue, paramValueSize) ,
37713781 " size_t*" , paramValueSizeRet);
37723782
37733783 retVal = validateObjects (pipe);
@@ -3778,7 +3788,8 @@ cl_int CL_API_CALL clGetPipeInfo(cl_mem pipe,
37783788 auto pPipeObj = castToObject<Pipe>(pipe);
37793789
37803790 if (pPipeObj == nullptr ) {
3781- return CL_INVALID_MEM_OBJECT;
3791+ retVal = CL_INVALID_MEM_OBJECT;
3792+ return retVal;
37823793 }
37833794
37843795 retVal = pPipeObj->getPipeInfo (paramName, paramValueSize, paramValue, paramValueSizeRet);
@@ -3791,6 +3802,10 @@ cl_command_queue CL_API_CALL clCreateCommandQueueWithProperties(cl_context conte
37913802 cl_int *errcodeRet) {
37923803 cl_int retVal = CL_SUCCESS;
37933804 API_ENTER (&retVal);
3805+ DBG_LOG_INPUTS (" context" , context,
3806+ " device" , device,
3807+ " properties" , properties);
3808+
37943809 cl_command_queue commandQueue = nullptr ;
37953810 ErrorCodeHelper err (errcodeRet, CL_SUCCESS);
37963811
@@ -3905,6 +3920,8 @@ cl_sampler CL_API_CALL clCreateSamplerWithProperties(cl_context context,
39053920 cl_int *errcodeRet) {
39063921 cl_int retVal = CL_SUCCESS;
39073922 API_ENTER (&retVal);
3923+ DBG_LOG_INPUTS (" context" , context,
3924+ " samplerProperties" , samplerProperties);
39083925 cl_sampler sampler = nullptr ;
39093926 retVal = validateObjects (context);
39103927
@@ -3923,7 +3940,9 @@ cl_sampler CL_API_CALL clCreateSamplerWithProperties(cl_context context,
39233940}
39243941
39253942cl_int CL_API_CALL clUnloadCompiler () {
3926- return CL_OUT_OF_HOST_MEMORY;
3943+ cl_int retVal = CL_OUT_OF_HOST_MEMORY;
3944+ API_ENTER (&retVal);
3945+ return retVal;
39273946}
39283947
39293948cl_int CL_API_CALL clGetKernelSubGroupInfoKHR (cl_kernel kernel,
@@ -3936,6 +3955,14 @@ cl_int CL_API_CALL clGetKernelSubGroupInfoKHR(cl_kernel kernel,
39363955 size_t *paramValueSizeRet) {
39373956 cl_int retVal = CL_SUCCESS;
39383957 API_ENTER (&retVal);
3958+ DBG_LOG_INPUTS (" kernel" , kernel,
3959+ " device" , device,
3960+ " paramName" , paramName,
3961+ " inputValueSize" , inputValueSize,
3962+ " inputValue" , DebugManager.infoPointerToString (inputValue, inputValueSize),
3963+ " paramValueSize" , paramValueSize,
3964+ " paramValue" , DebugManager.infoPointerToString (paramValue, paramValueSize),
3965+ " paramValueSizeRet" , paramValueSizeRet);
39393966
39403967 Kernel *pKernel = nullptr ;
39413968 retVal = validateObjects (device,
@@ -3953,8 +3980,10 @@ cl_int CL_API_CALL clGetKernelSubGroupInfoKHR(cl_kernel kernel,
39533980 inputValueSize, inputValue,
39543981 paramValueSize, paramValue,
39553982 paramValueSizeRet);
3956- default :
3957- return CL_INVALID_VALUE;
3983+ default : {
3984+ retVal = CL_INVALID_VALUE;
3985+ return retVal;
3986+ }
39583987 }
39593988}
39603989
@@ -3963,7 +3992,9 @@ cl_int CL_API_CALL clGetDeviceAndHostTimer(cl_device_id device,
39633992 cl_ulong *hostTimestamp) {
39643993 cl_int retVal = CL_SUCCESS;
39653994 API_ENTER (&retVal);
3966-
3995+ DBG_LOG_INPUTS (" device" , device,
3996+ " deviceTimestamp" , deviceTimestamp,
3997+ " hostTimestamp" , hostTimestamp);
39673998 do {
39683999 Device *pDevice = castToObject<Device>(device);
39694000 if (pDevice == nullptr ) {
@@ -3987,6 +4018,8 @@ cl_int CL_API_CALL clGetHostTimer(cl_device_id device,
39874018 cl_ulong *hostTimestamp) {
39884019 cl_int retVal = CL_SUCCESS;
39894020 API_ENTER (&retVal);
4021+ DBG_LOG_INPUTS (" device" , device,
4022+ " hostTimestamp" , hostTimestamp);
39904023
39914024 do {
39924025 Device *pDevice = castToObject<Device>(device);
@@ -4017,6 +4050,14 @@ cl_int CL_API_CALL clGetKernelSubGroupInfo(cl_kernel kernel,
40174050 size_t *paramValueSizeRet) {
40184051 cl_int retVal = CL_SUCCESS;
40194052 API_ENTER (&retVal);
4053+ DBG_LOG_INPUTS (" kernel" , kernel,
4054+ " device" , device,
4055+ " paramName" , paramName,
4056+ " inputValueSize" , inputValueSize,
4057+ " inputValue" , DebugManager.infoPointerToString (inputValue, inputValueSize),
4058+ " paramValueSize" , paramValueSize,
4059+ " paramValue" , DebugManager.infoPointerToString (paramValue, paramValueSize),
4060+ " paramValueSizeRet" , paramValueSizeRet);
40204061
40214062 Kernel *pKernel = nullptr ;
40224063 retVal = validateObjects (device,
@@ -4038,6 +4079,9 @@ cl_int CL_API_CALL clSetDefaultDeviceCommandQueue(cl_context context,
40384079
40394080 cl_int retVal = CL_SUCCESS;
40404081 API_ENTER (&retVal);
4082+ DBG_LOG_INPUTS (" context" , context,
4083+ " device" , device,
4084+ " commandQueue" , commandQueue);
40414085
40424086 Context *pContext = nullptr ;
40434087
@@ -4050,16 +4094,19 @@ cl_int CL_API_CALL clSetDefaultDeviceCommandQueue(cl_context context,
40504094 auto pDeviceQueue = castToObject<DeviceQueue>(static_cast <_device_queue *>(commandQueue));
40514095
40524096 if (!pDeviceQueue) {
4053- return CL_INVALID_COMMAND_QUEUE;
4097+ retVal = CL_INVALID_COMMAND_QUEUE;
4098+ return retVal;
40544099 }
40554100
40564101 if (&pDeviceQueue->getContext () != pContext) {
4057- return CL_INVALID_COMMAND_QUEUE;
4102+ retVal = CL_INVALID_COMMAND_QUEUE;
4103+ return retVal;
40584104 }
40594105
40604106 pContext->setDefaultDeviceQueue (pDeviceQueue);
40614107
4062- return CL_SUCCESS;
4108+ retVal = CL_SUCCESS;
4109+ return retVal;
40634110}
40644111
40654112cl_int CL_API_CALL clEnqueueSVMMigrateMem (cl_command_queue commandQueue,
@@ -4072,6 +4119,14 @@ cl_int CL_API_CALL clEnqueueSVMMigrateMem(cl_command_queue commandQueue,
40724119 cl_event *event) {
40734120 cl_int retVal = CL_SUCCESS;
40744121 API_ENTER (&retVal);
4122+ DBG_LOG_INPUTS (" commandQueue" , commandQueue,
4123+ " numSvmPointers" , numSvmPointers,
4124+ " svmPointers" , DebugManager.infoPointerToString (svmPointers ? svmPointers[0 ] : 0 , DebugManager.getInput (sizes, 0 )),
4125+ " sizes" , DebugManager.getInput (sizes, 0 ),
4126+ " flags" , flags,
4127+ " numEventsInWaitList" , numEventsInWaitList,
4128+ " eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
4129+ " event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
40754130
40764131 CommandQueue *pCommandQueue = nullptr ;
40774132 retVal = validateObjects (
@@ -4082,44 +4137,50 @@ cl_int CL_API_CALL clEnqueueSVMMigrateMem(cl_command_queue commandQueue,
40824137 return retVal;
40834138 }
40844139
4085- if (numSvmPointers == 0 || svmPointers == nullptr )
4086- return CL_INVALID_VALUE;
4140+ if (numSvmPointers == 0 || svmPointers == nullptr ) {
4141+ retVal = CL_INVALID_VALUE;
4142+ return retVal;
4143+ }
40874144
40884145 const cl_mem_migration_flags allValidFlags =
40894146 CL_MIGRATE_MEM_OBJECT_HOST | CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED;
40904147
40914148 if ((flags & (~allValidFlags)) != 0 ) {
4092- return CL_INVALID_VALUE;
4149+ retVal = CL_INVALID_VALUE;
4150+ return retVal;
40934151 }
40944152
40954153 for (uint32_t i = 0 ; i < numSvmPointers; i++) {
40964154 SVMAllocsManager *pSvmAllocMgr = pCommandQueue->getContext ().getSVMAllocsManager ();
40974155 GraphicsAllocation *pSvmAlloc = pSvmAllocMgr->getSVMAlloc (svmPointers[i]);
40984156 if (pSvmAlloc == nullptr ) {
4099- return CL_INVALID_VALUE;
4157+ retVal = CL_INVALID_VALUE;
4158+ return retVal;
41004159 }
41014160 if (sizes != nullptr && sizes[i] != 0 ) {
41024161 pSvmAlloc = pSvmAllocMgr->getSVMAlloc (reinterpret_cast <void *>((size_t )svmPointers[i] + sizes[i] - 1 ));
41034162 if (pSvmAlloc == nullptr ) {
4104- return CL_INVALID_VALUE;
4163+ retVal = CL_INVALID_VALUE;
4164+ return retVal;
41054165 }
41064166 }
41074167 }
41084168
41094169 for (uint32_t i = 0 ; i < numEventsInWaitList; i++) {
41104170 auto pEvent = castToObject<Event>(eventWaitList[i]);
41114171 if (pEvent->getContext () != &pCommandQueue->getContext ()) {
4112- return CL_INVALID_CONTEXT;
4172+ retVal = CL_INVALID_CONTEXT;
4173+ return retVal;
41134174 }
41144175 }
4115-
4116- return pCommandQueue-> enqueueSVMMigrateMem (numSvmPointers ,
4117- svmPointers ,
4118- sizes ,
4119- flags ,
4120- numEventsInWaitList ,
4121- eventWaitList,
4122- event) ;
4176+ retVal = pCommandQueue-> enqueueSVMMigrateMem (numSvmPointers,
4177+ svmPointers ,
4178+ sizes ,
4179+ flags ,
4180+ numEventsInWaitList ,
4181+ eventWaitList ,
4182+ event);
4183+ return retVal ;
41234184}
41244185
41254186cl_kernel CL_API_CALL clCloneKernel (cl_kernel sourceKernel,
@@ -4129,6 +4190,7 @@ cl_kernel CL_API_CALL clCloneKernel(cl_kernel sourceKernel,
41294190
41304191 auto retVal = validateObjects (WithCastToInternal (sourceKernel, &pSourceKernel));
41314192 API_ENTER (&retVal);
4193+ DBG_LOG_INPUTS (" sourceKernel" , sourceKernel);
41324194
41334195 if (CL_SUCCESS == retVal) {
41344196 pClonedKernel = Kernel::create (pSourceKernel->getProgram (),
0 commit comments