@@ -2325,7 +2325,8 @@ cl_int CL_API_CALL clEnqueueReadImage(cl_command_queue commandQueue,
2325
2325
return retVal;
2326
2326
}
2327
2327
if (!Image::validateRegionAndOrigin (origin, region, pImage->getImageDesc ())) {
2328
- return CL_INVALID_VALUE;
2328
+ retVal = CL_INVALID_VALUE;
2329
+ return retVal;
2329
2330
}
2330
2331
2331
2332
retVal = pCommandQueue->enqueueReadImage (
@@ -2384,7 +2385,8 @@ cl_int CL_API_CALL clEnqueueWriteImage(cl_command_queue commandQueue,
2384
2385
return retVal;
2385
2386
}
2386
2387
if (!Image::validateRegionAndOrigin (origin, region, pImage->getImageDesc ())) {
2387
- return CL_INVALID_VALUE;
2388
+ retVal = CL_INVALID_VALUE;
2389
+ return retVal;
2388
2390
}
2389
2391
2390
2392
retVal = pCommandQueue->enqueueWriteImage (
@@ -2424,15 +2426,16 @@ cl_int CL_API_CALL clEnqueueFillImage(cl_command_queue commandQueue,
2424
2426
API_ENTER (&retVal);
2425
2427
2426
2428
DBG_LOG_INPUTS (" commandQueue" , commandQueue, " image" , image, " fillColor" , fillColor,
2427
- " origin[0]" , origin[ 0 ] , " origin[1]" , origin[ 1 ] , " origin[2]" , origin[ 2 ] ,
2428
- " region[0]" , region[ 0 ] , " region[1]" , region[ 1 ] , " region[2]" , region[ 2 ] ,
2429
+ " origin[0]" , DebugManager. getInput ( origin, 0 ) , " origin[1]" , DebugManager. getInput ( origin, 1 ) , " origin[2]" , DebugManager. getInput ( origin, 2 ) ,
2430
+ " region[0]" , DebugManager. getInput ( region, 0 ) , " region[1]" , DebugManager. getInput ( region, 1 ) , " region[2]" , DebugManager. getInput ( region, 2 ) ,
2429
2431
" numEventsInWaitList" , numEventsInWaitList,
2430
2432
" eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2431
2433
" event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
2432
2434
2433
2435
if (CL_SUCCESS == retVal) {
2434
2436
if (!Image::validateRegionAndOrigin (origin, region, dstImage->getImageDesc ())) {
2435
- return CL_INVALID_VALUE;
2437
+ retVal = CL_INVALID_VALUE;
2438
+ return retVal;
2436
2439
}
2437
2440
2438
2441
retVal = pCommandQueue->enqueueFillImage (
@@ -2469,16 +2472,17 @@ cl_int CL_API_CALL clEnqueueCopyImage(cl_command_queue commandQueue,
2469
2472
API_ENTER (&retVal);
2470
2473
2471
2474
DBG_LOG_INPUTS (" commandQueue" , commandQueue, " srcImage" , srcImage, " dstImage" , dstImage,
2472
- " origin [0]" , DebugManager.getInput (srcOrigin, 0 ), " origin [1]" , DebugManager.getInput (srcOrigin, 1 ), " origin [2]" , DebugManager.getInput (srcOrigin, 2 ),
2473
- " region [0]" , DebugManager.getInput (dstOrigin, 0 ), " region [1]" , DebugManager.getInput (dstOrigin, 1 ), " region [2]" , DebugManager.getInput (dstOrigin, 2 ),
2475
+ " srcOrigin [0]" , DebugManager.getInput (srcOrigin, 0 ), " srcOrigin [1]" , DebugManager.getInput (srcOrigin, 1 ), " srcOrigin [2]" , DebugManager.getInput (srcOrigin, 2 ),
2476
+ " dstOrigin [0]" , DebugManager.getInput (dstOrigin, 0 ), " dstOrigin [1]" , DebugManager.getInput (dstOrigin, 1 ), " dstOrigin [2]" , DebugManager.getInput (dstOrigin, 2 ),
2474
2477
" region[0]" , region ? region[0 ] : 0 , " region[1]" , region ? region[1 ] : 0 , " region[2]" , region ? region[2 ] : 0 ,
2475
2478
" numEventsInWaitList" , numEventsInWaitList,
2476
2479
" eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2477
2480
" event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
2478
2481
2479
2482
if (CL_SUCCESS == retVal) {
2480
2483
if (memcmp (&pSrcImage->getImageFormat (), &pDstImage->getImageFormat (), sizeof (cl_image_format))) {
2481
- return CL_IMAGE_FORMAT_MISMATCH;
2484
+ retVal = CL_IMAGE_FORMAT_MISMATCH;
2485
+ return retVal;
2482
2486
}
2483
2487
if (IsPackedYuvImage (&pSrcImage->getImageFormat ())) {
2484
2488
retVal = validateYuvOperation (srcOrigin, region);
@@ -2487,19 +2491,24 @@ cl_int CL_API_CALL clEnqueueCopyImage(cl_command_queue commandQueue,
2487
2491
}
2488
2492
if (IsPackedYuvImage (&pDstImage->getImageFormat ())) {
2489
2493
retVal = validateYuvOperation (dstOrigin, region);
2494
+
2490
2495
if (retVal != CL_SUCCESS)
2491
2496
return retVal;
2492
- if (pDstImage->getImageDesc ().image_type == CL_MEM_OBJECT_IMAGE2D && dstOrigin[2 ] != 0 )
2493
- return CL_INVALID_VALUE;
2497
+ if (pDstImage->getImageDesc ().image_type == CL_MEM_OBJECT_IMAGE2D && dstOrigin[2 ] != 0 ) {
2498
+ retVal = CL_INVALID_VALUE;
2499
+ return retVal;
2500
+ }
2494
2501
}
2495
2502
if (!Image::validateRegionAndOrigin (srcOrigin, region, pSrcImage->getImageDesc ())) {
2496
- return CL_INVALID_VALUE;
2503
+ retVal = CL_INVALID_VALUE;
2504
+ return retVal;
2497
2505
}
2498
2506
if (!Image::validateRegionAndOrigin (dstOrigin, region, pDstImage->getImageDesc ())) {
2499
- return CL_INVALID_VALUE;
2507
+ retVal = CL_INVALID_VALUE;
2508
+ return retVal;
2500
2509
}
2501
2510
2502
- pCommandQueue->enqueueCopyImage (
2511
+ retVal = pCommandQueue->enqueueCopyImage (
2503
2512
pSrcImage,
2504
2513
pDstImage,
2505
2514
srcOrigin,
@@ -2526,8 +2535,9 @@ cl_int CL_API_CALL clEnqueueCopyImageToBuffer(cl_command_queue commandQueue,
2526
2535
API_ENTER (&retVal);
2527
2536
2528
2537
DBG_LOG_INPUTS (" commandQueue" , commandQueue, " srcImage" , srcImage, " dstBuffer" , dstBuffer,
2529
- " srcOrigin[0]" , srcOrigin[0 ], " srcOrigin[1]" , srcOrigin[1 ], " srcOrigin[2]" , srcOrigin[2 ],
2530
- " region[0]" , region[0 ], " region[1]" , region[1 ], " region[2]" , region[2 ],
2538
+ " srcOrigin[0]" , DebugManager.getInput (srcOrigin, 0 ), " srcOrigin[1]" , DebugManager.getInput (srcOrigin, 1 ), " srcOrigin[2]" , DebugManager.getInput (srcOrigin, 2 ),
2539
+ " region[0]" , DebugManager.getInput (region, 0 ), " region[1]" , DebugManager.getInput (region, 1 ), " region[2]" , DebugManager.getInput (region, 2 ),
2540
+ " dstOffset" , dstOffset,
2531
2541
" numEventsInWaitList" , numEventsInWaitList,
2532
2542
" eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2533
2543
" event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
@@ -2548,7 +2558,8 @@ cl_int CL_API_CALL clEnqueueCopyImageToBuffer(cl_command_queue commandQueue,
2548
2558
return retVal;
2549
2559
}
2550
2560
if (!Image::validateRegionAndOrigin (srcOrigin, region, pSrcImage->getImageDesc ())) {
2551
- return CL_INVALID_VALUE;
2561
+ retVal = CL_INVALID_VALUE;
2562
+ return retVal;
2552
2563
}
2553
2564
2554
2565
retVal = pCommandQueue->enqueueCopyImageToBuffer (
@@ -2579,8 +2590,8 @@ cl_int CL_API_CALL clEnqueueCopyBufferToImage(cl_command_queue commandQueue,
2579
2590
API_ENTER (&retVal);
2580
2591
2581
2592
DBG_LOG_INPUTS (" commandQueue" , commandQueue, " srcBuffer" , srcBuffer, " dstImage" , dstImage, " srcOffset" , srcOffset,
2582
- " dstOrigin[0]" , dstOrigin[ 0 ] , " dstOrigin[1]" , dstOrigin[ 1 ] , " dstOrigin[2]" , dstOrigin[ 2 ] ,
2583
- " region[0]" , region[ 0 ] , " region[1]" , region[ 1 ] , " region[2]" , region[ 2 ] ,
2593
+ " dstOrigin[0]" , DebugManager. getInput ( dstOrigin, 0 ) , " dstOrigin[1]" , DebugManager. getInput ( dstOrigin, 1 ) , " dstOrigin[2]" , DebugManager. getInput ( dstOrigin, 2 ) ,
2594
+ " region[0]" , DebugManager. getInput ( region, 0 ) , " region[1]" , DebugManager. getInput ( region, 1 ) , " region[2]" , DebugManager. getInput ( region, 2 ) ,
2584
2595
" numEventsInWaitList" , numEventsInWaitList,
2585
2596
" eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2586
2597
" event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
@@ -2601,7 +2612,8 @@ cl_int CL_API_CALL clEnqueueCopyBufferToImage(cl_command_queue commandQueue,
2601
2612
return retVal;
2602
2613
}
2603
2614
if (!Image::validateRegionAndOrigin (dstOrigin, region, pDstImage->getImageDesc ())) {
2604
- return CL_INVALID_VALUE;
2615
+ retVal = CL_INVALID_VALUE;
2616
+ return retVal;
2605
2617
}
2606
2618
2607
2619
retVal = pCommandQueue->enqueueCopyBufferToImage (
@@ -2695,16 +2707,13 @@ void *CL_API_CALL clEnqueueMapImage(cl_command_queue commandQueue,
2695
2707
2696
2708
API_ENTER (&retVal);
2697
2709
2698
- DBG_LOG_INPUTS (" commandQueue" , commandQueue,
2699
- " image" , image,
2700
- " blockingMap" , blockingMap,
2701
- " mapFlags" , mapFlags,
2702
- " origin[0]" , origin[0 ],
2703
- " origin[1]" , origin[1 ],
2704
- " origin[2]" , origin[2 ],
2705
- " region[0]" , region[0 ],
2706
- " region[1]" , region[1 ],
2707
- " region[2]" , region[2 ],
2710
+ DBG_LOG_INPUTS (" commandQueue" , commandQueue, " image" , image,
2711
+ " blockingMap" , blockingMap, " mapFlags" , mapFlags,
2712
+ " origin[0]" , DebugManager.getInput (origin, 0 ), " origin[1]" , DebugManager.getInput (origin, 1 ),
2713
+ " origin[2]" , DebugManager.getInput (origin, 2 ), " region[0]" , DebugManager.getInput (region, 0 ),
2714
+ " region[1]" , DebugManager.getInput (region, 1 ), " region[2]" , DebugManager.getInput (region, 2 ),
2715
+ " imageRowPitch" , DebugManager.getInput (imageRowPitch, 0 ),
2716
+ " imageSlicePitch" , DebugManager.getInput (imageSlicePitch, 0 ),
2708
2717
" numEventsInWaitList" , numEventsInWaitList,
2709
2718
" eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2710
2719
" event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
@@ -2782,7 +2791,8 @@ cl_int CL_API_CALL clEnqueueUnmapMemObject(cl_command_queue commandQueue,
2782
2791
2783
2792
if (retVal == CL_SUCCESS) {
2784
2793
if (pMemObj->peekClMemObjType () == CL_MEM_OBJECT_PIPE) {
2785
- return CL_INVALID_MEM_OBJECT;
2794
+ retVal = CL_INVALID_MEM_OBJECT;
2795
+ return retVal;
2786
2796
}
2787
2797
2788
2798
retVal = pCommandQueue->enqueueUnmapMemObject (pMemObj, mappedPtr, numEventsInWaitList, eventWaitList, event);
@@ -2808,7 +2818,7 @@ cl_int CL_API_CALL clEnqueueMigrateMemObjects(cl_command_queue commandQueue,
2808
2818
" flags" , flags,
2809
2819
" numEventsInWaitList" , numEventsInWaitList,
2810
2820
" eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2811
- " event" , event);
2821
+ " event" , DebugManager. getEvents ( reinterpret_cast < const uintptr_t *>( event), 1 ) );
2812
2822
2813
2823
CommandQueue *pCommandQueue = nullptr ;
2814
2824
retVal = validateObjects (
@@ -2819,13 +2829,16 @@ cl_int CL_API_CALL clEnqueueMigrateMemObjects(cl_command_queue commandQueue,
2819
2829
return retVal;
2820
2830
}
2821
2831
2822
- if (numMemObjects == 0 || memObjects == nullptr )
2823
- return CL_INVALID_VALUE;
2832
+ if (numMemObjects == 0 || memObjects == nullptr ) {
2833
+ retVal = CL_INVALID_VALUE;
2834
+ return retVal;
2835
+ }
2824
2836
2825
2837
const cl_mem_migration_flags allValidFlags = CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED | CL_MIGRATE_MEM_OBJECT_HOST;
2826
2838
2827
2839
if ((flags & (~allValidFlags)) != 0 ) {
2828
- return CL_INVALID_VALUE;
2840
+ retVal = CL_INVALID_VALUE;
2841
+ return retVal;
2829
2842
}
2830
2843
2831
2844
retVal = pCommandQueue->enqueueMigrateMemObjects (numMemObjects,
@@ -2849,8 +2862,12 @@ cl_int CL_API_CALL clEnqueueNDRangeKernel(cl_command_queue commandQueue,
2849
2862
cl_event *event) {
2850
2863
cl_int retVal = CL_SUCCESS;
2851
2864
API_ENTER (&retVal);
2852
- DBG_LOG_INPUTS (" commandQueue" , commandQueue, " cl_kernel" , kernel, " globalWorkOffset" , globalWorkOffset,
2853
- DebugManager.getSizes (globalWorkSize, workDim, false ), DebugManager.getSizes (localWorkSize, workDim, true ),
2865
+ DBG_LOG_INPUTS (" commandQueue" , commandQueue, " cl_kernel" , kernel,
2866
+ " globalWorkOffset[0]" , DebugManager.getInput (globalWorkOffset, 0 ),
2867
+ " globalWorkOffset[1]" , DebugManager.getInput (globalWorkOffset, 1 ),
2868
+ " globalWorkOffset[2]" , DebugManager.getInput (globalWorkOffset, 2 ),
2869
+ " globalWorkSize" , DebugManager.getSizes (globalWorkSize, workDim, false ),
2870
+ " localWorkSize" , DebugManager.getSizes (localWorkSize, workDim, true ),
2854
2871
" numEventsInWaitList" , numEventsInWaitList,
2855
2872
" eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2856
2873
" event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
@@ -2893,6 +2910,10 @@ cl_int CL_API_CALL clEnqueueTask(cl_command_queue commandQueue,
2893
2910
cl_event *event) {
2894
2911
cl_int retVal = CL_SUCCESS;
2895
2912
API_ENTER (&retVal);
2913
+ DBG_LOG_INPUTS (" commandQueue" , commandQueue, " kernel" , kernel,
2914
+ " numEventsInWaitList" , numEventsInWaitList,
2915
+ " eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2916
+ " event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
2896
2917
cl_uint workDim = 3 ;
2897
2918
size_t *globalWorkOffset = nullptr ;
2898
2919
size_t globalWorkSize[3 ] = {1 , 1 , 1 };
@@ -2920,23 +2941,34 @@ cl_int CL_API_CALL clEnqueueNativeKernel(cl_command_queue commandQueue,
2920
2941
cl_uint numEventsInWaitList,
2921
2942
const cl_event *eventWaitList,
2922
2943
cl_event *event) {
2923
- return CL_OUT_OF_HOST_MEMORY;
2944
+ cl_int retVal = CL_OUT_OF_HOST_MEMORY;
2945
+ API_ENTER (&retVal);
2946
+ DBG_LOG_INPUTS (" commandQueue" , commandQueue, " userFunc" , userFunc, " args" , args,
2947
+ " cbArgs" , cbArgs, " numMemObjects" , numMemObjects, " memList" , memList, " argsMemLoc" , argsMemLoc,
2948
+ " numEventsInWaitList" , numEventsInWaitList,
2949
+ " eventWaitList" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(eventWaitList), numEventsInWaitList),
2950
+ " event" , DebugManager.getEvents (reinterpret_cast <const uintptr_t *>(event), 1 ));
2951
+
2952
+ return retVal;
2924
2953
}
2925
2954
2926
2955
// deprecated OpenCL 1.1
2927
2956
cl_int CL_API_CALL clEnqueueMarker (cl_command_queue commandQueue,
2928
2957
cl_event *event) {
2929
- API_ENTER (0 );
2958
+ cl_int retVal = CL_SUCCESS;
2959
+ API_ENTER (&retVal);
2930
2960
DBG_LOG_INPUTS (" commandQueue" , commandQueue, " cl_event" , event);
2931
2961
2932
2962
auto pCommandQueue = castToObject<CommandQueue>(commandQueue);
2933
2963
if (pCommandQueue) {
2934
- return pCommandQueue->enqueueMarkerWithWaitList (
2964
+ retVal = pCommandQueue->enqueueMarkerWithWaitList (
2935
2965
0 ,
2936
2966
nullptr ,
2937
2967
event);
2968
+ return retVal;
2938
2969
}
2939
- return CL_INVALID_COMMAND_QUEUE;
2970
+ retVal = CL_INVALID_COMMAND_QUEUE;
2971
+ return retVal;
2940
2972
}
2941
2973
2942
2974
// deprecated OpenCL 1.1
@@ -2961,20 +2993,25 @@ cl_int CL_API_CALL clEnqueueWaitForEvents(cl_command_queue commandQueue,
2961
2993
}
2962
2994
2963
2995
retVal = Event::waitForEvents (numEvents, eventList);
2996
+
2964
2997
return retVal;
2965
2998
}
2966
2999
2967
3000
// deprecated OpenCL 1.1
2968
3001
cl_int CL_API_CALL clEnqueueBarrier (cl_command_queue commandQueue) {
2969
- API_ENTER (0 );
3002
+ cl_int retVal = CL_SUCCESS;
3003
+ API_ENTER (&retVal);
3004
+ DBG_LOG_INPUTS (" commandQueue" , commandQueue);
2970
3005
auto pCommandQueue = castToObject<CommandQueue>(commandQueue);
2971
3006
if (pCommandQueue) {
2972
- return pCommandQueue->enqueueBarrierWithWaitList (
3007
+ retVal = pCommandQueue->enqueueBarrierWithWaitList (
2973
3008
0 ,
2974
3009
nullptr ,
2975
3010
nullptr );
3011
+ return retVal;
2976
3012
}
2977
- return CL_INVALID_COMMAND_QUEUE;
3013
+ retVal = CL_INVALID_COMMAND_QUEUE;
3014
+ return retVal;
2978
3015
}
2979
3016
2980
3017
cl_int CL_API_CALL clEnqueueMarkerWithWaitList (cl_command_queue commandQueue,
@@ -3023,11 +3060,11 @@ cl_int CL_API_CALL clEnqueueBarrierWithWaitList(cl_command_queue commandQueue,
3023
3060
if (CL_SUCCESS != retVal) {
3024
3061
return retVal;
3025
3062
}
3026
-
3027
- return pCommandQueue->enqueueBarrierWithWaitList (
3063
+ retVal = pCommandQueue->enqueueBarrierWithWaitList (
3028
3064
numEventsInWaitList,
3029
3065
eventWaitList,
3030
3066
event);
3067
+ return retVal;
3031
3068
}
3032
3069
3033
3070
CL_API_ENTRY cl_command_queue CL_API_CALL
0 commit comments