[PATCH] D104904: [OpenMP][AMDGCN] Initial math headers support

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 21 10:47:12 PDT 2021


JonChesterfield added a comment.

cstdlib test header contains

  // amdgcn already provides definition of fabs
  #ifndef __AMDGCN__
  float fabs(float __x) { return __builtin_fabs(__x); }
  #endif

If I delete or invert the ifndef

> $HOME/llvm-build/llvm/lib/clang/13.0.0/include/__clang_hip_cmath.h:660:9: error: target of using declaration conflicts with declaration already in scope
>  using ::fabs;
>  when included from openmp_wrappers/cmath

If I delete the definition,

> $HOME/llvm-project/clang/test/Headers/Inputs/include/cstdlib:29:31: error: use of undeclared identifier 'fabs'
> when included from openmp_wrappers/__clang_openmp_device_functions.h

Current conclusion is that we cannot work around the presence/absence of fabs in the cstdlib test file, we have to do something in the real headers such that the test file does the right thing


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104904/new/

https://reviews.llvm.org/D104904



More information about the cfe-commits mailing list