Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
fd15477f
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
fd15477f
编写于
11月 09, 2021
作者:
S
Sing_chan
提交者:
GitHub
11月 09, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs when build in windows with_inference_api_test=on (#36973)
上级
a6e99dc7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
81 addition
and
7 deletion
+81
-7
cmake/external/dirent.cmake
cmake/external/dirent.cmake
+45
-0
cmake/third_party.cmake
cmake/third_party.cmake
+5
-0
paddle/fluid/inference/tests/api/tester_helper.h
paddle/fluid/inference/tests/api/tester_helper.h
+2
-1
paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_fp16_serialize_deserialize_test.cc
...rt_dynamic_shape_ernie_fp16_serialize_deserialize_test.cc
+7
-1
paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_serialize_deserialize_test.cc
...api/trt_dynamic_shape_ernie_serialize_deserialize_test.cc
+7
-1
paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_serialize_deserialize_test.h
.../api/trt_dynamic_shape_ernie_serialize_deserialize_test.h
+5
-0
paddle/fluid/platform/complex.h
paddle/fluid/platform/complex.h
+4
-4
paddle/fluid/platform/init.cc
paddle/fluid/platform/init.cc
+3
-0
paddle/fluid/platform/port.h
paddle/fluid/platform/port.h
+3
-0
未找到文件。
cmake/external/dirent.cmake
0 → 100644
浏览文件 @
fd15477f
# Copyright (c) 2021 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.
# Note(chenxin33): dirent.h is only exist in Linux, so get it from github when build in windows.
# use dirent tag v1.23.2 on 09/05//2018 https://github.com/tronkko/dirent.git
INCLUDE
(
ExternalProject
)
SET
(
DIRENT_PREFIX_DIR
${
THIRD_PARTY_PATH
}
/dirent
)
SET
(
DIRENT_SOURCE_DIR
${
THIRD_PARTY_PATH
}
/dirent/src/extern_dirent
)
SET
(
DIRENT_INCLUDE_DIR
${
DIRENT_SOURCE_DIR
}
/include
)
include_directories
(
${
DIRENT_INCLUDE_DIR
}
)
set
(
DIRENT_REPOSITORY
${
GIT_URL
}
/tronkko/dirent
)
set
(
DIRENT_TAG 1.23.2
)
ExternalProject_Add
(
extern_dirent
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
SHALLOW_CLONE
}
GIT_REPOSITORY
${
DIRENT_REPOSITORY
}
GIT_TAG
${
DIRENT_TAG
}
PREFIX
${
DIRENT_PREFIX_DIR
}
UPDATE_COMMAND
""
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
INSTALL_COMMAND
""
TEST_COMMAND
""
)
add_library
(
dirent INTERFACE
)
add_dependencies
(
dirent extern_dirent
)
\ No newline at end of file
cmake/third_party.cmake
浏览文件 @
fd15477f
...
...
@@ -378,4 +378,9 @@ if (WITH_POCKETFFT)
add_definitions
(
-DPADDLE_WITH_POCKETFFT
)
endif
(
WITH_POCKETFFT
)
if
(
WIN32
)
include
(
external/dirent
)
list
(
APPEND third_party_deps extern_dirent
)
endif
(
WIN32
)
add_custom_target
(
third_party ALL DEPENDS
${
third_party_deps
}
)
paddle/fluid/inference/tests/api/tester_helper.h
浏览文件 @
fd15477f
...
...
@@ -465,7 +465,8 @@ void PredictionWarmUp(PaddlePredictor *predictor,
}
int
iterations
=
1
;
if
(
FLAGS_warmup_iters
>
1
)
iterations
=
std
::
min
(
FLAGS_warmup_iters
,
static_cast
<
int
>
(
inputs
.
size
()));
iterations
=
(
std
::
min
)(
FLAGS_warmup_iters
,
static_cast
<
int
>
(
inputs
.
size
()));
outputs
->
resize
(
iterations
);
Timer
warmup_timer
;
double
elapsed_time
=
0
;
...
...
paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_fp16_serialize_deserialize_test.cc
浏览文件 @
fd15477f
...
...
@@ -13,9 +13,15 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include <dirent.h>
#ifndef _WIN32
#include <unistd.h>
#else // headers below are substitute of unistd.h in windows
#include <io.h>
#include <process.h>
#endif
#define GLOG_NO_ABBREVIATED_SEVERITIES
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <unistd.h>
#include "gflags/gflags.h"
#include "paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_serialize_deserialize_test.h"
...
...
paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_serialize_deserialize_test.cc
浏览文件 @
fd15477f
...
...
@@ -13,9 +13,15 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include <dirent.h>
#ifndef _WIN32
#include <unistd.h>
#else // headers below are substitute of unistd.h in windows
#include <io.h>
#include <process.h>
#endif
#define GLOG_NO_ABBREVIATED_SEVERITIES
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <unistd.h>
#include "gflags/gflags.h"
#include "paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_serialize_deserialize_test.h"
...
...
paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_serialize_deserialize_test.h
浏览文件 @
fd15477f
...
...
@@ -14,7 +14,12 @@ limitations under the License. */
#pragma once
#include <glog/logging.h>
#include <gtest/gtest.h>
#ifndef _WIN32
#include <unistd.h>
#else // headers below are substitute of unistd.h in windows
#include <io.h>
#include <process.h>
#endif
#include <functional>
#include <map>
#include <string>
...
...
paddle/fluid/platform/complex.h
浏览文件 @
fd15477f
...
...
@@ -352,12 +352,12 @@ HOSTDEVICE inline bool operator>=(const complex<T>& a, const complex<T>& b) {
}
template
<
typename
T
>
HOSTDEVICE
inline
complex
<
T
>
max
(
const
complex
<
T
>&
a
,
const
complex
<
T
>&
b
)
{
HOSTDEVICE
inline
complex
<
T
>
(
max
)
(
const
complex
<
T
>&
a
,
const
complex
<
T
>&
b
)
{
return
(
a
.
real
>=
b
.
real
)
?
a
:
b
;
}
template
<
typename
T
>
HOSTDEVICE
inline
complex
<
T
>
min
(
const
complex
<
T
>&
a
,
const
complex
<
T
>&
b
)
{
HOSTDEVICE
inline
complex
<
T
>
(
min
)
(
const
complex
<
T
>&
a
,
const
complex
<
T
>&
b
)
{
return
(
a
.
real
<
b
.
real
)
?
a
:
b
;
}
...
...
@@ -507,13 +507,13 @@ struct numeric_limits<paddle::platform::complex<T>> {
static
const
bool
traps
=
false
;
static
const
bool
tinyness_before
=
false
;
static
paddle
::
platform
::
complex
<
T
>
min
()
{
static
paddle
::
platform
::
complex
<
T
>
(
min
)
()
{
return
paddle
::
platform
::
complex
<
T
>
(
0.0
,
0.0
);
}
static
paddle
::
platform
::
complex
<
T
>
lowest
()
{
return
paddle
::
platform
::
complex
<
T
>
(
0.0
,
0.0
);
}
static
paddle
::
platform
::
complex
<
T
>
max
()
{
static
paddle
::
platform
::
complex
<
T
>
(
max
)
()
{
return
paddle
::
platform
::
complex
<
T
>
(
0.0
,
0.0
);
}
static
paddle
::
platform
::
complex
<
T
>
epsilon
()
{
...
...
paddle/fluid/platform/init.cc
浏览文件 @
fd15477f
...
...
@@ -37,6 +37,9 @@ limitations under the License. */
#ifdef WITH_WIN_DUMP_DBG
#include <stdio.h>
#include <time.h>
#ifndef NOMINMAX
#define NOMINMAX // msvc max/min macro conflict with std::min/max
#endif
#include <windows.h>
#include "DbgHelp.h"
...
...
paddle/fluid/platform/port.h
浏览文件 @
fd15477f
...
...
@@ -30,13 +30,16 @@
#include <sys/time.h>
#include <algorithm> // std::accumulate
#else
#ifndef NOMINMAX
#define NOMINMAX // msvc max/min macro conflict with std::min/max
#endif
// solve static linking error in windows
// https://github.com/google/glog/issues/301
#define GOOGLE_GLOG_DLL_DECL
#include <io.h> // _popen, _pclose
#include <stdio.h>
#include <windows.h>
#include <winsock.h>
#include <numeric> // std::accumulate in msvc
#ifndef S_ISDIR // windows port for sys/stat.h
#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录