Skip to content

Commit 630943c

Browse files
authored
Update documentation (#9918)
1 parent 2f38264 commit 630943c

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

paddle/fluid/platform/cuda_profiler.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ distributed under the License is distributed on an "AS IS" BASIS,
1111
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
14-
1514
#pragma once
15+
1616
#include <cuda_profiler_api.h>
17-
#include <stdio.h>
18-
#include <stdlib.h>
19-
#include <string.h>
17+
18+
#include <string>
19+
20+
#include "paddle/fluid/platform/enforce.h"
2021

2122
namespace paddle {
2223
namespace platform {

paddle/fluid/platform/variant.h

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,25 @@ limitations under the License. */
1414

1515
#pragma once
1616

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__)
2122
#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
2826
#endif
2927

30-
#include <boost/config.hpp>
28+
#include "boost/config.hpp"
3129

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,
3934
// https://github.com/PaddlePaddle/Paddle/issues/3386
35+
#ifdef PADDLE_WITH_CUDA
4036
#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
4137
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
4238
#endif

0 commit comments

Comments
 (0)