Passing an struct including a pointer to another struct, to kernel in CUDA

落爺英雄遲暮 提交于 2019-12-01 14:39:51
Robert Crovella

You're dereferencing a host pointer on the device. X is a valid device pointer.

But when you copied the X struct to the device, you copied x along with it, which contains a host pointer. When you dereference that pointer:

collapsed x = X->x[0];
                 ^ this is dereferencing the x pointer

the device code throws an error.

More detail is given here as well as instructions on how to fix it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!