Page MenuHomePhabricator

[CUDA][Windows] Partial fix for bug 38811 (Step 1 of 3)

Authored by emankov on Mar 14 2019, 6:24 AM.



Partial fix for the clang Bug 38811 "Clang fails to compile with CUDA-9.x on Windows".

Adding defined(_WIN64) check along with existing #if defined(__LP64__) eliminates the below clang (64-bit) compilation error on Windows.

C:/GIT/LLVM/trunk/llvm-64-release-vs2017/dist/lib/clang/9.0.0\include\__clang_cuda_device_functions.h(1609,45): error GEF7559A7: no matching function for call to 'roundf'
 __DEVICE__ long lroundf(float __a) { return roundf(__a); }

[How to repro]

clang++.exe -x cuda "c:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\0_Simple\simplePrintf\" -I"c:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0\common\inc" --cuda-gpu-arch=sm_50 --cuda-path="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0" -L"c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64" -lcudart.lib  -v

Diff Detail

rC Clang

Event Timeline

emankov created this revision.Mar 14 2019, 6:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2019, 6:24 AM
tra accepted this revision.Mar 14 2019, 11:38 AM
This revision is now accepted and ready to land.Mar 14 2019, 11:38 AM
This revision was automatically updated to reflect the committed changes.