Page MenuHomePhabricator

[CUDA][NFCI] Use unqualified lookup for math functions
AbandonedPublic

Authored by jdoerfert on Apr 1 2020, 1:20 PM.

Details

Reviewers
tra
Summary

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

Depends on D77238.

Diff Detail

Unit TestsFailed

TimeTest
100 msClang.Headers::nvptx_device_cmath_functions.c
Script: -- : 'RUN: at line 6'; /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/build/bin/clang -cc1 -internal-isystem /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/build/lib/clang/11.0.0/include -nostdsysteminc -internal-isystem /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/clang/test/Headers/Inputs/include -include cmath -fopenmp -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/clang/test/Headers/nvptx_device_cmath_functions.c -o /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/build/tools/clang/test/Headers/Output/nvptx_device_cmath_functions.c.tmp-ppc-host.bc
170 msClang.Headers::nvptx_device_cmath_functions.c
Script: -- : 'RUN: at line 6'; c:\ws\workspace\amd64_windows_vs2017\llvm-project\build\bin\clang.exe -cc1 -internal-isystem c:\ws\workspace\amd64_windows_vs2017\llvm-project\build\lib\clang\11.0.0\include -nostdsysteminc -internal-isystem C:\ws\workspace\amd64_windows_vs2017\llvm-project\clang\test\Headers/Inputs/include -include cmath -fopenmp -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc C:\ws\workspace\amd64_windows_vs2017\llvm-project\clang\test\Headers\nvptx_device_cmath_functions.c -o C:\ws\workspace\amd64_windows_vs2017\llvm-project\build\tools\clang\test\Headers\Output\nvptx_device_cmath_functions.c.tmp-ppc-host.bc
150 msClang.Headers::nvptx_device_cmath_functions.cpp
Script: -- : 'RUN: at line 6'; /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/build/bin/clang -cc1 -internal-isystem /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/build/lib/clang/11.0.0/include -nostdsysteminc -internal-isystem /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/clang/test/Headers/Inputs/include -include cmath -x c++ -fopenmp -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/clang/test/Headers/nvptx_device_cmath_functions.cpp -o /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/build/tools/clang/test/Headers/Output/nvptx_device_cmath_functions.cpp.tmp-ppc-host.bc
280 msClang.Headers::nvptx_device_cmath_functions.cpp
Script: -- : 'RUN: at line 6'; c:\ws\workspace\amd64_windows_vs2017\llvm-project\build\bin\clang.exe -cc1 -internal-isystem c:\ws\workspace\amd64_windows_vs2017\llvm-project\build\lib\clang\11.0.0\include -nostdsysteminc -internal-isystem C:\ws\workspace\amd64_windows_vs2017\llvm-project\clang\test\Headers/Inputs/include -include cmath -x c++ -fopenmp -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc C:\ws\workspace\amd64_windows_vs2017\llvm-project\clang\test\Headers\nvptx_device_cmath_functions.cpp -o C:\ws\workspace\amd64_windows_vs2017\llvm-project\build\tools\clang\test\Headers\Output\nvptx_device_cmath_functions.cpp.tmp-ppc-host.bc
150 msClang.Headers::nvptx_device_cmath_functions_cxx17.cpp
Script: -- : 'RUN: at line 6'; /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/build/bin/clang -cc1 -internal-isystem /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/build/lib/clang/11.0.0/include -nostdsysteminc -internal-isystem /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/clang/test/Headers/Inputs/include -include cmath -x c++ -fopenmp -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/clang/test/Headers/nvptx_device_cmath_functions_cxx17.cpp -o /mnt/disks/ssd0/agent/workspace/BETA_amd64_debian_testing_clang8/llvm-project/build/tools/clang/test/Headers/Output/nvptx_device_cmath_functions_cxx17.cpp.tmp-ppc-host.bc -std=c++17
View Full Test Results (13 Failed)

Event Timeline

jdoerfert created this revision.Apr 1 2020, 1:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2020, 1:20 PM
Herald added subscribers: bollu, yaxunl. · View Herald Transcript
tra added a subscriber: jlebar.Apr 1 2020, 2:20 PM

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?

jdoerfert abandoned this revision.Apr 1 2020, 2:23 PM
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 :)