回退 'Pull Request !208 : fix graphengine compilation'
parent
9d79097319
commit
6d74596eaf
@ -1,6 +1,6 @@
|
||||
inc_path := $(shell pwd)/inc/external/
|
||||
inc_path := $(shell pwd)/metadef/inc/external/
|
||||
out_path := $(shell pwd)/out/graph/lib64/stub/
|
||||
stub_path := $(shell pwd)/common/graph/stub/
|
||||
stub_path := $(shell pwd)/metadef/graph/stub/
|
||||
|
||||
mkdir_stub := $(shell mkdir -p $(out_path))
|
||||
graph_local_stub := $(shell $(HI_PYTHON) $(stub_path)/gen_stubapi.py $(inc_path) $(out_path))
|
||||
|
@ -1,66 +0,0 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# task.proto is old task, add it for ops_kernel_info_store
|
||||
local_ge_runtime_src_files := \
|
||||
model_runner.cc \
|
||||
runtime_model.cc \
|
||||
output.cc \
|
||||
task/aicpu_task.cc \
|
||||
task/cce_task.cc \
|
||||
task/tbe_task.cc \
|
||||
task/event_record_task.cc \
|
||||
task/event_wait_task.cc \
|
||||
task/stream_active_task.cc \
|
||||
task/stream_switch_task.cc \
|
||||
task/hccl_task.cc \
|
||||
task/memcpy_async_task.cc \
|
||||
task/profiler_task.cc \
|
||||
|
||||
local_ge_runtime_include := \
|
||||
$(LOCAL_PATH)/ \
|
||||
$(TOPDIR)libc_sec/include \
|
||||
$(TOPDIR)inc/external \
|
||||
$(TOPDIR)inc/external/graph \
|
||||
$(TOPDIR)inc/framework \
|
||||
$(TOPDIR)inc/graph \
|
||||
$(TOPDIR)inc \
|
||||
$(LOCAL_PATH)/../ \
|
||||
third_party/protobuf/include
|
||||
|
||||
local_ge_runtime_shared_library := \
|
||||
libruntime \
|
||||
libslog \
|
||||
libc_sec
|
||||
|
||||
local_ge_runtime_ldflags := -lrt -ldl
|
||||
|
||||
# compile device libge_runtime
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libge_runtime
|
||||
LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2
|
||||
LOCAL_CFLAGS += -Werror
|
||||
LOCAL_SRC_FILES := $(local_ge_runtime_src_files)
|
||||
LOCAL_C_INCLUDES := $(local_ge_runtime_include)
|
||||
LOCAL_SHARED_LIBRARIES := $(local_ge_runtime_shared_library)
|
||||
LOCAL_LDFLAGS += $(local_ge_runtime_ldflags)
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
# compile host libge_runtime
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libge_runtime
|
||||
LOCAL_CFLAGS += -Werror
|
||||
LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0
|
||||
ifeq ($(DEBUG), 1)
|
||||
LOCAL_CFLAGS += -g -O0
|
||||
else
|
||||
LOCAL_CFLAGS += -O2
|
||||
endif
|
||||
LOCAL_SRC_FILES := $(local_ge_runtime_src_files)
|
||||
LOCAL_C_INCLUDES := $(local_ge_runtime_include)
|
||||
LOCAL_SHARED_LIBRARIES := $(local_ge_runtime_shared_library)
|
||||
LOCAL_LDFLAGS += $(local_ge_runtime_ldflags)
|
||||
|
||||
include $(BUILD_HOST_SHARED_LIBRARY)
|
File diff suppressed because it is too large
Load Diff
@ -1,52 +0,0 @@
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := atc
|
||||
|
||||
LOCAL_CFLAGS += -Werror
|
||||
LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -DCOMPILE_OMG_PACKAGE -O2
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
main.cc \
|
||||
single_op_parser.cc \
|
||||
../session/omg.cc \
|
||||
../ir_build/atc_ir_common.cc \
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(LOCAL_PATH)/../ ./ \
|
||||
$(TOPDIR)inc \
|
||||
$(TOPDIR)inc/external \
|
||||
$(TOPDIR)inc/external/graph \
|
||||
$(TOPDIR)inc/framework \
|
||||
$(TOPDIR)inc/framework/domi \
|
||||
$(TOPDIR)libc_sec/include \
|
||||
$(TOPDIR)inc/common/util \
|
||||
third_party/json/include \
|
||||
third_party/gflags/include \
|
||||
third_party/protobuf/include \
|
||||
proto/om.proto \
|
||||
proto/ge_ir.proto \
|
||||
proto/task.proto \
|
||||
proto/insert_op.proto \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libc_sec \
|
||||
libge_common \
|
||||
libprotobuf \
|
||||
libslog \
|
||||
libgraph \
|
||||
libregister \
|
||||
liberror_manager \
|
||||
libge_compiler \
|
||||
libruntime_compile \
|
||||
libparser_common \
|
||||
liberror_manager \
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libgflags
|
||||
|
||||
LOCAL_LDFLAGS := -lrt -ldl
|
||||
|
||||
include $(BUILD_HOST_EXECUTABLE)
|
||||
|
@ -1 +0,0 @@
|
||||
../../../../inc/common/proto/ge_ir.proto
|
@ -1 +0,0 @@
|
||||
../../../../inc/common/proto/insert_op.proto
|
@ -1 +0,0 @@
|
||||
../../../../inc/common/proto/om.proto
|
@ -1 +0,0 @@
|
||||
../../proto/task.proto
|
File diff suppressed because it is too large
Load Diff
@ -1,80 +0,0 @@
|
||||
/**
|
||||
* Copyright 2020 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ACL_TOOLS_COMPILE_PARSER_H
|
||||
#define ACL_TOOLS_COMPILE_PARSER_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "ge/ge_api_error_codes.h"
|
||||
#include "graph/types.h"
|
||||
#include "graph/ge_attr_value.h"
|
||||
#include "graph/op_desc.h"
|
||||
|
||||
namespace ge {
|
||||
struct SingleOpTensorDesc {
|
||||
std::string name;
|
||||
std::vector<int64_t> dims;
|
||||
std::vector<std::vector<int64_t>> dim_ranges;
|
||||
ge::Format format = ge::FORMAT_RESERVED;
|
||||
ge::DataType type = ge::DT_UNDEFINED;
|
||||
};
|
||||
|
||||
struct SingleOpAttr {
|
||||
std::string name;
|
||||
std::string type;
|
||||
ge::GeAttrValue value;
|
||||
};
|
||||
|
||||
struct SingleOpDesc {
|
||||
std::string op;
|
||||
std::vector<SingleOpTensorDesc> input_desc;
|
||||
std::vector<SingleOpTensorDesc> output_desc;
|
||||
std::vector<SingleOpAttr> attrs;
|
||||
};
|
||||
|
||||
struct SingleOpBuildParam {
|
||||
ge::OpDescPtr op_desc;
|
||||
std::vector<ge::GeTensor> inputs;
|
||||
std::vector<ge::GeTensor> outputs;
|
||||
std::string file_name;
|
||||
};
|
||||
|
||||
void from_json(const nlohmann::json &json, SingleOpTensorDesc &desc);
|
||||
|
||||
void from_json(const nlohmann::json &json, SingleOpAttr &desc);
|
||||
|
||||
void from_json(const nlohmann::json &json, SingleOpDesc &desc);
|
||||
|
||||
class SingleOpParser {
|
||||
public:
|
||||
static Status ParseSingleOpList(const std::string &file, std::vector<SingleOpBuildParam> &op_list);
|
||||
|
||||
private:
|
||||
static Status ReadJsonFile(const std::string &file, nlohmann::json &json_obj);
|
||||
static bool Validate(const SingleOpDesc &op_desc);
|
||||
static std::unique_ptr<OpDesc> CreateOpDesc(const std::string &op_type);
|
||||
static Status ConvertToBuildParam(int index, const SingleOpDesc &single_op_desc, SingleOpBuildParam &build_param);
|
||||
static Status VerifyOpInputOutputSizeByIr(const OpDesc ¤t_op_desc);
|
||||
static Status SetShapeRange(const std::string &op_name, const SingleOpTensorDesc &tensor_desc,
|
||||
GeTensorDesc &ge_tensor_desc);
|
||||
};
|
||||
} // namespace ge
|
||||
|
||||
#endif // ACL_TOOLS_COMPILE_PARSER_H
|
Loading…
Reference in new issue