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

  • Home
  • SEARCH
  • 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 8332097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:37:27+00:00 2026-06-09T02:37:27+00:00

Is there somehow a possibility to call different kernels depending on whether for example

  • 0

Is there somehow a possibility to call different kernels depending on whether for example nvcc -arch=sm_11 or nvcc -arch=sm_20 has been used to compile the code? To be a bit more explicit:

if (FANCY_FLAG == CU_TARGET_COMPUTE_11)
    // Do some conversions here..
    krnl1<<<GRID_DIM1, BLOCK_DIM1>>>(converted_value1);
else if (FANCY_FLAG == CU_TARGET_COMPUTE_20)
    krnl2<<<GRID_DIM2, BLOCK_DIM2>>>(value1);

As you can see I found the CUjit_target_enum in cuda.h but I wasn’t able to find out whether the nvcc defines any flags which would be equal to one of the enums values.

My intention for this is that I don’t know whether my device support double precision floats or not. That would mean I have to convert my data from double to float and hence, run a different kernel (Yes, I’d prefer to run the kernel with double precision over single precision wherever possible).

I’d also appreciate a completely different approach as long as it does the trick.

  • 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-09T02:37:29+00:00Added an answer on June 9, 2026 at 2:37 am
    1. In the device code check CUDA_ARCH macro value
    2. In the host code – check major and minor fields of the device properties.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a possibility to literally override a target or emulate this somehow? So,
I need to trigger a different event depending on whether the user swipes the
Is there a way to somehow mark Types I do not control as Obsolete?
Is there a way to somehow Embed a WTL destop application in ATL ActiveX
There are plugins for handling history and bookmarking like: http://plugins.jquery.com/project/history . Somehow it doesn't
I'm pretty sure there's some quick and easy error in this code but somehow
I follow this tutorial online exactly but somehow it's giving me errors. Saying there
is there any possibility to change an image's resolution on clientside (using CSS, Javascript,
I wonder if there is a (native) possibility to create a MySQL table from
I've been searching about the possibility of propagate a JTA transaction from Java code

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.