pull/464/head
t00456437 5 years ago
parent 6339a3ba6c
commit 8ad52ac684

@ -247,3 +247,28 @@ INT32 mmGetEnv(const CHAR *name, CHAR *value, UINT32 len)
{ {
return 0; return 0;
} }
INT32 mmDlclose(VOID *handle)
{
return 0;
}
CHAR *mmDlerror()
{
return "";
}
INT32 mmDladdr(VOID *addr, mmDlInfo *info)
{
return 0;
}
VOID *mmDlopen(const CHAR *fileName, INT32 mode)
{
return NULL;
}
VOID *mmDlsym(VOID *handle, const CHAR *funcName)
{
return NULL;
}

@ -307,3 +307,74 @@ rtError_t rtModelBindQueue(rtModel_t model, uint32_t queueId, rtModelQueueFlag_t
{ {
return RT_ERROR_NONE; return RT_ERROR_NONE;
} }
rtError_t rtSetSocVersion(const char *version)
{
return RT_ERROR_NONE;
}
rtError_t rtGetSocVersion(char *version, const uint32_t maxLen)
{
return RT_ERROR_NONE;
}
rtError_t rtSetTaskFailCallback(rtTaskFailCallback callback)
{
return RT_ERROR_NONE;
}
rtError_t rtMallocHostSharedMemory(rtMallocHostSharedMemoryIn *in,
rtMallocHostSharedMemoryOut *out)
{
out->ptr = new uint8_t[in->size];
out->devPtr = new uint8_t[in->size];
return RT_ERROR_NONE;
}
rtError_t rtFreeHostSharedMemory(rtFreeHostSharedMemoryIn *in)
{
delete[] (uint8_t*)in->ptr;
delete[] (uint8_t*)in->devPtr;
return RT_ERROR_NONE;
}
rtError_t rtGetAicpuDeploy(rtAicpuDeployType_t *deplyType)
{
return RT_ERROR_NONE;
}
rtError_t rtDebugRegister(rtModel_t model, uint32_t flag, const void *addr, uint32_t *streamId, uint32_t *taskId)
{
return RT_ERROR_NONE;
}
rtError_t rtDebugUnRegister(rtModel_t model)
{
return RT_ERROR_NONE;
}
rtError_t rtDumpAddrSet(rtModel_t model, void *addr, uint32_t dumpSize, uint32_t flag)
{
return RT_ERROR_NONE;
}
rtError_t rtSetCtxINFMode(bool mode)
{
return RT_ERROR_NONE;
}
rtError_t rtLabelCreateEx(rtLabel_t *label, rtStream_t stream)
{
*label = new uint32_t;
return RT_ERROR_NONE;
}
rtError_t rtGetRtCapability(rtFeatureType_t featureType, int32_t featureInfo, int64_t *value)
{
return RT_ERROR_NONE;
}
rtError_t rtGetMaxStreamAndTask(uint32_t streamType, uint32_t *maxStrCount, uint32_t *maxTaskCount)
{
return RT_ERROR_NONE;
}

@ -38,6 +38,8 @@ void DlogWithKVInner(int module_id, int level, KeyValue *pst_kv_array, int kv_nu
dav_log(module_id, fmt); dav_log(module_id, fmt);
} }
int dlog_setlevel(int module_id, int level, int enable_event) { return DLOG_DEBUG; }
int dlog_getlevel(int module_id, int *enable_event) { return DLOG_DEBUG; } int dlog_getlevel(int module_id, int *enable_event) { return DLOG_DEBUG; }
int CheckLogLevel(int moduleId, int logLevel) int CheckLogLevel(int moduleId, int logLevel)

File diff suppressed because it is too large Load Diff

