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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:28:47+00:00 2026-05-13T08:28:47+00:00

I am trying to test some typical cuda functions during the configure process. How

  • 0

I am trying to test some typical cuda functions during the configure process. How can I write it in my configure.ac? Something like:

AC_TRY_COMPILE([],
[
__global__ static void test_cuda() {
    const int tid = threadIdx.x;
    const int bid = blockIdx.x;
    __syncthreads();
}
],
[cuda_comp=ok],[cuda_comp=no])

But nvcc is not defined in AC_LANG. Must I create my own m4 macros?

  • 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-13T08:28:48+00:00Added an answer on May 13, 2026 at 8:28 am

    I am highly doubtful whether it is possible to cleanly hook into the AC_LANG, AC_TRY_COMPILE etc. series of macros without actually rewriting parts of autoconf.

    The safe bet for you is to just write a test. Unless you need that test in several projects, you do not even need to wrap the test in m4 macros.

    The test would first check for nvcc, then create some test source file and finally try compiling that using $NVCC. Then it needs to examine the results of the compilation (return code and generated files), and finally to clean up any files it might have generated.

    Something like

    AC_ARG_VAR([NVCC], [nvcc compiler to use])
    AC_PATH_PROG([NVCC], [nvcc], [no])
    working_nvcc=no
    if test "x$NVCC" != "xno"
    the
        AC_MSG_CHECKING([whether nvcc works])
        cat>conftest.c<<EOF
        __global__ whatever() {
           ...
        }
    EOF
        if $NVCC conftest.c && test_whether_output_files_are_ok
        then
            working_nvcc=yes
        fi
        rm -f conftest.c conftest.o conftest.what conftest.ever
        AC_MSG_RESULT([$working_nvcc])
    fi
    AM_CONDITIONAL([WORKING_NVCC], [test "x$working_nvcc" = "xyes"])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 254k
  • Answers 254k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Visual Studio 2008 Product Comparison Guide I don't need to… May 13, 2026 at 10:05 am
  • Editorial Team
    Editorial Team added an answer The equals method of StringBuffer is not overridden from Object,… May 13, 2026 at 10:05 am
  • Editorial Team
    Editorial Team added an answer See example and references in python-imap-idle-with-imaplib2 (Wayback Machine snapshot). The… May 13, 2026 at 10:05 am

Related Questions

I'm investigating the differences between using log4net and System.Diagnostics.Trace for logging, and I'm curious
I am trying to understand if I really have any case for using git/mercurial.
I've read a few threads on SO about usefulness of unit-testing various applications. The
I am trying to test some of these code here http://ha.ckers.org/xss.html on my code.
I am trying to test some exceptions in my project and one of the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.