[PATCH] D77239: [CUDA][NFCI] Use unqualified lookup for math functions

2020-04-01 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert abandoned this revision.
jdoerfert added a comment.

In D77239#1955720 , @tra wrote:

> > The other macro uses a unqualified lookup already and the qualified one
> >  will cause problems in the OpenMP overlay.
>
> There's a bit of inconsitency here.  While 
> `__CUDA_CLANG_FN_INTEGER_OVERLOAD_2` indeed uses unqualified lookup, pretty 
> much all other functions use qualified global scope lookups, which, I believe 
> is correct, as we want to use the functions defined by CUDA headers there.
>
> @jlebar -- WDYT?


It turns out I can disable this entire code region for OpenMP (or have to for 
c++17 I tihnk), so I'll abandon this revision and you make it consistent in the 
way that fits your need :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77239



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77239: [CUDA][NFCI] Use unqualified lookup for math functions

2020-04-01 Thread Artem Belevich via Phabricator via cfe-commits
tra added a subscriber: jlebar.
tra added a comment.

> The other macro uses a unqualified lookup already and the qualified one
>  will cause problems in the OpenMP overlay.

There's a bit of inconsitency here.  While `__CUDA_CLANG_FN_INTEGER_OVERLOAD_2` 
indeed uses unqualified lookup, pretty much all other functions use qualified 
global scope lookups, which, I believe is correct, as we want to use the 
functions defined by CUDA headers there.

@jlebar -- WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77239



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77239: [CUDA][NFCI] Use unqualified lookup for math functions

2020-04-01 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert created this revision.
jdoerfert added a reviewer: tra.
Herald added subscribers: bollu, yaxunl.
Herald added a project: clang.
jdoerfert added a child revision: D77240: [CUDA] Add missing cmath overloads.

The other macro uses a unqualified lookup already and the qualified one
will cause problems in the OpenMP overlay.

Depends on D77238 .


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77239

Files:
  clang/lib/Headers/__clang_cuda_cmath.h


Index: clang/lib/Headers/__clang_cuda_cmath.h
===
--- clang/lib/Headers/__clang_cuda_cmath.h
+++ clang/lib/Headers/__clang_cuda_cmath.h
@@ -191,7 +191,7 @@
   typename __clang_cuda_enable_if::is_integer,
\
   __retty>::type   
\
   __fn(__T __x) {  
\
-return ::__fn((double)__x);
\
+return __fn((double)__x);  
\
   }
 
 // Defines an overload of __fn that accepts one two arithmetic arguments, calls


Index: clang/lib/Headers/__clang_cuda_cmath.h
===
--- clang/lib/Headers/__clang_cuda_cmath.h
+++ clang/lib/Headers/__clang_cuda_cmath.h
@@ -191,7 +191,7 @@
   typename __clang_cuda_enable_if::is_integer,\
   __retty>::type   \
   __fn(__T __x) {  \
-return ::__fn((double)__x);\
+return __fn((double)__x);  \
   }
 
 // Defines an overload of __fn that accepts one two arithmetic arguments, calls
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits