您好,我对CUDA编程有一个疑问。 我有以下代码:
int main () {
for (;;) {
kernel_1 (x1, x2, ....);
kernel_2 (x1, x2 ...);
kernel_3_Reduction (x1);
// code manipulation host_x1
// Copy the pointer device to host
cpy (host_x1, x1, DeviceToHost)
cpu_code_x1_manipulation;
kernel_ (x1, x2, ....);
}
}
那么,何时制作副本并如何确保kernel_1、kernel_2和kernel_3完成了它们的任务?