@@ -14,29 +14,25 @@ limitations under the License. */
14
14
15
15
#pragma once
16
16
17
- #ifdef __CUDACC__
18
- #ifdef __CUDACC_VER_MAJOR__
19
- // CUDA 9 define `__CUDACC_VER__` as a warning message, manually define
20
- // __CUDACC_VER__ instead.
17
+ // Boost 1.41.0 requires __CUDACC_VER__, but in CUDA 9 __CUDACC_VER__
18
+ // is removed, so we have to manually define __CUDACC_VER__ instead.
19
+ // For details, please refer to
20
+ // https://github.com/PaddlePaddle/Paddle/issues/6626
21
+ #if defined(__CUDACC__ ) && defined(__CUDACC_VER_MAJOR__ )
21
22
#undef __CUDACC_VER__
22
-
23
- #define __CUDACC_VER__ \
24
- (__CUDACC_VER_MAJOR__ * 10000 + __CUDACC_VER_MINOR__ * 100 + \
25
- __CUDACC_VER_BUILD__)
26
- #endif
27
-
23
+ #define __CUDACC_VER__ \
24
+ __CUDACC_VER_BUILD__ + __CUDACC_VER_MAJOR__ * 10000 + \
25
+ __CUDACC_VER_MINOR__ * 100
28
26
#endif
29
27
30
- #include < boost/config.hpp>
28
+ #include " boost/config.hpp"
31
29
32
- #ifdef PADDLE_WITH_CUDA
33
-
34
- // Because boost's variadic templates has bug on nvcc, boost will disable
35
- // variadic template support when GPU enabled on nvcc.
36
- // Define BOOST_NO_CXX11_VARIADIC_TEMPLATES on gcc/clang to generate same
37
- // function symbols.
38
- //
30
+ // Because Boost 1.41.0's variadic templates has bug on nvcc, boost
31
+ // will disable variadic template support in NVCC mode. Define
32
+ // BOOST_NO_CXX11_VARIADIC_TEMPLATES on gcc/clang to generate same
33
+ // function symbols. For details,
39
34
// https://github.com/PaddlePaddle/Paddle/issues/3386
35
+ #ifdef PADDLE_WITH_CUDA
40
36
#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
41
37
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
42
38
#endif
0 commit comments