Skip to content

Commit f0fc018

Browse files
fabiomestrekbenzie
authored andcommitted
Address review feedback
1 parent 14021f1 commit f0fc018

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

source/adapters/cuda/common.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@
1212
#include <cuda.h>
1313
#include <ur/ur.hpp>
1414

15-
/**
16-
* Call a UR API and, if the result is not UR_RESULT_SUCCESS, automatically
17-
* return from the current function.
18-
*/
19-
#define UR_RETURN_ON_FAILURE(urCall) \
20-
if (const ur_result_t ur_result_macro = urCall; \
21-
ur_result_macro != UR_RESULT_SUCCESS) { \
22-
return ur_result_macro; \
23-
}
24-
2515
ur_result_t mapErrorUR(CUresult Result);
2616

2717
/// Converts CUDA error into UR error codes, and outputs error information

source/adapters/cuda/memory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t hMemory,
475475
switch (propName) {
476476
case UR_IMAGE_INFO_FORMAT:
477477
ur_image_channel_type_t ChannelType;
478-
UR_RETURN_ON_FAILURE(cuda2urFormat(ArrayInfo.Format, &ChannelType));
478+
UR_CHECK_ERROR(cuda2urFormat(ArrayInfo.Format, &ChannelType));
479479
return ReturnValue(
480480
ur_image_format_t{UR_IMAGE_CHANNEL_ORDER_RGBA, ChannelType});
481481
case UR_IMAGE_INFO_WIDTH:
@@ -486,7 +486,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t hMemory,
486486
return ReturnValue(ArrayInfo.Depth);
487487
case UR_IMAGE_INFO_ELEMENT_SIZE:
488488
size_t Size;
489-
UR_RETURN_ON_FAILURE(cudaFormatToElementSize(ArrayInfo.Format, &Size));
489+
UR_CHECK_ERROR(cudaFormatToElementSize(ArrayInfo.Format, &Size));
490490
return ReturnValue(Size);
491491
case UR_IMAGE_INFO_ROW_PITCH:
492492
case UR_IMAGE_INFO_SLICE_PITCH:

0 commit comments

Comments
 (0)