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 4338320
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:03:58+00:00 2026-05-21T11:03:58+00:00

Should be simple enough; I literally want to send an int to the a

  • 0

Should be simple enough; I literally want to send an int to the a SourceModule kernel declaration, where the C function

__global__......(int value,.....)

with the value being declared and called…

value = 256
...
...
func(value,...)

But I’m getting a variety of errors from pycuda that I’m using the wrong type.

  • 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-05-21T11:03:58+00:00Added an answer on May 21, 2026 at 11:03 am

    The standard PyCUDA function interface requires argument have numpy dtypes, because it internally does mapping to C types under the hood. So for scalar arguments which are passed by value, you need to “cast” to a suitable numpy dtype first. Something like

    value = 256
    va = numpy.int32(value)
    
    func(va)
    

    should work. If you are passing single precision floating point values or arrays, make sure to explicitly use a dtype of np.float32, because numpy uses double precision by default and you will wind up with similar errors.

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

Sidebar

Related Questions

This should seem simple enough, but can't figure it out. I was porting a
Seems like it should be simple enough but it's driving me up the wall.
Seems like this should be simple enough but for whatever reason I am unable
This seems like it should be simple enough, but I can't seem to get
Should be a simple enough question: If I am using mysqli prepared statements, do
This should be simple enough, but somehow my brain stopped working. I have two
This should be simple enough. I have an iPhone app with a TableView. How
This problem should be simple enough, i am trying to learn animation using javascript
Should be simple enough but I can't see it. You can find out the
It seems like it should be simple enough, but im having trouble wrapping my

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.