Skip to content

Commit a7c8e42

Browse files
committed
Merge branch 'windows/build' into windows/online
test=develop
2 parents 5d6b370 + 67562a6 commit a7c8e42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1131
-367
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
python/paddle/fluid/tests/unittests/reader_reset_test.recordio
12
paddle/operators/check_t.save
23
paddle/operators/check_tensor.ls
34
paddle/operators/tensor.save

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
| QiJune | Jun Qi |
4343
| qingqing01 | Qing-Qing Dang |
4444
| reyoung | Yang Yu |
45+
| Sand3r- | Michal Gallus |
4546
| Superjom | Chun-Wei Yan |
4647
| tensor-tang | Jian Tang |
4748
| tianbingsz | Tian-Bing Xu |

cmake/inference_lib.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ copy(framework_lib DEPS ${framework_lib_deps}
166166

167167
set(module "memory")
168168
copy(memory_lib
169-
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/detail/*.h
170-
DSTS ${dst_dir}/${module} ${dst_dir}/${module}/detail
169+
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/detail/*.h ${src_dir}/${module}/allocation/*.h
170+
DSTS ${dst_dir}/${module} ${dst_dir}/${module}/detail ${dst_dir}/${module}/allocation
171171
)
172172

173173
set(inference_deps paddle_fluid_shared paddle_fluid)

paddle/fluid/framework/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ function(windows_symbolic TARGET)
3131
endfunction()
3232

3333
add_subdirectory(ir)
34-
if (NOT WIN32)
3534
add_subdirectory(details)
36-
endif (NOT WIN32)
3735
# ddim lib
3836
proto_library(framework_proto SRCS framework.proto)
3937

@@ -118,13 +116,8 @@ cc_test(op_proto_maker_test SRCS op_proto_maker_test.cc DEPS op_proto_maker)
118116
cc_library(op_info SRCS op_info.cc DEPS attribute framework_proto)
119117
cc_library(shape_inference SRCS shape_inference.cc DEPS ddim attribute device_context)
120118

121-
if (NOT WIN32)
122119
cc_library(operator SRCS operator.cc DEPS op_info device_context tensor scope glog
123120
shape_inference data_transform lod_tensor profiler)
124-
else()
125-
cc_library(operator SRCS operator.cc DEPS op_info device_context tensor scope glog
126-
shape_inference data_transform lod_tensor)
127-
endif(NOT WIN32)
128121

129122
cc_test(operator_test SRCS operator_test.cc DEPS operator op_registry device_context)
130123

@@ -179,12 +172,10 @@ else()
179172
cc_test(test_naive_executor SRCS naive_executor_test.cc DEPS naive_executor elementwise_add_op)
180173
endif()
181174

182-
if (NOT WIN32)
183175
cc_library(parallel_executor SRCS parallel_executor.cc DEPS
184176
threaded_ssa_graph_executor scope_buffered_ssa_graph_executor
185177
graph build_strategy
186178
fast_threaded_ssa_graph_executor)
187-
endif() # NOT WIN32
188179

189180
cc_library(prune SRCS prune.cc DEPS framework_proto)
190181
cc_test(prune_test SRCS prune_test.cc DEPS op_info prune recurrent_op device_context)

paddle/fluid/framework/details/fast_threaded_ssa_graph_executor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
// limitations under the License.
1414

1515
#pragma once
16+
#include <ThreadPool.h>
1617
#include <string>
1718
#include <vector>
18-
#include "ThreadPool.h"
1919
#include "paddle/fluid/framework/blocking_queue.h"
2020
#include "paddle/fluid/framework/details/exception_holder.h"
2121
#include "paddle/fluid/framework/details/execution_strategy.h"

paddle/fluid/framework/operator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class OperatorBase {
100100

101101
const std::string& Type() const { return type_; }
102102

103+
bool HasAttr(const std::string& name) const { return attrs_.count(name); }
103104
template <typename T>
104105
inline const T& Attr(const std::string& name) const {
105106
PADDLE_ENFORCE(attrs_.count(name) != 0, "%s should be in AttributeMap",

paddle/fluid/inference/analysis/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ set(analysis_deps # analysis_deps can be extended accross the project
77
add_subdirectory(ir_passes)
88
add_subdirectory(passes)
99

10-
cc_library(ir_pass_manager SRCS ir_pass_manager.cc DEPS graph pass ${INFER_IR_PASSES})
10+
cc_library(analysis_helper SRCS helper.cc DEPS framework_proto proto_desc graph paddle_fluid_api)
11+
12+
cc_library(ir_pass_manager SRCS ir_pass_manager.cc DEPS graph pass ${INFER_IR_PASSES} analysis_helper)
1113

1214
cc_library(argument SRCS argument.cc DEPS scope proto_desc)
1315
cc_library(analysis_pass SRCS analysis_pass.cc DEPS proto_desc)
1416

1517
cc_library(analysis SRCS
1618
analyzer.cc
17-
helper.cc
1819
analysis_pass
19-
DEPS ${analysis_deps}
20+
DEPS ${analysis_deps} analysis_helper
2021
)
2122

2223
cc_test(test_dot SRCS dot_tester.cc DEPS analysis)

paddle/fluid/inference/analysis/analyzer_tester.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ TEST(Analyzer, analysis_without_tensorrt) {
3030
Argument argument;
3131
argument.SetModelDir(FLAGS_inference_model_dir);
3232
argument.SetIrAnalysisPasses({"infer_clean_graph_pass"});
33+
argument.SetUseGPU(false);
3334

3435
Analyzer analyser;
3536
analyser.Run(&argument);
@@ -41,6 +42,7 @@ TEST(Analyzer, analysis_with_tensorrt) {
4142
argument.SetTensorRtWorkspaceSize(1 << 20);
4243
argument.SetModelDir(FLAGS_inference_model_dir);
4344
argument.SetIrAnalysisPasses({"infer_clean_graph_pass"});
45+
argument.SetUseGPU(false);
4446

4547
Analyzer analyser;
4648
analyser.Run(&argument);

paddle/fluid/inference/analysis/argument.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ struct Argument {
116116
std::vector<std::string>);
117117

118118
DECL_ARGUMENT_FIELD(use_gpu, UseGPU, bool);
119+
DECL_ARGUMENT_FIELD(gpu_device_id, GPUDeviceId, int);
119120
DECL_ARGUMENT_FIELD(use_tensorrt, UseTensorRT, bool);
120121
DECL_ARGUMENT_FIELD(tensorrt_node_teller, TensorRtNodeTeller,
121122
std::function<bool(const framework::ir::Node*)>);

paddle/fluid/inference/analysis/ir_passes/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ set(analysis_deps ${analysis_deps}
44
subgraph_detector tensorrt_subgraph_pass
55
CACHE INTERNAL "")
66

7+
set(pass_file ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h)
8+
file(APPEND ${pass_file} "USE_PASS(tensorrt_subgraph_pass);\n")
79
set(INFER_IR_PASSES ${INFER_IR_PASSES} tensorrt_subgraph_pass CACHE INTERNAL "")

0 commit comments

Comments
 (0)