Q. If variable a is host variable and dev_a is a device (GPU) variable, to copy input from variable a to variable dev_a select correct statement: (Solved)

1. memcpy( dev_a, &a, size);

2. cudamemcpy( dev_a, &a, size, cudamemcpyhosttodevice );

3. memcpy( (void*) dev_a, &a, size);

4. cudamemcpy( (void*) &dev_a, &a, size, cudamemcpydevicetohost );

  • b. cudamemcpy( dev_a, &a, size, cudamemcpyhosttodevice );
Subscribe Now

Get All Updates & News