in this part of my code when compile program. this error show: "argument of type "int" is incompatible with parameter of type "const void *". i declare variable as follow:
int *dev_matrix, *dev_array, *dev_array_length;
int array_length=1;
cudaMalloc((void**)&dev_array_length, 1*sizeof(int));
cudaMemcpy(dev_array_length, array_length, 1*sizeof(int), cudaMemcpyHostToDevice);
The second argument to cudaMemcpy()
is wrong. It is meant to be a pointer (const void*
) and you're supplying an int
.
Did you mean to write:
cudaMemcpy(dev_array_length, &array_length, 1*sizeof(int), cudaMemcpyHostToDevice);
^
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With