@@ -987,8 +987,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead(
987
987
const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) {
988
988
UR_ASSERT (hImage->isImage (), UR_RESULT_ERROR_INVALID_MEM_OBJECT);
989
989
990
- ur_result_t Result = UR_RESULT_SUCCESS;
991
-
992
990
ur_lock MemoryMigrationLock{hImage->MemoryMigrationMutex };
993
991
auto Device = hQueue->getDevice ();
994
992
hipStream_t HIPStream = hQueue->getNextTransferStream ();
@@ -1039,13 +1037,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead(
1039
1037
UR_CHECK_ERROR (RetImplEvent->start ());
1040
1038
}
1041
1039
1042
- Result = commonEnqueueMemImageNDCopy (HIPStream, ImgType, AdjustedRegion,
1043
- Array, hipMemoryTypeArray, SrcOffset,
1044
- pDst, hipMemoryTypeHost, nullptr );
1045
-
1046
- if (Result != UR_RESULT_SUCCESS) {
1047
- return Result;
1048
- }
1040
+ UR_CHECK_ERROR (commonEnqueueMemImageNDCopy (
1041
+ HIPStream, ImgType, AdjustedRegion, Array, hipMemoryTypeArray,
1042
+ SrcOffset, pDst, hipMemoryTypeHost, nullptr ));
1049
1043
1050
1044
if (phEvent) {
1051
1045
UR_CHECK_ERROR (RetImplEvent->record ());
@@ -1061,7 +1055,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead(
1061
1055
return UR_RESULT_ERROR_UNKNOWN;
1062
1056
}
1063
1057
return UR_RESULT_SUCCESS;
1064
- return Result;
1065
1058
}
1066
1059
1067
1060
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageWrite (
@@ -1071,15 +1064,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageWrite(
1071
1064
const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) {
1072
1065
UR_ASSERT (hImage->isImage (), UR_RESULT_ERROR_INVALID_MEM_OBJECT);
1073
1066
1074
- ur_result_t Result = UR_RESULT_SUCCESS;
1075
-
1076
1067
try {
1077
1068
ScopedContext Active (hQueue->getDevice ());
1078
1069
hipStream_t HIPStream = hQueue->getNextTransferStream ();
1079
1070
1080
1071
if (phEventWaitList) {
1081
- Result = enqueueEventsWait (hQueue, HIPStream, numEventsInWaitList,
1082
- phEventWaitList);
1072
+ UR_CHECK_ERROR ( enqueueEventsWait (hQueue, HIPStream, numEventsInWaitList,
1073
+ phEventWaitList) );
1083
1074
}
1084
1075
1085
1076
hipArray *Array =
@@ -1107,13 +1098,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageWrite(
1107
1098
UR_CHECK_ERROR (RetImplEvent->start ());
1108
1099
}
1109
1100
1110
- Result = commonEnqueueMemImageNDCopy (HIPStream, ImgType, AdjustedRegion,
1111
- pSrc, hipMemoryTypeHost, nullptr ,
1112
- Array, hipMemoryTypeArray, DstOffset);
1113
-
1114
- if (Result != UR_RESULT_SUCCESS) {
1115
- return Result;
1116
- }
1101
+ UR_CHECK_ERROR (commonEnqueueMemImageNDCopy (
1102
+ HIPStream, ImgType, AdjustedRegion, pSrc, hipMemoryTypeHost, nullptr ,
1103
+ Array, hipMemoryTypeArray, DstOffset));
1117
1104
1118
1105
if (phEvent) {
1119
1106
UR_CHECK_ERROR (RetImplEvent->record ());
@@ -1126,8 +1113,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageWrite(
1126
1113
}
1127
1114
1128
1115
return UR_RESULT_SUCCESS;
1129
-
1130
- return Result;
1131
1116
}
1132
1117
1133
1118
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageCopy (
0 commit comments