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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:04:04+00:00 2026-06-18T16:04:04+00:00

The well know code for getting properties from CUDA devices (!) is enumerating over

  • 0

The well know code for getting properties from CUDA devices (!) is enumerating over all devices, and getting properties from then. Then I see such piece, that activates given device.

I have problem in reverse — let’s say the device is already chosen, and I would like to get properties for it (the active one), not for all devices present in the system.

I hope I wrote this in correct way, because I am new to CUDA.

  • 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-18T16:04:05+00:00Added an answer on June 18, 2026 at 4:04 pm

    Just call cudaGetDevice() to get the device number of the active context, then call cudaGetDeviceProperties to get the properties of that device. In code that would be something like:

    int device;
    cudaGetDevice(&device);
    
    struct cudaDeviceProp props;
    cudaGetDeviceProperties(&props, device);
    

    [disclaimer: written in browser, 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 don't know C well at all, and I'm trying to edit someone's code,
I have a piece of dissassembled code which didn't work quite well around some
In the following the code I keep getting the error (No such file or
I am looking for a really simple way of getting all the values from
Can anyone tell me why I am getting this exception? Well I know why
Well I know some kinds of UML's diagrams, but I haven't heard about this
I have a serious issue with Liferay 6.1 themes , I know well about
I know java well, and have some experience in EclipseLink, Hibernate, JSF, Grails and
I know SQL well but I must be missing something really dumb here. This
I know C# well, but it is something strange for me. In some old

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.