pycuda -- different values running the same program
===

I am using pycuda and i have the following problem.
I initialize the matrices as below:

    #---- Initialization and passing(allocate memory and transfer data) to GPU -------------------------
    Rs_gpu=gpuarray.to_gpu(np.zeros(3).astype(np.float32))
    Rp_gpu=gpuarray.to_gpu(np.array([1000,0,0]).astype(np.float32))
    
    J_gpu=gpuarray.to_gpu(np.array([1+0j,1+0j,1+0j]).astype(np.complex64))
    M_gpu=gpuarray.to_gpu(np.array([1+0j,1+0j,1+0j]).astype(np.complex64))
    
    Evec_gpu=gpuarray.to_gpu(np.zeros(3).astype(np.complex64))
    Hvec_gpu=gpuarray.to_gpu(np.zeros(3).astype(np.complex64))
    All_gpu=gpuarray.to_gpu(np.zeros(3).astype(np.float32))

and i am taking some values ,lets call them ' A '.

Now,if i change the matrices to :

    Rs_gpu=gpuarray.to_gpu(np.random.rand(numPointsRs*3).astype(np.float32))
    Rp_gpu=gpuarray.to_gpu(np.random.rand(numPointsRp*3).astype(np.float32))
    J_gpu=gpuarray.to_gpu(np.random.rand(numPointsRs*3).astype(np.complex64))
    M_gpu=gpuarray.to_gpu(np.random.rand(numPointsRs*3).astype(np.complex64))
    
    Evec_gpu=gpuarray.to_gpu(np.zeros(numPointsRp*3).astype(np.complex64))
    Hvec_gpu=gpuarray.to_gpu(np.zeros(numPointsRp*3).astype(np.complex64))
    All_gpu=gpuarray.to_gpu(np.zeros(3).astype(np.float32))

i am taking of course some other values,lets call them 'B'.

But ,when i use again the initial matrices i am taking different results from the initial!!
I should get 'A' again but i am taking 'C'.

What this problem means? Sth wrong with the memory?

Thanks!

(Unfortunately i can't post the code (its big))