什么是两者之间的区别?
我应该如何将一个int类型的值从主机复制到设备? 这是我使用的代码。
cudaMemcpy and cudaMemset??
我应该如何将一个int类型的值从主机复制到设备? 这是我使用的代码。
int addXdir = 1;
int devAddXdir;
cudaMalloc((void**)&devAddXdir, sizeof(int));
cudaMemcpy(devAddXdir, addXdir, sizeof(int), cudaMemcpyHostToDevice);
程序报出如下错误: error: argument of type "int" is incompatible with parameter of type "void *" error: argument of type "int" is incompatible with parameter of type "const void *"