Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8466811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:27:08+00:00 2026-06-10T15:27:08+00:00

I want to use some of cula functionality like LU factorization or Matrix inverse

  • 0

I want to use some of cula functionality like LU factorization or Matrix inverse but I have some problem regarding the pointer inputs. for example for doing LU factorization with scikits.cuda.cula.culaDeviceSgetrf(m, n, a, lda, ipiv) , one need to use pointer f “a” argument but there is no pointer in python explicitly(I know all variables in python are by ref) . So what should I do in this case? should I use ctype library to create python?

this is what I am trying to do:

   import numpy as np

   import scikits.cuda.cula as cula
   import pycuda.gpuarray as gpuarray

   cula.culaInitialize()

   //I create a square matrix for simplicity 
   a=np.array([[1,2,3,4],[6,7,8,9],[7,2,3,5],[2,4,5,6]])

   n=b.shape[0]
   ida=ipv=m

   scikits.cuda.cula.culaDeviceSgetrf(m,n,a,n,n)

status = _libcula.culaDeviceSgetrf(m, n, int(a), lda, int(ipiv))
TypeError: only length-1 arrays can be converted to Python scalars

and when I try

a_gpu = gpuarray.to_gpu(a)
scikits.cuda.cula.culaDeviceSgetrf(m,n,a_gpu,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 329, in culaDeviceSgetrf status = _libcula.culaDeviceSgetrf(m, n,
int(a), lda, int(ipiv)) TypeError: int() argument must be a string or
a number, not ‘GPUArray’

any solution ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:27:10+00:00Added an answer on June 10, 2026 at 3:27 pm

    The error message is pretty self explanatory. You cannot pass a gpuarray directly to these routines, the array argument is expected to be a device pointer which is internally cast to a Python ctypes.c_void_p for passing to the CULA library. PyCUDA’s gpuarray includes a member ptr which will return the underlying pointer to the GPU memory.

    If you do something like:

    a_gpu = gpuarray.to_gpu(a)
    scikits.cuda.cula.culaDeviceSgetrf(m,n,a_gpu.ptr,n,n)
    

    it should work correctly [disclaimer: never compiled, or tested, use at own risk].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use some perl line, like this: perl -pe $_=~s///e The problem
I want to use some of the non-standard GLES 2 extensions like 'GL_OES_vertex_array_object' but
i want use some data from a website with web service. i have a
I want to use some basic struct in C like the following: struct p
I want to use some features of python like as Tuples and Sets in
I m creating a game, in that i want to use some animation, but
I use some code to encrypt & decrypt string in C# but i want
I want to use some smart procedures I wrote, but not store them. For
My basic problem is that I want to use some structs and functions defined
I'm creating a new app and I want to use some libraries like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.