Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
e23ddf6a
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
e23ddf6a
编写于
8月 21, 2018
作者:
D
dzhwinter
提交者:
GitHub
8月 21, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
status (#12764)
上级
d04ef276
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
64 addition
and
21 deletion
+64
-21
cmake/flags.cmake
cmake/flags.cmake
+5
-1
paddle/fluid/operators/CMakeLists.txt
paddle/fluid/operators/CMakeLists.txt
+1
-1
paddle/fluid/platform/dynload/cublas.h
paddle/fluid/platform/dynload/cublas.h
+1
-1
paddle/fluid/platform/dynload/cudnn.h
paddle/fluid/platform/dynload/cudnn.h
+1
-1
paddle/fluid/platform/dynload/cupti.h
paddle/fluid/platform/dynload/cupti.h
+1
-1
paddle/fluid/platform/dynload/curand.h
paddle/fluid/platform/dynload/curand.h
+1
-1
paddle/fluid/platform/dynload/mklml.h
paddle/fluid/platform/dynload/mklml.h
+1
-1
paddle/fluid/platform/dynload/nccl.h
paddle/fluid/platform/dynload/nccl.h
+1
-2
paddle/fluid/platform/dynload/warpctc.h
paddle/fluid/platform/dynload/warpctc.h
+1
-2
paddle/fluid/platform/enforce.h
paddle/fluid/platform/enforce.h
+5
-4
paddle/fluid/platform/port.h
paddle/fluid/platform/port.h
+37
-0
paddle/fluid/pybind/CMakeLists.txt
paddle/fluid/pybind/CMakeLists.txt
+9
-6
未找到文件。
cmake/flags.cmake
浏览文件 @
e23ddf6a
...
@@ -102,7 +102,6 @@ set(COMMON_FLAGS
...
@@ -102,7 +102,6 @@ set(COMMON_FLAGS
-fno-omit-frame-pointer
-fno-omit-frame-pointer
-Wall
-Wall
-Wextra
-Wextra
-Werror
-Wnon-virtual-dtor
-Wnon-virtual-dtor
-Wdelete-non-virtual-dtor
-Wdelete-non-virtual-dtor
-Wno-unused-parameter
-Wno-unused-parameter
...
@@ -115,6 +114,11 @@ set(COMMON_FLAGS
...
@@ -115,6 +114,11 @@ set(COMMON_FLAGS
-Wno-error=terminate
# Warning in PADDLE_ENFORCE
-Wno-error=terminate
# Warning in PADDLE_ENFORCE
)
)
# https://github.com/PaddlePaddle/Paddle/issues/12773
if
(
NOT WIN32
)
list
(
APPEND COMMON_FLAGS -Werror
)
endif
()
set
(
GPU_COMMON_FLAGS
set
(
GPU_COMMON_FLAGS
-fPIC
-fPIC
-fno-omit-frame-pointer
-fno-omit-frame-pointer
...
...
paddle/fluid/operators/CMakeLists.txt
浏览文件 @
e23ddf6a
...
@@ -9,7 +9,6 @@ function(op_library TARGET)
...
@@ -9,7 +9,6 @@ function(op_library TARGET)
# op_library is a function to create op library. The interface is same as
# op_library is a function to create op library. The interface is same as
# cc_library. But it handle split GPU/CPU code and link some common library
# cc_library. But it handle split GPU/CPU code and link some common library
# for ops.
# for ops.
set
(
OP_LIBRARY
${
TARGET
}
${
OP_LIBRARY
}
PARENT_SCOPE
)
set
(
cc_srcs
)
set
(
cc_srcs
)
set
(
cu_srcs
)
set
(
cu_srcs
)
set
(
hip_cu_srcs
)
set
(
hip_cu_srcs
)
...
@@ -92,6 +91,7 @@ function(op_library TARGET)
...
@@ -92,6 +91,7 @@ function(op_library TARGET)
endif
()
endif
()
endforeach
()
endforeach
()
endif
(
WIN32
)
endif
(
WIN32
)
set
(
OP_LIBRARY
${
TARGET
}
${
OP_LIBRARY
}
PARENT_SCOPE
)
list
(
LENGTH op_library_DEPS op_library_DEPS_len
)
list
(
LENGTH op_library_DEPS op_library_DEPS_len
)
if
(
${
op_library_DEPS_len
}
GREATER 0
)
if
(
${
op_library_DEPS_len
}
GREATER 0
)
...
...
paddle/fluid/platform/dynload/cublas.h
浏览文件 @
e23ddf6a
...
@@ -17,10 +17,10 @@
...
@@ -17,10 +17,10 @@
#include <cublasXt.h>
#include <cublasXt.h>
#include <cublas_v2.h>
#include <cublas_v2.h>
#include <cuda.h>
#include <cuda.h>
#include <dlfcn.h>
#include <mutex> // NOLINT
#include <mutex> // NOLINT
#include <type_traits>
#include <type_traits>
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/port.h"
namespace
paddle
{
namespace
paddle
{
namespace
platform
{
namespace
platform
{
...
...
paddle/fluid/platform/dynload/cudnn.h
浏览文件 @
e23ddf6a
...
@@ -15,9 +15,9 @@ limitations under the License. */
...
@@ -15,9 +15,9 @@ limitations under the License. */
#pragma once
#pragma once
#include <cudnn.h>
#include <cudnn.h>
#include <dlfcn.h>
#include <mutex> // NOLINT
#include <mutex> // NOLINT
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/port.h"
namespace
paddle
{
namespace
paddle
{
namespace
platform
{
namespace
platform
{
...
...
paddle/fluid/platform/dynload/cupti.h
浏览文件 @
e23ddf6a
...
@@ -17,10 +17,10 @@ limitations under the License. */
...
@@ -17,10 +17,10 @@ limitations under the License. */
#include <cuda.h>
#include <cuda.h>
#include <cupti.h>
#include <cupti.h>
#include <dlfcn.h>
#include <mutex> // NOLINT
#include <mutex> // NOLINT
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/port.h"
namespace
paddle
{
namespace
paddle
{
namespace
platform
{
namespace
platform
{
...
...
paddle/fluid/platform/dynload/curand.h
浏览文件 @
e23ddf6a
...
@@ -14,9 +14,9 @@ limitations under the License. */
...
@@ -14,9 +14,9 @@ limitations under the License. */
#pragma once
#pragma once
#include <curand.h>
#include <curand.h>
#include <dlfcn.h>
#include <mutex> // NOLINT
#include <mutex> // NOLINT
#include "paddle/fluid/platform/port.h"
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
...
...
paddle/fluid/platform/dynload/mklml.h
浏览文件 @
e23ddf6a
...
@@ -14,10 +14,10 @@ limitations under the License. */
...
@@ -14,10 +14,10 @@ limitations under the License. */
#pragma once
#pragma once
#include <dlfcn.h>
#include <mkl.h>
#include <mkl.h>
#include <mutex> // NOLINT
#include <mutex> // NOLINT
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/port.h"
namespace
paddle
{
namespace
paddle
{
namespace
platform
{
namespace
platform
{
...
...
paddle/fluid/platform/dynload/nccl.h
浏览文件 @
e23ddf6a
...
@@ -13,12 +13,11 @@ See the License for the specific language governing permissions and
...
@@ -13,12 +13,11 @@ See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#pragma once
#pragma once
#include <dlfcn.h>
#include <nccl.h>
#include <nccl.h>
#include <mutex> // NOLINT
#include <mutex> // NOLINT
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/port.h"
namespace
paddle
{
namespace
paddle
{
namespace
platform
{
namespace
platform
{
...
...
paddle/fluid/platform/dynload/warpctc.h
浏览文件 @
e23ddf6a
...
@@ -14,10 +14,9 @@ limitations under the License. */
...
@@ -14,10 +14,9 @@ limitations under the License. */
#pragma once
#pragma once
#include <dlfcn.h>
#include <mutex> // NOLINT
#include <mutex> // NOLINT
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/dynload/dynamic_loader.h"
#include "paddle/fluid/platform/port.h"
#include "warpctc/include/ctc.h"
#include "warpctc/include/ctc.h"
namespace
paddle
{
namespace
paddle
{
...
...
paddle/fluid/platform/enforce.h
浏览文件 @
e23ddf6a
...
@@ -14,9 +14,6 @@ limitations under the License. */
...
@@ -14,9 +14,6 @@ limitations under the License. */
#pragma once
#pragma once
#include <dlfcn.h> // for dladdr
#include <execinfo.h> // for backtrace
#ifdef __GNUC__
#ifdef __GNUC__
#include <cxxabi.h> // for __cxa_demangle
#include <cxxabi.h> // for __cxa_demangle
#endif // __GNUC__
#endif // __GNUC__
...
@@ -37,6 +34,7 @@ limitations under the License. */
...
@@ -37,6 +34,7 @@ limitations under the License. */
#include "glog/logging.h"
#include "glog/logging.h"
#include "paddle/fluid/platform/macros.h"
#include "paddle/fluid/platform/macros.h"
#include "paddle/fluid/platform/port.h"
#include "paddle/fluid/string/printf.h"
#include "paddle/fluid/string/printf.h"
#include "paddle/fluid/string/to_string.h"
#include "paddle/fluid/string/to_string.h"
...
@@ -75,7 +73,7 @@ struct EnforceNotMet : public std::exception {
...
@@ -75,7 +73,7 @@ struct EnforceNotMet : public std::exception {
sout
<<
string
::
Sprintf
(
"%s at [%s:%d]"
,
exp
.
what
(),
f
,
l
)
<<
std
::
endl
;
sout
<<
string
::
Sprintf
(
"%s at [%s:%d]"
,
exp
.
what
(),
f
,
l
)
<<
std
::
endl
;
sout
<<
"PaddlePaddle Call Stacks: "
<<
std
::
endl
;
sout
<<
"PaddlePaddle Call Stacks: "
<<
std
::
endl
;
#if !defined(_WIN32)
void
*
call_stack
[
TRACE_STACK_LIMIT
];
void
*
call_stack
[
TRACE_STACK_LIMIT
];
auto
size
=
backtrace
(
call_stack
,
TRACE_STACK_LIMIT
);
auto
size
=
backtrace
(
call_stack
,
TRACE_STACK_LIMIT
);
auto
symbols
=
backtrace_symbols
(
call_stack
,
size
);
auto
symbols
=
backtrace_symbols
(
call_stack
,
size
);
...
@@ -95,6 +93,9 @@ struct EnforceNotMet : public std::exception {
...
@@ -95,6 +93,9 @@ struct EnforceNotMet : public std::exception {
}
}
}
}
free
(
symbols
);
free
(
symbols
);
#else
sout
<<
"Windows not support stack backtrace yet."
;
#endif
err_str_
=
sout
.
str
();
err_str_
=
sout
.
str
();
}
}
}
}
...
...
paddle/fluid/platform/port.h
0 → 100644
浏览文件 @
e23ddf6a
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <stdexcept>
#include <string>
#if !defined(_WIN32)
#include <dlfcn.h> // for dladdr
#include <execinfo.h> // for backtrace
#else
#include <Shlwapi.h>
#include <Windows.h>
static
void
*
dlsym
(
void
*
handle
,
const
char
*
symbol_name
)
{
FARPROC
found_symbol
;
found_symbol
=
GetProcAddress
((
HMODULE
)
handle
,
symbol_name
);
if
(
found_symbol
==
NULL
)
{
throw
std
::
runtime_error
(
std
::
string
(
symbol_name
)
+
" not found."
);
}
return
reinterpret_cast
<
void
*>
(
found_symbol
);
}
#endif
paddle/fluid/pybind/CMakeLists.txt
浏览文件 @
e23ddf6a
set
(
PYBIND_DEPS pybind python proto_desc memory executor prune profiler feed_fetch_method
)
if
(
NOT WIN32
)
list
(
APPEND PYBIND_DEPS parallel_executor
)
endif
()
if
(
WITH_PYTHON
)
if
(
WITH_PYTHON
)
if
(
WITH_AMD_GPU
)
if
(
WITH_AMD_GPU
)
hip_library
(
paddle_pybind SHARED
hip_library
(
paddle_pybind SHARED
SRCS pybind.cc exception.cc protobuf.cc const_value.cc recordio.cc
SRCS pybind.cc exception.cc protobuf.cc const_value.cc recordio.cc
DEPS pybind python proto_desc memory executor prune profiler feed_fetch_method
DEPS
${
PYBIND_DEPS
}
parallel_executor
${
GLOB_OP_LIB
}
)
${
GLOB_OP_LIB
}
)
else
()
else
()
cc_library
(
paddle_pybind SHARED
cc_library
(
paddle_pybind SHARED
SRCS pybind.cc exception.cc protobuf.cc const_value.cc recordio.cc
SRCS pybind.cc exception.cc protobuf.cc const_value.cc recordio.cc
DEPS pybind python proto_desc memory executor prune profiler feed_fetch_method
DEPS
${
PYBIND_DEPS
}
parallel_executor
${
GLOB_OP_LIB
}
)
${
GLOB_OP_LIB
}
)
if
(
NOT APPLE AND NOT ANDROID
)
if
(
NOT APPLE AND NOT ANDROID
AND NOT WIN32
)
target_link_libraries
(
paddle_pybind rt
)
target_link_libraries
(
paddle_pybind rt
)
endif
(
NOT APPLE AND NOT ANDROID
)
endif
(
NOT APPLE AND NOT ANDROID
AND NOT WIN32
)
endif
(
WITH_AMD_GPU
)
endif
(
WITH_AMD_GPU
)
cc_test
(
tensor_py_test SRCS tensor_py_test.cc DEPS python
)
cc_test
(
tensor_py_test SRCS tensor_py_test.cc DEPS python
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录