Thank you Andreas for your answer,

Instead of slicing, I can't copy the elements that I need in another
gpuarray vector for example?
I found this method from Cublas

import pycuda.autoinit
import pycuda.gpuarray as gpuarray
import numpy as np
x = np.random.rand(5).astype(np.float32)
y = np.random.rand(5).astype(np.float32)
x_gpu = gpuarray.to_gpu(x)
y_gpu = gpuarray.to_gpu(y)
d = cublasSdot(x_gpu.size, x_gpu.gpudata, 1, y_gpu.gpudata, 1)
np.allclose(d, np.dot(x, y))

But here both of x_gpu.gpudata points on the first element of the gpuarray
x_gpu. Is there any way to point on the element j ?

Thaks again :)
-- 
View this message in context: 
http://pycuda.2962900.n2.nabble.com/Doing-some-instructions-on-some-elements-of-a-matrix-on-GPU-memory-tp6046090p6052343.html
Sent from the PyCuda mailing list archive at Nabble.com.

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

Reply via email to