Skip to content

Commit

Permalink
Merge pull request #1710 from frasercrmck/fix-hip-mem-buffer-fill
Browse files Browse the repository at this point in the history
[HIP] Remove overly restrictive urEnqueueMemBufferFill validation
  • Loading branch information
kbenzie authored Jun 13, 2024
2 parents 94e8395 + 18a13b6 commit 7401931
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
15 changes: 0 additions & 15 deletions source/adapters/hip/enqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,21 +789,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferFill(
ur_event_handle_t *phEvent) {
UR_ASSERT(size + offset <= std::get<BufferMem>(hBuffer->Mem).getSize(),
UR_RESULT_ERROR_INVALID_SIZE);
auto ArgsAreMultiplesOfPatternSize =
(offset % patternSize == 0) || (size % patternSize == 0);

auto PatternIsValid = (pPattern != nullptr);

auto PatternSizeIsValid =
((patternSize & (patternSize - 1)) == 0) && // is power of two
(patternSize > 0) && (patternSize <= 128); // falls within valid range

UR_ASSERT(ArgsAreMultiplesOfPatternSize && PatternIsValid &&
PatternSizeIsValid,
UR_RESULT_ERROR_INVALID_VALUE);
std::ignore = ArgsAreMultiplesOfPatternSize;
std::ignore = PatternIsValid;
std::ignore = PatternSizeIsValid;

std::unique_ptr<ur_event_handle_t_> RetImplEvent{nullptr};
hBuffer->setLastQueueWritingToMemObj(hQueue);
Expand Down
2 changes: 0 additions & 2 deletions test/conformance/enqueue/enqueue_adapter_hip.match
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ urEnqueueKernelLaunchKernelSubGroupTest.Success/AMD_HIP_BACKEND___{{.*}}_
urEnqueueKernelLaunchUSMLinkedList.Success/AMD_HIP_BACKEND___{{.*}}___UsePoolEnabled
{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/AMD_HIP_BACKEND___{{.*}}___copy_row_2D
{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/AMD_HIP_BACKEND___{{.*}}___copy_3d_2d
urEnqueueMemBufferFillTest.Success/AMD_HIP_BACKEND___{{.*}}___size__256__patternSize__256
urEnqueueMemBufferFillTest.Success/AMD_HIP_BACKEND___{{.*}}___size__1024__patternSize__256
{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/AMD_HIP_BACKEND___{{.*}}___write_row_2D
{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/AMD_HIP_BACKEND___{{.*}}___write_3d_2d
urEnqueueUSMAdviseWithParamTest.Success/AMD_HIP_BACKEND___{{.*}}___UR_USM_ADVICE_FLAG_DEFAULT
Expand Down

0 comments on commit 7401931

Please sign in to comment.