From 7bb70225c83a5338857e28a5e9a0d9780e45a36d Mon Sep 17 00:00:00 2001 From: JackAKirk Date: Thu, 11 Jan 2024 09:32:35 -0800 Subject: [PATCH] Fixed bug where sizeof(int) was used even if T!=int. Signed-off-by: JackAKirk --- tests/queue/queue_shortcuts_usm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/queue/queue_shortcuts_usm.h b/tests/queue/queue_shortcuts_usm.h index 67351aaaf..2861e5bd6 100644 --- a/tests/queue/queue_shortcuts_usm.h +++ b/tests/queue/queue_shortcuts_usm.h @@ -258,11 +258,11 @@ void test_unified_shared_memory(sycl::queue q, unsigned int element_count) { T* ptr = sycl::malloc_device(element_count, q); constexpr int advice = 0; sycl::event advise_no_events = - q.mem_advise(ptr, element_count * sizeof(int), advice); + q.mem_advise(ptr, element_count * sizeof(T), advice); sycl::event advise_single_event = q.mem_advise( - ptr, element_count * sizeof(int), advice, advise_no_events); + ptr, element_count * sizeof(T), advice, advise_no_events); sycl::event advise_multiple_events = - q.mem_advise(ptr, element_count * sizeof(int), advice, + q.mem_advise(ptr, element_count * sizeof(T), advice, {advise_no_events, advise_single_event}); advise_multiple_events.wait(); advise_no_events.wait();