@ -40,20 +40,22 @@ std::vector<void *> stub_get_output_addrs(const RuntimeParam &model_param, Const
} }
TEST_F(UtestDataDumper, LoadDumpInfo_no_output_addrs_fail) { TEST_F(UtestDataDumper, LoadDumpInfo_no_output_addrs_fail) {
DataDumper data_dumper; RuntimeParam rts_param;
DataDumper data_dumper(rts_param);
data_dumper.SetModelName("test"); data_dumper.SetModelName("test");
data_dumper.SetModelId(2333); data_dumper.SetModelId(2333);
data_dumper.SetMemory(std::move(RuntimeParam{}));
std::shared_ptr<OpDesc> op_desc_1(new OpDesc()); std::shared_ptr<OpDesc> op_desc_1(new OpDesc());
op_desc_1->AddOutputDesc("test", GeTensorDesc()); op_desc_1->AddOutputDesc("test", GeTensorDesc());
data_dumper.SaveDumpTask(0, op_desc_1, 0); data_dumper.SaveDumpTask(0, op_desc_1, 0);
string dump_mode = "output";
data_dumper.dump_properties_.SetDumpMode(dump_mode);
Status ret = data_dumper.LoadDumpInfo(); Status ret = data_dumper.LoadDumpInfo();
EXPECT_EQ(ret, PARAM_INVALID); EXPECT_EQ(ret, SUCCESS);
} }
TEST_F(UtestDataDumper, UnloadDumpInfo_success) { TEST_F(UtestDataDumper, UnloadDumpInfo_success) {
DataDumper data_dumper; RuntimeParam rts_param
DataDumper data_dumper(rts_param);
data_dumper.SetModelName("test"); data_dumper.SetModelName("test");
data_dumper.SetModelId(2333); data_dumper.SetModelId(2333);

@ -25,7 +25,6 @@
#include "graph/utils/graph_utils.h" #include "graph/utils/graph_utils.h"
#include "graph/model_serialize.h" #include "graph/model_serialize.h"
#include "graph/load/new_model_manager/davinci_model.h" #include "graph/load/new_model_manager/davinci_model.h"
#include "graph/load/new_model_manager/model_output.h"
#include "common/properties_manager.h" #include "common/properties_manager.h"
#include "common/op/ge_op_utils.h" #include "common/op/ge_op_utils.h"
#include <cce/taskdown_api.h> #include <cce/taskdown_api.h>

@ -113,7 +113,7 @@ class DModelListener : public ge::ModelListener {
uint32_t OnComputeDone(uint32_t model_id, uint32_t data_index, uint32_t resultCode) { return 0; } uint32_t OnComputeDone(uint32_t model_id, uint32_t data_index, uint32_t resultCode) { return 0; }
}; };
shared_ptr<ge::ModelListener> UTEST_CALL_BACK_FUN(new DModelListener()); shared_ptr<ModelListener> UTEST_CALL_BACK_FUN(new DModelListener());
TEST_F(UtestModelManagerModelManager, case_load_incorrect_param) { TEST_F(UtestModelManagerModelManager, case_load_incorrect_param) {
ModelManager mm; ModelManager mm;
@ -164,7 +164,7 @@ TEST_F(UtestModelManagerModelManager, case_load_model_encypt_type_unsupported) {
delete[](uint8_t *) data.model_data; delete[](uint8_t *) data.model_data;
} }
shared_ptr<ge::ModelListener> LabelCallBack(new DModelListener()); shared_ptr<ModelListener> LabelCallBack(new DModelListener());
// test HandleCommand // test HandleCommand
TEST_F(UtestModelManagerModelManager, command_success1) { TEST_F(UtestModelManagerModelManager, command_success1) {
@ -306,6 +306,8 @@ TEST_F(UtestModelManagerModelManager, get_input_output_desc_info_fail) {
EXPECT_EQ(ge::PARAM_INVALID, manager.GetInputOutputDescInfo(2, input_shape, output_shape)); EXPECT_EQ(ge::PARAM_INVALID, manager.GetInputOutputDescInfo(2, input_shape, output_shape));
} }
/*
// test GetInputOutputDescInfo fail // test GetInputOutputDescInfo fail
TEST_F(UtestModelManagerModelManager, get_input_output_desc_info_zero_copy_fail) { TEST_F(UtestModelManagerModelManager, get_input_output_desc_info_zero_copy_fail) {
ModelManager manager; ModelManager manager;
@ -314,6 +316,7 @@ TEST_F(UtestModelManagerModelManager, get_input_output_desc_info_zero_copy_fail)
vector<InputOutputDescInfo> output_shape; vector<InputOutputDescInfo> output_shape;
EXPECT_EQ(ge::PARAM_INVALID, manager.GetInputOutputDescInfoForZeroCopy(2, input_shape, output_shape)); EXPECT_EQ(ge::PARAM_INVALID, manager.GetInputOutputDescInfoForZeroCopy(2, input_shape, output_shape));
} }
*/
// test Stop // test Stop
TEST_F(UtestModelManagerModelManager, stop_fail) { TEST_F(UtestModelManagerModelManager, stop_fail) {
@ -324,7 +327,7 @@ TEST_F(UtestModelManagerModelManager, stop_fail) {
// build input_data // build input_data
TEST_F(UtestModelManagerModelManager, check_data_len_success) { TEST_F(UtestModelManagerModelManager, check_data_len_success) {
shared_ptr<ge::ModelListener> g_label_call_back(new DModelListener()); shared_ptr<ModelListener> g_label_call_back(new DModelListener());
DavinciModel model(0, g_label_call_back); DavinciModel model(0, g_label_call_back);
ModelManager model_manager; ModelManager model_manager;
ge::InputData input_data; ge::InputData input_data;

@ -151,7 +151,7 @@ class OmeTestOpUtils {
ge::Model::Load((uint8_t *)data.model_data, data.model_len, *model_); ge::Model::Load((uint8_t *)data.model_data, data.model_len, *model_);
GeModelPtr ge_model; GeModelPtr ge_model;
ModelHelper::TransModelToGeModel(model_, ge_model); TransModelToGeModel(model_, ge_model);
davinciModel.Assign(ge_model); davinciModel.Assign(ge_model);
if (data.model_data != nullptr) { if (data.model_data != nullptr) {
@ -178,7 +178,7 @@ class OmeTestOpUtils {
model->SetGraph(graph); model->SetGraph(graph);
GeModelPtr ge_model; GeModelPtr ge_model;
ModelHelper::TransModelToGeModel(model, ge_model); TransModelToGeModel(model, ge_model);
davinciModel.Assign(ge_model); davinciModel.Assign(ge_model);
} }

@ -38,7 +38,7 @@ class UtestGraphPassesFlowCtrlPass : public testing::Test {
EXPECT_EQ(SUCCESS, ge::VarManager::Instance(0)->Init(session_version, session_id, device_id, job_id)); EXPECT_EQ(SUCCESS, ge::VarManager::Instance(0)->Init(session_version, session_id, device_id, job_id));
} }
void TearDown() { VarManagerPool::Instance().Destroy(); } void TearDown() { VarManagerPool::Instance().Destory(); }
public: public:
/// Set up a graph with the following network structure /// Set up a graph with the following network structure

@ -18,7 +18,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/add_kernel.h" #include "host_kernels/add_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"

@ -31,7 +31,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/broadcast_args_kernel.h" #include "host_kernels/broadcast_args_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"

@ -31,7 +31,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/broadcast_gradient_args_kernel.h" #include "host_kernels/broadcast_gradient_args_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"

@ -18,7 +18,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/cast_kernel.h" #include "host_kernels/cast_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"
@ -28,7 +28,7 @@
#include "common/types.h" #include "common/types.h"
#include "graph/debug/ge_attr_define.h" #include "graph/debug/ge_attr_define.h"
#include "graph/passes/dimension_compute_pass.h" #include "graph/passes/dimension_compute_pass.h"
#include "graph/passes/folding_kernel/kernel_utils.h" #include "host_kernels/kernel_utils.h"
#include "graph/types.h" #include "graph/types.h"
#include "graph/utils/attr_utils.h" #include "graph/utils/attr_utils.h"
#include "graph/utils/graph_utils.h" #include "graph/utils/graph_utils.h"

@ -18,7 +18,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/concat_offset_kernel.h" #include "host_kernels/concat_offset_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"
@ -28,7 +28,7 @@
#include "common/types.h" #include "common/types.h"
#include "graph/debug/ge_attr_define.h" #include "graph/debug/ge_attr_define.h"
#include "graph/passes/dimension_compute_pass.h" #include "graph/passes/dimension_compute_pass.h"
#include "graph/passes/folding_kernel/kernel_utils.h" #include "host_kernels/kernel_utils.h"
#include "graph/types.h" #include "graph/types.h"
#include "graph/utils/attr_utils.h" #include "graph/utils/attr_utils.h"
#include "graph/utils/graph_utils.h" #include "graph/utils/graph_utils.h"

@ -18,7 +18,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/concat_v2_kernel.h" #include "host_kernels/concat_v2_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"
@ -28,7 +28,7 @@
#include "common/types.h" #include "common/types.h"
#include "graph/debug/ge_attr_define.h" #include "graph/debug/ge_attr_define.h"
#include "graph/passes/dimension_compute_pass.h" #include "graph/passes/dimension_compute_pass.h"
#include "graph/passes/folding_kernel/kernel_utils.h" #include "host_kernels/kernel_utils.h"
#include "graph/types.h" #include "graph/types.h"
#include "graph/utils/attr_utils.h" #include "graph/utils/attr_utils.h"
#include "graph/utils/graph_utils.h" #include "graph/utils/graph_utils.h"

@ -18,7 +18,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/dynamic_stitch_kernel.h" #include "host_kernels/dynamic_stitch_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"
@ -27,7 +27,7 @@
#include "common/op/attr_value_util.h" #include "common/op/attr_value_util.h"
#include "common/types.h" #include "common/types.h"
#include "graph/debug/ge_attr_define.h" #include "graph/debug/ge_attr_define.h"
#include "graph/passes/folding_kernel/kernel_utils.h" #include "host_kernels/kernel_utils.h"
#include "graph/types.h" #include "graph/types.h"
#include "graph/utils/attr_utils.h" #include "graph/utils/attr_utils.h"
#include "graph/utils/graph_utils.h" #include "graph/utils/graph_utils.h"

@ -31,7 +31,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/empty_kernel.h" #include "host_kernels/empty_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"

@ -18,7 +18,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/expanddims_kernel.h" #include "host_kernels/expanddims_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"

@ -18,7 +18,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/fill_kernel.h" #include "host_kernels/fill_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/fp16_t.h" #include "common/fp16_t.h"

@ -18,13 +18,13 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/floordiv_kernel.h" #include "host_kernels/floordiv_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"
#include "common/op/ge_op_utils.h" #include "common/op/ge_op_utils.h"
#include "common/types.h" #include "common/types.h"
#include "graph/passes/folding_kernel/kernel_utils.h" #include "host_kernels/kernel_utils.h"
#include "graph/types.h" #include "graph/types.h"
#include "graph/utils/attr_utils.h" #include "graph/utils/attr_utils.h"
#include "graph/utils/graph_utils.h" #include "graph/utils/graph_utils.h"

@ -20,7 +20,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/floormod_kernel.h" #include "host_kernels/floormod_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"

@ -27,7 +27,7 @@
#include "graph/debug/ge_attr_define.h" #include "graph/debug/ge_attr_define.h"
#include "graph/operator.h" #include "graph/operator.h"
#include "graph/passes/constant_folding_pass.h" #include "graph/passes/constant_folding_pass.h"
#include "graph/passes/folding_kernel/broadcast_args_kernel.h" #include "host_kernels/broadcast_args_kernel.h"
#include "inc/kernel_factory.h" #include "inc/kernel_factory.h"
#include "shape_refiner.h" #include "shape_refiner.h"

@ -19,7 +19,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/gather_v2_kernel.h" #include "host_kernels/gather_v2_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"
@ -29,7 +29,7 @@
#include "common/types.h" #include "common/types.h"
#include "graph/debug/ge_attr_define.h" #include "graph/debug/ge_attr_define.h"
#include "graph/passes/dimension_compute_pass.h" #include "graph/passes/dimension_compute_pass.h"
#include "graph/passes/folding_kernel/kernel_utils.h" #include "host_kernels/kernel_utils.h"
#include "graph/types.h" #include "graph/types.h"
#include "graph/utils/attr_utils.h" #include "graph/utils/attr_utils.h"
#include "graph/utils/graph_utils.h" #include "graph/utils/graph_utils.h"

@ -18,7 +18,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/greater_kernel.h" #include "host_kernels/greater_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"

@ -20,7 +20,7 @@
#define protected public #define protected public
#define private public #define private public
#include "graph/passes/folding_kernel/maximum_kernel.h" #include "host_kernels/maximum_kernel.h"
#include "common/debug/log.h" #include "common/debug/log.h"
#include "common/debug/memory_dumper.h" #include "common/debug/memory_dumper.h"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save