Dear all,
sorry for the delayed answer, I have problem with installation. But now
everything is just fine.
So, I have installed Scikit (as it was proposed from GitHub) and CULA.
I am confused. I'd like to solve very simple system A*X = B, but it
raises the error:
*TypeError: only length-1 arrays can be converted to python scalars.*
Could you please tell me, what is going wrong?
I suppose, that I do everything wrong. Even if it works...how to obtain
parallelization? From the example by Andreas, he used SourceModule with
C language and for me it is obvious, what is happen there.
But here, I cannot understand. I have tried to write "own" SourceModule
and call functions from CULA - but when I try to manipulate with memory
or write function - comes error - that I cannot do that from __device__
/__global__.
Oh...I am stuck (
Could you please make a code corrections and give me an answers! Find
please py-file in attach.
Best regards,
Evgeny
Am 23.02.2014 15:03, schrieb Lev Givon:
Received from Evgeny Lazutkin on Sun, Feb 23, 2014 at 03:53:12AM EST:
Dear Andreas, dear all,
thank you very much! I will install this package and perform the
sample code! I hope after that you can correct me.
Best regards,
Evgeny
I suggest that you install the latest revision of the package from GitHub rather
than the tarball on PyPI. If you encounter any problems, feel free to submit a
report via the project's GitHub issue tracker (scikits.cuda is developed
separately from pycuda).
import pycuda.driver as drv
import pycuda.tools
import pycuda.autoinit
import numpy
from pycuda.compiler import SourceModule
import pycuda.gpuarray as gpuarray
import pycuda.cumath
from numpy import *
from scikits.cuda.cula import *
from scikits import *
from scipy import *
A = array([[ 5.18649167 , 0. , 1.03279556 , 0. , -0.14549722, 0.
, 0. , 0. , 0. , 0. , 0. , 0. ],
[-5.0819889 , 0., 2.52459667, 0., 0.64549722 , 0. ,
0. , 0., 0. , 0. , 0. , 0. ],
[ 9.01848057, 0. , -8.13118224, 0. , 5.18649167, 0. ,
0. , 0., 0. , 0. , 0. , 0. ],
[-0.5 , 4.43649167, 0. , 1.03279556, 0. , -0.14549722,
0. , 0. , 0. , 0. , 0. , 0. ],
[ 0. , -5.0819889 ,-0.5, 1.77459667 , 0. , 0.64549722,
0. , 0. , 0. , 0. , 0. , 0. ],
[ 0. , 9.01848057 ,0., -8.13118224, -0.5 , 4.43649167,
0. , 0. , 0. , 0. , 0. , 0. ],
[ 0. , 0. ,0., 0. , 0. , 0. ,
5.18649167 , 0. , 1.03279556 , 0. , -0.14549722 , 0. ],
[ 0. , 0. ,0., 0. , 0. , 0. ,
-5.0819889 , 0. , 2.52459667 , 0. , 0.64549722 , 0. ],
[ 0. , 0. ,0., 0. , 0., 0. ,
9.01848057 , 0. , -8.13118224 , 0. , 5.18649167 , 0. ],
[ 0. , 0. , 0. , 0. , 0. , 0. ,
-0.5 , 4.43649167, 0. , 1.03279556 , 0. , -0.14549722] ,
[ 0. , 0. , 0. , 0. , 0. , 0. ,
0. , -5.0819889 , -0.5 , 1.77459667 , 0. , 0.64549722] ,
[ 0. , 0. , 0. , 0. , 0. , 0. ,
0. , 9.01848057 , 0. , -8.13118224, -0.5 , 4.43649167]], dtype =
float)
B = array([[-5.32379001 , 0. , 0., 0. ],
[ 2.661895 , 0. , 0., 0. ],
[-5.32379001, 0. , 0. , 0. ],
[ 0. , -5.32379001, 0. , 0. ],
[ 0. , 2.661895 , 0. , 0. ],
[ 0. , -5.32379001, 0. , 0. ],
[ 0. , 0. , -5.32379001, 0. ],
[ 0. , 0. , 2.661895 , 0. ],
[ 0. , 0., -5.32379001, 0. ],
[ 0. , 0., 0. , -5.32379001],
[ 0. , 0., 0. , 2.661895 ],
[ 0. , 0., 0. , -5.32379001]], dtype = float)
# culaDeviceSgesv(n, nrhs, a, lda, ipiv, b, ldb):
culaInitialize()
culaDeviceSgesv(12, 4 , A, 12, 12, B, 12)
_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda