hcc icon indicating copy to clipboard operation
hcc copied to clipboard

Copy data from host to hc::array_view using hc::copy fails without calling synchronize

Open misos1 opened this issue 7 years ago • 1 comments

I would expect that this will work but it causes segmentation fault:

int arr_host[100];
hc::array_view<int> arr(100);
hc::copy(arr_host, arr);

Seems I need to call synchronize before copy:

int arr_host[100];
hc::array_view<int> arr(100);
arr.synchronize();
hc::copy(arr_host, arr);

misos1 avatar Sep 09 '18 20:09 misos1

similarly array_view.sychronize_to requires a call to array_view.sychronize

I would have guessed it was implicit

PhilipDeegan avatar Dec 17 '18 18:12 PhilipDeegan