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

[GPU] Use src buffer size for copy_to() call when called for two cldnn::memory objects #29534

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct memory {

virtual event::ptr copy_to(stream& stream, memory& other, bool blocking = true) const {
const auto zero_offset = 0;
const auto data_size = other._bytes_count;
const auto data_size = _bytes_count;
return copy_to(stream, other, zero_offset, zero_offset, data_size, blocking);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,3 +488,15 @@ INSTANTIATE_TEST_SUITE_P(mem_test,
mem_test_params{0, 79, 381},
mem_test_params{100, 79, 381}),
::testing::Values(false, true)));

TEST(mem_test, copy_to_small_to_large) {
auto& ocl_engine = dynamic_cast<ocl::ocl_engine&>(get_test_engine());
auto& stream = get_test_stream();
auto small_buffer_size = 2048;
auto large_buffer_size = 3072;

auto small_buffer = ocl_engine.allocate_memory({{small_buffer_size}, data_types::u8, format::bfyx}, allocation_type::cl_mem, false);
auto large_buffer = ocl_engine.allocate_memory({{large_buffer_size}, data_types::u8, format::bfyx}, allocation_type::cl_mem, false);

OV_ASSERT_NO_THROW(small_buffer->copy_to(stream, *large_buffer, true));
}
Loading