commit
e31aef9f6e
@ -1,147 +0,0 @@
|
|||||||
# - This module looks for Sphinx
|
|
||||||
# Find the Sphinx documentation generator
|
|
||||||
#
|
|
||||||
# This modules defines
|
|
||||||
# SPHINX_EXECUTABLE
|
|
||||||
# SPHINX_FOUND
|
|
||||||
|
|
||||||
find_program(SPHINX_EXECUTABLE
|
|
||||||
NAMES sphinx-build
|
|
||||||
PATHS
|
|
||||||
/usr/bin
|
|
||||||
/usr/local/bin
|
|
||||||
/opt/local/bin
|
|
||||||
DOC "Sphinx documentation generator"
|
|
||||||
)
|
|
||||||
|
|
||||||
if( NOT SPHINX_EXECUTABLE )
|
|
||||||
set(_Python_VERSIONS
|
|
||||||
2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5
|
|
||||||
)
|
|
||||||
|
|
||||||
foreach( _version ${_Python_VERSIONS} )
|
|
||||||
set( _sphinx_NAMES sphinx-build-${_version} )
|
|
||||||
|
|
||||||
find_program( SPHINX_EXECUTABLE
|
|
||||||
NAMES ${_sphinx_NAMES}
|
|
||||||
PATHS
|
|
||||||
/usr/bin
|
|
||||||
/usr/local/bin
|
|
||||||
/opt/loca/bin
|
|
||||||
DOC "Sphinx documentation generator"
|
|
||||||
)
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
|
|
||||||
find_package_handle_standard_args(Sphinx DEFAULT_MSG
|
|
||||||
SPHINX_EXECUTABLE
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
option( SPHINX_HTML_OUTPUT "Build a single HTML with the whole content." ON )
|
|
||||||
option( SPHINX_DIRHTML_OUTPUT "Build HTML pages, but with a single directory per document." OFF )
|
|
||||||
option( SPHINX_HTMLHELP_OUTPUT "Build HTML pages with additional information for building a documentation collection in htmlhelp." OFF )
|
|
||||||
option( SPHINX_QTHELP_OUTPUT "Build HTML pages with additional information for building a documentation collection in qthelp." OFF )
|
|
||||||
option( SPHINX_DEVHELP_OUTPUT "Build HTML pages with additional information for building a documentation collection in devhelp." OFF )
|
|
||||||
option( SPHINX_EPUB_OUTPUT "Build HTML pages with additional information for building a documentation collection in epub." OFF )
|
|
||||||
option( SPHINX_LATEX_OUTPUT "Build LaTeX sources that can be compiled to a PDF document using pdflatex." OFF )
|
|
||||||
option( SPHINX_MAN_OUTPUT "Build manual pages in groff format for UNIX systems." OFF )
|
|
||||||
option( SPHINX_TEXT_OUTPUT "Build plain text files." OFF )
|
|
||||||
|
|
||||||
|
|
||||||
mark_as_advanced(
|
|
||||||
SPHINX_EXECUTABLE
|
|
||||||
SPHINX_HTML_OUTPUT
|
|
||||||
SPHINX_DIRHTML_OUTPUT
|
|
||||||
SPHINX_HTMLHELP_OUTPUT
|
|
||||||
SPHINX_QTHELP_OUTPUT
|
|
||||||
SPHINX_DEVHELP_OUTPUT
|
|
||||||
SPHINX_EPUB_OUTPUT
|
|
||||||
SPHINX_LATEX_OUTPUT
|
|
||||||
SPHINX_MAN_OUTPUT
|
|
||||||
SPHINX_TEXT_OUTPUT
|
|
||||||
)
|
|
||||||
|
|
||||||
function( Sphinx_add_target target_name builder conf cache source destination )
|
|
||||||
add_custom_target( ${target_name} ALL
|
|
||||||
COMMAND ${SPHINX_EXECUTABLE} -b ${builder}
|
|
||||||
-d ${cache}
|
|
||||||
-c ${conf}
|
|
||||||
${source}
|
|
||||||
${destination}
|
|
||||||
COMMENT "Generating sphinx documentation: ${builder}"
|
|
||||||
COMMAND cd ${destination} && ln -sf ./index_*.html index.html
|
|
||||||
)
|
|
||||||
|
|
||||||
set_property(
|
|
||||||
DIRECTORY APPEND PROPERTY
|
|
||||||
ADDITIONAL_MAKE_CLEAN_FILES
|
|
||||||
${destination}
|
|
||||||
)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# Target dependencies can be optionally listed at the end.
|
|
||||||
function( Sphinx_add_targets target_base_name conf source base_destination )
|
|
||||||
|
|
||||||
set( _dependencies )
|
|
||||||
|
|
||||||
foreach( arg IN LISTS ARGN )
|
|
||||||
set( _dependencies ${_dependencies} ${arg} )
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if( ${SPHINX_HTML_OUTPUT} )
|
|
||||||
Sphinx_add_target( ${target_base_name}_html html ${conf} ${source} ${base_destination}/html )
|
|
||||||
|
|
||||||
add_dependencies( ${target_base_name}_html ${_dependencies} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( ${SPHINX_DIRHTML_OUTPUT} )
|
|
||||||
Sphinx_add_target( ${target_base_name}_dirhtml dirhtml ${conf} ${source} ${base_destination}/dirhtml )
|
|
||||||
|
|
||||||
add_dependencies( ${target_base_name}_dirhtml ${_dependencies} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( ${SPHINX_QTHELP_OUTPUT} )
|
|
||||||
Sphinx_add_target( ${target_base_name}_qthelp qthelp ${conf} ${source} ${base_destination}/qthelp )
|
|
||||||
|
|
||||||
add_dependencies( ${target_base_name}_qthelp ${_dependencies} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( ${SPHINX_DEVHELP_OUTPUT} )
|
|
||||||
Sphinx_add_target( ${target_base_name}_devhelp devhelp ${conf} ${source} ${base_destination}/devhelp )
|
|
||||||
|
|
||||||
add_dependencies( ${target_base_name}_devhelp ${_dependencies} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( ${SPHINX_EPUB_OUTPUT} )
|
|
||||||
Sphinx_add_target( ${target_base_name}_epub epub ${conf} ${source} ${base_destination}/epub )
|
|
||||||
|
|
||||||
add_dependencies( ${target_base_name}_epub ${_dependencies} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( ${SPHINX_LATEX_OUTPUT} )
|
|
||||||
Sphinx_add_target( ${target_base_name}_latex latex ${conf} ${source} ${base_destination}/latex )
|
|
||||||
|
|
||||||
add_dependencies( ${target_base_name}_latex ${_dependencies} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( ${SPHINX_MAN_OUTPUT} )
|
|
||||||
Sphinx_add_target( ${target_base_name}_man man ${conf} ${source} ${base_destination}/man )
|
|
||||||
|
|
||||||
add_dependencies( ${target_base_name}_man ${_dependencies} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( ${SPHINX_TEXT_OUTPUT} )
|
|
||||||
Sphinx_add_target( ${target_base_name}_text text ${conf} ${source} ${base_destination}/text )
|
|
||||||
|
|
||||||
add_dependencies( ${target_base_name}_text ${_dependencies} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( ${BUILD_TESTING} )
|
|
||||||
sphinx_add_target( ${target_base_name}_linkcheck linkcheck ${conf} ${source} ${base_destination}/linkcheck )
|
|
||||||
|
|
||||||
add_dependencies( ${target_base_name}_linkcheck ${_dependencies} )
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
@ -0,0 +1,21 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace paddle {
|
||||||
|
namespace framework {
|
||||||
|
|
||||||
|
static std::string paddle_commit() {
|
||||||
|
return "@PADDLE_COMMIT@";
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string paddle_compile_branch() {
|
||||||
|
return "@PADDLE_BRANCH@";
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string paddle_version() {
|
||||||
|
return "@PADDLE_VERSION@";
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace framework
|
||||||
|
} // namespace paddle
|
File diff suppressed because it is too large
Load Diff
@ -1,64 +0,0 @@
|
|||||||
/* 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 <algorithm>
|
|
||||||
#include <string>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "paddle/fluid/framework/attribute.h"
|
|
||||||
#include "paddle/fluid/framework/op_info.h"
|
|
||||||
#include "paddle/fluid/framework/op_kernel_type.h"
|
|
||||||
#include "paddle/fluid/framework/operator.h"
|
|
||||||
#include "paddle/fluid/framework/program_desc.h"
|
|
||||||
#include "paddle/fluid/framework/scope.h"
|
|
||||||
#include "paddle/fluid/platform/variant.h"
|
|
||||||
|
|
||||||
#include "ngraph/type/element_type.hpp"
|
|
||||||
|
|
||||||
namespace paddle {
|
|
||||||
namespace framework {
|
|
||||||
|
|
||||||
class NgraphOperator : public OperatorBase {
|
|
||||||
public:
|
|
||||||
static std::vector<
|
|
||||||
std::vector<std::vector<std::unique_ptr<OperatorBase>>::iterator>>
|
|
||||||
NgraphOpIntervals(
|
|
||||||
std::vector<std::unique_ptr<paddle::framework::OperatorBase>>* ops);
|
|
||||||
|
|
||||||
explicit NgraphOperator(
|
|
||||||
const ProgramDesc& prog, size_t block_id,
|
|
||||||
std::vector<std::unique_ptr<OperatorBase>>::iterator start,
|
|
||||||
std::vector<std::unique_ptr<OperatorBase>>::iterator end,
|
|
||||||
const std::string& type = "fused_op", const VariableNameMap& inputs = {},
|
|
||||||
const VariableNameMap& outputs = {}, const AttributeMap& attrs = {});
|
|
||||||
|
|
||||||
void RunImpl(const Scope& scope, const platform::Place& place) const final;
|
|
||||||
|
|
||||||
private:
|
|
||||||
const ProgramDesc pdesc_;
|
|
||||||
size_t block_;
|
|
||||||
std::vector<std::shared_ptr<OperatorBase>> fused_ops_;
|
|
||||||
std::unordered_map<std::string, ngraph::element::Type> var_type_map_;
|
|
||||||
std::unordered_set<std::string> persistables_;
|
|
||||||
std::unordered_set<std::string> fetches_;
|
|
||||||
std::unordered_set<std::string> post_op_inputs_;
|
|
||||||
bool is_full_ = false;
|
|
||||||
|
|
||||||
void Process();
|
|
||||||
};
|
|
||||||
} // namespace framework
|
|
||||||
} // namespace paddle
|
|
@ -1,5 +1,5 @@
|
|||||||
if(WITH_PYTHON)
|
if(WITH_PYTHON)
|
||||||
cc_library(layer SRCS layer.cc DEPS proto_desc operator)
|
cc_library(layer SRCS layer.cc DEPS proto_desc operator device_context blas)
|
||||||
cc_library(tracer SRCS tracer.cc DEPS proto_desc)
|
cc_library(tracer SRCS tracer.cc DEPS proto_desc device_context)
|
||||||
cc_library(engine SRCS engine.cc)
|
cc_library(engine SRCS engine.cc)
|
||||||
endif()
|
endif()
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue