[petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

Mark Adams mfadams at lbl.gov
Fri Oct 16 07:42:20 CDT 2020


Ah, thanks.

On Thu, Oct 15, 2020 at 11:39 PM Jed Brown <jed at jedbrown.org> wrote:

> Mark Adams <mfadams at lbl.gov> writes:
>
> > I have:
> >
> > #if defined(PETSC_HAVE_CUDA)
> >   ierr = PetscInfo3(pc,"PETSC_HAVE_CUDA ---------------------Test:
> > factor=%D. cuda=%D
> > level=%D\n",pc_gamg->level_reduction_factors[pc_gamg->current_level],
> > *PetscDefined(PETSC_HAVE_CUDA)*,pc_gamg->current_level);CHKERRQ(ierr);
> > #endif
> >
> > and see:
> >
> > [0] PCGAMGCreateLevel_GAMG(): PETSC_HAVE_CUDA ---------------------Test:
> > factor=2.* cuda=0* level=0
> >
> > So PETSC_HAVE_CUDA is defined yet PetscDefined(PETSC_HAVE_CUDA) is 0. Am
> I
> > missing something?
>
> The syntax is PetscDefined(HAVE_CUDA).  This is explained by way of
> example in the man page, but perhaps it should be explicitly repeated.
>
>
> https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscDefined.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20201016/d962e957/attachment.html>


More information about the petsc-dev mailing list