Skip to content

Commit

Permalink
[SYCL][HIP] Fix MemBufferFill for nvidia platform (#4629)
Browse files Browse the repository at this point in the history
  • Loading branch information
AidanBeltonS authored Sep 30, 2021
1 parent b3977b5 commit cee76d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 3 additions & 3 deletions sycl/plugins/hip/pi_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3866,8 +3866,7 @@ pi_result hip_piEnqueueMemBufferFill(pi_queue command_queue, pi_mem buffer,
result = retImplEv->start();
}

auto dstDevice =
(uint8_t *)buffer->mem_.buffer_mem_.get_with_offset(offset);
auto dstDevice = buffer->mem_.buffer_mem_.get_with_offset(offset);
auto stream = command_queue->get();
auto N = size / pattern_size;

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

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

// set all of the pattern chunks
result = PI_CHECK_ERROR(hipMemset2DAsync(
Expand Down
6 changes: 0 additions & 6 deletions sycl/unittests/pi/EnqueueMemTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ class EnqueueMemTest : public testing::TestWithParam<detail::plugin> {

detail::plugin plugin = GetParam();

if (plugin.getBackend() == sycl::backend::hip && sizeof(T) > 4) {
std::cerr << "HIP plugin doesn't support patterns larger than 4 bytes, "
"skipping\n";
GTEST_SKIP();
}

T inValues[_numElementsX] = {};

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

0 comments on commit cee76d9

Please sign in to comment.