/* Create device buffers for a, b, c and transfer data from Host -> Device for a,b */ #pragma omp target data map(to:a[0:size], b[0:size]) map(from:c[0:size]) {/* Existing device buffers are used and no data is transferred here */#pragma omp target{int i;#pragma omp parallel forfor (i = 0; i < size; i++)c[i] += a[i] + b[i];} } /* Device -> Host data transfer of buffer c is done here*/
请问,红色部分加了data和不加data有什么区别?如果直接把红色这一句替换掉绿色这一句有什么区别?
Nancy Wang:
请参考:
downloads.ti.com/…/supported_constructs.html
blog.csdn.net/…/79031502
,
Chenxi Wang:
能通俗的解释一下吗?这俩文档我都看过了。