Skip to content

Commit 17ddb96

Browse files
authored
small fix for initialization of device memory from host directly (#890)
1 parent b2b8729 commit 17ddb96

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dpnp/backend/src/memory_sycl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,13 @@ char* dpnp_memory_alloc_c(size_t size_in_bytes)
6868
}
6969

7070
#if not defined(NDEBUG)
71+
if (memory_type != cl::sycl::usm::alloc::device)
72+
{
7173
for (size_t i = 0; i < size_in_bytes / sizeof(char); ++i)
7274
{
7375
array[i] = 0; // type dependant is better. set double(42.42) instead zero
7476
}
77+
}
7578
// std::cout << ") -> ptr=" << (void*)array << std::endl;
7679
#endif
7780
}

0 commit comments

Comments
 (0)