Skip to content

Commit cee76d9

Browse files
authored
[SYCL][HIP] Fix MemBufferFill for nvidia platform (#4629)
1 parent b3977b5 commit cee76d9

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

sycl/plugins/hip/pi_hip.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3866,8 +3866,7 @@ pi_result hip_piEnqueueMemBufferFill(pi_queue command_queue, pi_mem buffer,
38663866
result = retImplEv->start();
38673867
}
38683868

3869-
auto dstDevice =
3870-
(uint8_t *)buffer->mem_.buffer_mem_.get_with_offset(offset);
3869+
auto dstDevice = buffer->mem_.buffer_mem_.get_with_offset(offset);
38713870
auto stream = command_queue->get();
38723871
auto N = size / pattern_size;
38733872

@@ -3915,7 +3914,8 @@ pi_result hip_piEnqueueMemBufferFill(pi_queue command_queue, pi_mem buffer,
39153914
value = *(static_cast<const uint8_t *>(pattern) + step);
39163915

39173916
// offset the pointer to the part of the buffer we want to write to
3918-
auto offset_ptr = dstDevice + (step * sizeof(uint8_t));
3917+
auto offset_ptr = reinterpret_cast<void *>(
3918+
reinterpret_cast<uint8_t *>(dstDevice) + (step * sizeof(uint8_t)));
39193919

39203920
// set all of the pattern chunks
39213921
result = PI_CHECK_ERROR(hipMemset2DAsync(

sycl/unittests/pi/EnqueueMemTest.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ class EnqueueMemTest : public testing::TestWithParam<detail::plugin> {
7474

7575
detail::plugin plugin = GetParam();
7676

77-
if (plugin.getBackend() == sycl::backend::hip && sizeof(T) > 4) {
78-
std::cerr << "HIP plugin doesn't support patterns larger than 4 bytes, "
79-
"skipping\n";
80-
GTEST_SKIP();
81-
}
82-
8377
T inValues[_numElementsX] = {};
8478

8579
for (size_t i = 0; i < _numElementsX; ++i) {

0 commit comments

Comments
 (0)