Comments (10)
You can pass a_gpu.gpudata to the wrapper function; it gets cast to an integer that corresponds to the pointer value.
from scikit-cuda.
still not working :
cula.culaDeviceSgetrf(m,n,a_gpu.gpudata,n,n)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/scikits.cuda-0.042-py2.7.egg/scikits/cuda/cula.py", line 330, in culaDeviceSgetrf
culaCheckStatus(status)
File "/usr/local/lib/python2.7/dist-packages/scikits.cuda-0.042-py2.7.egg/scikits/cuda/cula.py", line 210, in culaCheckStatus
raise culaExceptionsstatus
scikits.cuda.cula.culaDataError: 3
from scikit-cuda.
Can you please post the code that you are trying to run? The snippet in your initial posting is incomplete.
from scikit-cuda.
This is what I'm trying to do:
import pycuda.gpuarray as gpuarray
import pycuda.autoinit
import scikits.cuda.cula as cula
Can you run that on your system? I'm using cula 12 full version.
cula.culaInitialize()
a=np.array([[1,2,3,4],[6,7,8,9],[7,2,3,5],[2,4,5,6]])
n=m=ida=ipiv=a.shape[0]
a_gpu=gpuarray.to_gpu(a)
result=cula.culaDeviceSgetrf(m, n, a_gpu.gpudata, ida, ipiv)
print result
cula.culaShutdown()
from scikit-cuda.
Thanks. You are getting the data error because the array a
doesn't contain single precision floats. Also, the ipiv
parameter must be a pointer to an integer array, not a scalar.
from scikit-cuda.
Thanks for your reply. Ok so for fixing the first problem I should make "a" like :
a=np.array([[1,2,3,4],[6,7,8,9],[7,2,3,5],[2,4,5,6]], dtype=np.float32)
but I dont know how to fix the ipiv. Actually I dont understand what is ipiv . can tell me more about it?
from scikit-cuda.
ipiv
contains the 1-offset indices of the pivots determined during the decomposition. You don't need to set ipiv
; just allocate an empty int32
array in GPU memory and pass its gpudata
attribute to the function. See the GETRF entry in the CULA Reference manual for more information.
from scikit-cuda.
I get "None" after that . this is my code(I think I allocate the empty array in wrong way ):
a=np.array([[1,2,3,4],[6,7,8,9],[7,2,3,5],[2,4,5,6]], dtype=np.float32)
n=m=ida=a.shape[0]
ipiv=np.empty(n,dtype=np.int32)
ipiv_gpu=gpuarray.to_gpu(ipiv)
a_gpu=gpuarray.to_gpu(a)
result=cula.culaDeviceSgetrf(m, n, a_gpu.gpudata, ida, ipiv_gpu.gpudata)
print result
when I define it like :
ipiv=np.array([],dtype=np.int32)
I get:
status = _libcula.culaDeviceSgetrf(m, n, int(a), lda, int(ipiv))
TypeError: int() argument must be a string or a number, not 'NoneType'
from scikit-cuda.
Your code is correct; the CULA reference manual indicates that ipiv
should have length min(m,n)
. Note also that the returned value of the function is its execution status, not the result of the computation.
from scikit-cuda.
yes It's working now.I expected the result to have the answer not status. Thanks alot!
from scikit-cuda.
Related Issues (20)
- Batch Matrix Multiplication using CuBLAS
- np.float() is deprecated in NumPy 1.20, which is used in misc.py HOT 1
- add birch, a cluster algorithm, please!!!! HOT 2
- linalg.misc.mult_matvec protential bug for Fortran Matrix-vector element wise mulitplication HOT 1
- skcuda.linalg.eig - return eigenvector, index issue ?
- test failed
- Schedule for 0.5.4 release? HOT 2
- Error while importing skcuda.linalg HOT 4
- CUSOLVER library only available in CUDA 7.0 and later
- skcuda.linalg.cho_solve API different than in scipy.linalg HOT 1
- cusolver.py can't import cusolver64_11.dll
- gpuarray fail to transpose and flatten after cublas.Sgemm
- ValueError with linalg.dot when transa=True HOT 1
- Can not install pycuda to Azure Container Instances with v100 HOT 1
- Missing `cublasSetMatrix` compared with CUDA documentation HOT 1
- `pycuda._driver.LogicError: cuMemAlloc failed: context is destroyed` (caused by scikit-cuda or even CUDA itself?) HOT 1
- qr decomposition HOT 1
- Calling cublasDgetrfBatched failed with pycuda
- UPDATE WINDOW NAME
- cufft library not found
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scikit-cuda.