[petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

Patrick Sanan patrick.sanan at gmail.com
Fri Oct 16 09:02:57 CDT 2020


The man page for this seems to need fixing:

    "Either way evaluates true if PETSC_USE_DEBUG is defined (merely defined or defined to 1) or undefined. This macro should not be used if its argument may be defined to a non-empty value other than 1."

Is a 0 value allowed? If so, does it also evaluate to false?


The source check seems easy enough - reject anything that matches the following?

    PetscDefined(\W*PETSC_

> Am 16.10.2020 um 14:59 schrieb Mark Adams <mfadams at lbl.gov>:
> 
> 
> 
> On Fri, Oct 16, 2020 at 1:05 AM Jed Brown <jed at jedbrown.org> wrote:
> Barry Smith <bsmith at petsc.dev> writes:
> 
> >   Could it error if the input starts with PETS_ to prevent inadvertent mistakes hanging around for years?
> 
> Source checks could warn, but cpp macros can't do substring matching.
> 
> You would want to check this before CI, so live with it. 



More information about the petsc-dev mailing list