From 18a13b68d75038aabd2f24a1fda82bb6879f0b81 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 4 Jun 2024 17:29:40 +0100 Subject: [PATCH] [HIP] Remove overly restrictive urEnqueueMemBufferFill validation As noted in CUDA adapter commit 00761dc4, the validation for this entry point was changed in commit 2c533e6a and hoisted into the validation layer. The restriction on the pattern size being at most 128 was removed in 00761dc4, 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. --- source/adapters/hip/enqueue.cpp | 15 --------------- .../conformance/enqueue/enqueue_adapter_hip.match | 2 -- 2 files changed, 17 deletions(-) diff --git a/source/adapters/hip/enqueue.cpp b/source/adapters/hip/enqueue.cpp index aa3af35040..ff58d1d1ea 100644 --- a/source/adapters/hip/enqueue.cpp +++ b/source/adapters/hip/enqueue.cpp @@ -857,21 +857,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferFill( ur_event_handle_t *phEvent) { UR_ASSERT(size + offset <= std::get(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 RetImplEvent{nullptr}; diff --git a/test/conformance/enqueue/enqueue_adapter_hip.match b/test/conformance/enqueue/enqueue_adapter_hip.match index 7df8b1b2c9..443628e36e 100644 --- a/test/conformance/enqueue/enqueue_adapter_hip.match +++ b/test/conformance/enqueue/enqueue_adapter_hip.match @@ -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