Skip to content

Commit 18a13b6

Browse files
committed
[HIP] Remove overly restrictive urEnqueueMemBufferFill validation
As noted in CUDA adapter commit 00761dc, the validation for this entry point was changed in commit 2c533e6 and hoisted into the validation layer. The restriction on the pattern size being at most 128 was removed in 00761dc, and I can't see a reason for it being in the HIP adapter save for the fact that it was copied from the CUDA adapter.
1 parent 399430d commit 18a13b6

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

source/adapters/hip/enqueue.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -857,21 +857,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferFill(
857857
ur_event_handle_t *phEvent) {
858858
UR_ASSERT(size + offset <= std::get<BufferMem>(hBuffer->Mem).getSize(),
859859
UR_RESULT_ERROR_INVALID_SIZE);
860-
auto ArgsAreMultiplesOfPatternSize =
861-
(offset % patternSize == 0) || (size % patternSize == 0);
862-
863-
auto PatternIsValid = (pPattern != nullptr);
864-
865-
auto PatternSizeIsValid =
866-
((patternSize & (patternSize - 1)) == 0) && // is power of two
867-
(patternSize > 0) && (patternSize <= 128); // falls within valid range
868-
869-
UR_ASSERT(ArgsAreMultiplesOfPatternSize && PatternIsValid &&
870-
PatternSizeIsValid,
871-
UR_RESULT_ERROR_INVALID_VALUE);
872-
std::ignore = ArgsAreMultiplesOfPatternSize;
873-
std::ignore = PatternIsValid;
874-
std::ignore = PatternSizeIsValid;
875860

876861
std::unique_ptr<ur_event_handle_t_> RetImplEvent{nullptr};
877862

test/conformance/enqueue/enqueue_adapter_hip.match

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ urEnqueueKernelLaunchKernelSubGroupTest.Success/AMD_HIP_BACKEND___{{.*}}_
55
urEnqueueKernelLaunchUSMLinkedList.Success/AMD_HIP_BACKEND___{{.*}}___UsePoolEnabled
66
{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/AMD_HIP_BACKEND___{{.*}}___copy_row_2D
77
{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/AMD_HIP_BACKEND___{{.*}}___copy_3d_2d
8-
urEnqueueMemBufferFillTest.Success/AMD_HIP_BACKEND___{{.*}}___size__256__patternSize__256
9-
urEnqueueMemBufferFillTest.Success/AMD_HIP_BACKEND___{{.*}}___size__1024__patternSize__256
108
{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/AMD_HIP_BACKEND___{{.*}}___write_row_2D
119
{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/AMD_HIP_BACKEND___{{.*}}___write_3d_2d
1210
urEnqueueUSMAdviseWithParamTest.Success/AMD_HIP_BACKEND___{{.*}}___UR_USM_ADVICE_FLAG_DEFAULT

0 commit comments

Comments
 (0)