On Mon, 11 Jul 2011 18:07:18 +0400, Mikhail Korobko wrote:
Hello,

 I have another problem with my program.
 I want to do a loop inside the kernel(in the loop I do sclar
multiplication of two vectors), but I don't know how. I created a
__device__ function with scalar multiplication(using threads) and
__global__ function with only loop invoking __device__ function. It
works, but for some reason I get different results each time. And
instead of different numbers in the result array, I get the array
filled with same numbers. I think, it appears because memory hasn't
been cleaned.
 But function free() invokes an error:

error: calling a host function from a __device__/__global__ function
is not allowed
 Honestly speaking, I've tried everything I can imagine, but failed,
maybe you can help me=)

IIRC, before CUDA 4.1, there's no way to call free() on the device. And even then, I don't think it'll do what you think it does, which is to free host-allocated memory, right? That said, I also don't think it's likely that your bug is related to free(), but of course I haven't seen your code. (not that I necessarily want to)

Andreas

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to