Skip to content

Commit

Permalink
[CUDA] Make sure <string.h> is included with original __THROW defined.
Browse files Browse the repository at this point in the history
Otherwise we may end up with an inconsistent redeclarations of the standard
library functions if _FORTIFY_SOURCE is in effect.

https://bugs.llvm.org/show_bug.cgi?id=47869

Differential Revision: https://reviews.llvm.org/D110781

(cherry picked from commit 29e00b2)
  • Loading branch information
Artem-B authored and tstellar committed Oct 22, 2021
1 parent 3ee9a2b commit 73daeb3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions clang/lib/Headers/__clang_cuda_runtime_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <cmath>
#include <cstdlib>
#include <stdlib.h>
#include <string.h>
#undef __CUDACC__

// Preserve common macros that will be changed below by us or by CUDA
Expand Down Expand Up @@ -205,11 +206,6 @@ inline __host__ double __signbitd(double x) {
#endif

#if CUDA_VERSION >= 9000
// CUDA-9.2 needs host-side memcpy for some host functions in
// device_functions.hpp
#if CUDA_VERSION >= 9020
#include <string.h>
#endif
#include "crt/math_functions.hpp"
#else
#include "math_functions.hpp"
Expand Down

0 comments on commit 73daeb3

Please sign in to comment.