@@ -339,14 +339,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
339339 UR_RESULT_ERROR_INVALID_VALUE);
340340 }
341341
342- hipGraphNode_t GraphNode;
343- std::vector<hipGraphNode_t> DepsList;
342+ try {
343+ hipGraphNode_t GraphNode;
344+ std::vector<hipGraphNode_t> DepsList;
344345
345- UR_CHECK_ERROR (getNodesFromSyncPoints (hCommandBuffer, numSyncPointsInWaitList,
346- pSyncPointWaitList, DepsList));
346+ UR_CHECK_ERROR (getNodesFromSyncPoints (
347+ hCommandBuffer, numSyncPointsInWaitList, pSyncPointWaitList, DepsList));
347348
348- if (*pGlobalWorkSize == 0 ) {
349- try {
349+ if (*pGlobalWorkSize == 0 ) {
350350 // Create an empty node if the kernel workload size is zero
351351 UR_CHECK_ERROR (hipGraphAddEmptyNode (&GraphNode, hCommandBuffer->HIPGraph ,
352352 DepsList.data (), DepsList.size ()));
@@ -356,24 +356,20 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
356356 if (pSyncPoint) {
357357 *pSyncPoint = SyncPoint;
358358 }
359- } catch (ur_result_t Err) {
360- return Err;
359+ return UR_RESULT_SUCCESS;
361360 }
362- return UR_RESULT_SUCCESS;
363- }
364361
365- // Set the number of threads per block to the number of threads per warp
366- // by default unless user has provided a better number
367- size_t ThreadsPerBlock[3 ] = {64u , 1u , 1u };
368- size_t BlocksPerGrid[3 ] = {1u , 1u , 1u };
362+ // Set the number of threads per block to the number of threads per warp
363+ // by default unless user has provided a better number
364+ size_t ThreadsPerBlock[3 ] = {64u , 1u , 1u };
365+ size_t BlocksPerGrid[3 ] = {1u , 1u , 1u };
369366
370- uint32_t LocalSize = hKernel->getLocalSize ();
371- hipFunction_t HIPFunc = hKernel->get ();
372- UR_CHECK_ERROR (setKernelParams (
373- hCommandBuffer->Device , workDim, pGlobalWorkOffset, pGlobalWorkSize,
374- pLocalWorkSize, hKernel, HIPFunc, ThreadsPerBlock, BlocksPerGrid));
367+ uint32_t LocalSize = hKernel->getLocalSize ();
368+ hipFunction_t HIPFunc = hKernel->get ();
369+ UR_CHECK_ERROR (setKernelParams (
370+ hCommandBuffer->Device , workDim, pGlobalWorkOffset, pGlobalWorkSize,
371+ pLocalWorkSize, hKernel, HIPFunc, ThreadsPerBlock, BlocksPerGrid));
375372
376- try {
377373 // Set node param structure with the kernel related data
378374 auto &ArgIndices = hKernel->getArgIndices ();
379375 hipKernelNodeParams NodeParams;
0 commit comments