Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][HIP] Fix MemBufferFill for nvidia platform #4629

Merged
merged 3 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sycl/plugins/hip/pi_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3863,8 +3863,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 @@ -3912,7 +3911,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 *>(
smaslov-intel marked this conversation as resolved.
Show resolved Hide resolved
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