hcc
hcc copied to clipboard
Copy data from host to hc::array_view using hc::copy fails without calling synchronize
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);
similarly array_view.sychronize_to requires a call to array_view.sychronize
I would have guessed it was implicit