Skip to content

Commit 9cc651d

Browse files
committed
[UR] Fixed bug with zero depth rect_region which must be checked before
Fixed functions: - urEnqueueMemBufferWriteRect() - urEnqueueMemBufferReadRect()
1 parent 37df391 commit 9cc651d

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

unified-runtime/include/ur_api.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/scripts/core/enqueue.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ returns:
328328
- "An event in `phEventWaitList` has $X_EVENT_STATUS_ERROR."
329329
- $X_RESULT_ERROR_INVALID_MEM_OBJECT
330330
- $X_RESULT_ERROR_INVALID_SIZE:
331-
- "`region.width == 0 || region.height == 0 || region.width == 0`"
331+
- "`region.width == 0 || region.height == 0 || region.depth == 0`"
332332
- "`bufferRowPitch != 0 && bufferRowPitch < region.width`"
333333
- "`hostRowPitch != 0 && hostRowPitch < region.width`"
334334
- "`bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`"
@@ -406,7 +406,7 @@ returns:
406406
- "An event in `phEventWaitList` has $X_EVENT_STATUS_ERROR."
407407
- $X_RESULT_ERROR_INVALID_MEM_OBJECT
408408
- $X_RESULT_ERROR_INVALID_SIZE:
409-
- "`region.width == 0 || region.height == 0 || region.width == 0`"
409+
- "`region.width == 0 || region.height == 0 || region.depth == 0`"
410410
- "`bufferRowPitch != 0 && bufferRowPitch < region.width`"
411411
- "`hostRowPitch != 0 && hostRowPitch < region.width`"
412412
- "`bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`"

unified-runtime/source/adapters/hip/enqueue.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferReadRect(
506506
UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST);
507507
UR_ASSERT(!(phEventWaitList != NULL && numEventsInWaitList == 0),
508508
UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST);
509-
UR_ASSERT(!(region.width == 0 || region.height == 0 || region.width == 0),
509+
UR_ASSERT(!(region.width == 0 || region.height == 0 || region.depth == 0),
510510
UR_RESULT_ERROR_INVALID_SIZE);
511511
UR_ASSERT(!(bufferRowPitch != 0 && bufferRowPitch < region.width),
512512
UR_RESULT_ERROR_INVALID_SIZE);

unified-runtime/source/loader/layers/validation/ur_valddi.cpp

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/source/loader/ur_libapi.cpp

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/source/ur_api.cpp

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ TEST_P(urEnqueueMemBufferCopyRectTest, InvalidNullPtrEventWaitList) {
240240
TEST_P(urEnqueueMemBufferCopyRectTest, InvalidSize) {
241241
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
242242

243-
// region.width == 0 || region.height == 0 || region.width == 0
243+
// region.width == 0 || region.height == 0 || region.depth == 0
244244
src_region.width = 0;
245245
ASSERT_EQ_RESULT(urEnqueueMemBufferCopyRect(
246246
queue, src_buffer, dst_buffer, src_origin, dst_origin,

unified-runtime/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ TEST_P(urEnqueueMemBufferReadRectTest, InvalidSize) {
197197

198198
std::vector<uint32_t> dst(count);
199199

200-
// region.width == 0 || region.height == 0 || region.width == 0
200+
// region.width == 0 || region.height == 0 || region.depth == 0
201201
region.width = 0;
202202
ASSERT_EQ_RESULT(urEnqueueMemBufferReadRect(
203203
queue, buffer, true, buffer_offset, host_offset, region,

unified-runtime/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ TEST_P(urEnqueueMemBufferWriteRectTest, InvalidSize) {
210210
std::vector<uint32_t> src(count);
211211
std::fill(src.begin(), src.end(), 1);
212212

213-
// region.width == 0 || region.height == 0 || region.width == 0
213+
// region.width == 0 || region.height == 0 || region.depth == 0
214214
region.width = 0;
215215
ASSERT_EQ_RESULT(urEnqueueMemBufferWriteRect(
216216
queue, buffer, true, buffer_offset, host_offset, region,

0 commit comments

Comments
 (0)