Here my solution. This is not too hard to find this solution, as this is more autoconf relevant than CUDA, but CUDA coders may not be autoconf experts.
AC_MSG_CHECKING([for nvcc compilation])
ac_compile_nvcc=no
cat>conftest.cu<<EOF
__global__ static void test_cuda() {
const int tid = threadIdx.x;
const int bid = blockIdx.x;
__syncthreads();
}
EOF
if $NVCC -c $NVCCFLAGS conftest.cu &> /dev/null
then
ac_compile_nvcc=yes
fi
AC_MSG_RESULT([$ac_compile_nvcc])
if test "x$ac_compile_nvcc" = "xno"
then
AC_MSG_ERROR([CUDA compiler has problems.])
fi