Skip to content

Commit 73daeb3

Browse files
Artem-Btstellar
authored andcommitted
[CUDA] Make sure <string.h> is included with original __THROW defined.
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)
1 parent 3ee9a2b commit 73daeb3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clang/lib/Headers/__clang_cuda_runtime_wrapper.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <cmath>
4242
#include <cstdlib>
4343
#include <stdlib.h>
44+
#include <string.h>
4445
#undef __CUDACC__
4546

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

207208
#if CUDA_VERSION >= 9000
208-
// CUDA-9.2 needs host-side memcpy for some host functions in
209-
// device_functions.hpp
210-
#if CUDA_VERSION >= 9020
211-
#include <string.h>
212-
#endif
213209
#include "crt/math_functions.hpp"
214210
#else
215211
#include "math_functions.hpp"

0 commit comments

Comments
 (0)