提交 57800320 编写于 作者: T tangshihua

静态检查修改

Signed-off-by: Ntangshihua <tangshihua@huawei.com>
上级 79e2f061
...@@ -175,7 +175,7 @@ int32_t MockIDevice::ReleaseBuffer(const SharedBuffer &buffer) ...@@ -175,7 +175,7 @@ int32_t MockIDevice::ReleaseBuffer(const SharedBuffer &buffer)
return HDF_SUCCESS; return HDF_SUCCESS;
} }
int32_t MockIDevice::MemoryCopy(float *data, uint32_t length) int32_t MockIDevice::MemoryCopy(float* data, uint32_t length)
{ {
auto memManager = NeuralNetworkRuntime::MemoryManager::GetInstance(); auto memManager = NeuralNetworkRuntime::MemoryManager::GetInstance();
auto memAddress = memManager->MapMemory(m_bufferFd, length); auto memAddress = memManager->MapMemory(m_bufferFd, length);
...@@ -198,7 +198,7 @@ int32_t MockIDevice::PrepareModel(const Model& model, const ModelConfig& config, ...@@ -198,7 +198,7 @@ int32_t MockIDevice::PrepareModel(const Model& model, const ModelConfig& config,
} }
int32_t MockIDevice::PrepareModelFromModelCache(const std::vector<SharedBuffer>& modelCache, const ModelConfig& config, int32_t MockIDevice::PrepareModelFromModelCache(const std::vector<SharedBuffer>& modelCache, const ModelConfig& config,
sptr<IPreparedModel>& preparedModel) sptr<IPreparedModel>& preparedModel)
{ {
preparedModel = new (std::nothrow) V1_0::MockIPreparedModel(); preparedModel = new (std::nothrow) V1_0::MockIPreparedModel();
return HDF_SUCCESS; return HDF_SUCCESS;
......
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
int32_t PrepareModelFromModelCache(const std::vector<SharedBuffer>& modelCache, const ModelConfig& config, int32_t PrepareModelFromModelCache(const std::vector<SharedBuffer>& modelCache, const ModelConfig& config,
sptr<IPreparedModel>& preparedModel) override; sptr<IPreparedModel>& preparedModel) override;
int32_t MemoryCopy(float *data, uint32_t length); int32_t MemoryCopy(float* data, uint32_t length);
void SetFP16Supported(bool isSupported); void SetFP16Supported(bool isSupported);
......
...@@ -194,7 +194,7 @@ int CompileGraphMock(OH_NNCompilation *compilation, const OHNNCompileParam &comp ...@@ -194,7 +194,7 @@ int CompileGraphMock(OH_NNCompilation *compilation, const OHNNCompileParam &comp
int ExecuteGraphMock(OH_NNExecutor *executor, const OHNNGraphArgs &graphArgs, int ExecuteGraphMock(OH_NNExecutor *executor, const OHNNGraphArgs &graphArgs,
float* expect) float* expect)
{ {
OHOS::sptr<V1_0::MockIDevice> device = V1_0::MockIDevice::GetInstance(); OHOS::sptr<V1_0::MockIDevice> device = V1_0::MockIDevice::GetInstance();
int ret = 0; int ret = 0;
...@@ -234,7 +234,8 @@ float* expect) ...@@ -234,7 +234,8 @@ float* expect)
return ret; return ret;
} }
int ExecutorWithMemory(OH_NNExecutor *executor, const OHNNGraphArgs &graphArgs, OH_NN_Memory *OHNNMemory[], float *expect) int ExecutorWithMemory(OH_NNExecutor *executor, const OHNNGraphArgs &graphArgs, OH_NN_Memory *OHNNMemory[],
float* expect)
{ {
OHOS::sptr<V1_0::MockIDevice> device = V1_0::MockIDevice::GetInstance(); OHOS::sptr<V1_0::MockIDevice> device = V1_0::MockIDevice::GetInstance();
int ret = 0; int ret = 0;
......
...@@ -70,13 +70,13 @@ struct OHNNCompileParam { ...@@ -70,13 +70,13 @@ struct OHNNCompileParam {
int BuildSingleOpGraph(OH_NNModel *modelptr, const OHNNGraphArgs &args); int BuildSingleOpGraph(OH_NNModel *modelptr, const OHNNGraphArgs &args);
int ExecutorWithMemory(OH_NNExecutor *executor, const OHNNGraphArgs &graphArgs, OH_NN_Memory *OHNNMemory[], int ExecutorWithMemory(OH_NNExecutor *executor, const OHNNGraphArgs &graphArgs, OH_NN_Memory *OHNNMemory[],
float* expect); float* expect);
void Free(OH_NNModel *model = nullptr, OH_NNCompilation *compilation = nullptr, OH_NNExecutor *executor = nullptr); void Free(OH_NNModel *model = nullptr, OH_NNCompilation *compilation = nullptr, OH_NNExecutor *executor = nullptr);
int CompileGraphMock(OH_NNCompilation *compilation, const OHNNCompileParam &compileParam); int CompileGraphMock(OH_NNCompilation *compilation, const OHNNCompileParam &compileParam);
int ExecuteGraphMock(OH_NNExecutor *executor, const OHNNGraphArgs &graphArgs, float * expect); int ExecuteGraphMock(OH_NNExecutor *executor, const OHNNGraphArgs &graphArgs, float* expect);
int SetDevice(OH_NNCompilation *compilation); int SetDevice(OH_NNCompilation *compilation);
int BuildMultiOpGraph(OH_NNModel *model, const OHNNGraphArgsMulti &graphArgs); int BuildMultiOpGraph(OH_NNModel *model, const OHNNGraphArgsMulti &graphArgs);
......
...@@ -854,8 +854,8 @@ HWTEST_F(ModelTest, SUB_AI_NNRt_Func_North_Model_GetSupportedOperation_0400, Fun ...@@ -854,8 +854,8 @@ HWTEST_F(ModelTest, SUB_AI_NNRt_Func_North_Model_GetSupportedOperation_0400, Fun
uint32_t devicesCount{0}; uint32_t devicesCount{0};
ASSERT_EQ(OH_NN_SUCCESS, OH_NNDevice_GetAllDevicesID(&devicesID, &devicesCount)); ASSERT_EQ(OH_NN_SUCCESS, OH_NNDevice_GetAllDevicesID(&devicesID, &devicesCount));
size_t targetDevice = devicesID[0]; size_t targetDevice = devicesID[0];
ASSERT_EQ(OH_NN_INVALID_PARAMETER, OH_NNModel_GetAvailableOperations(model, targetDevice, &realSupported, &opCount)); ASSERT_EQ(OH_NN_INVALID_PARAMETER, OH_NNModel_GetAvailableOperations(model, targetDevice,
&realSupported, &opCount));
Free(model); Free(model);
} }
...@@ -875,8 +875,8 @@ HWTEST_F(ModelTest, SUB_AI_NNRt_Func_North_Model_GetSupportedOperation_0500, Fun ...@@ -875,8 +875,8 @@ HWTEST_F(ModelTest, SUB_AI_NNRt_Func_North_Model_GetSupportedOperation_0500, Fun
uint32_t devicesCount{0}; uint32_t devicesCount{0};
ASSERT_EQ(OH_NN_SUCCESS, OH_NNDevice_GetAllDevicesID(&devicesID, &devicesCount)); ASSERT_EQ(OH_NN_SUCCESS, OH_NNDevice_GetAllDevicesID(&devicesID, &devicesCount));
size_t targetDevice = devicesID[0]; size_t targetDevice = devicesID[0];
ASSERT_EQ(OH_NN_INVALID_PARAMETER, OH_NNModel_GetAvailableOperations(model, targetDevice, &isSupported, nullptr)); ASSERT_EQ(OH_NN_INVALID_PARAMETER, OH_NNModel_GetAvailableOperations(model, targetDevice,
&isSupported, nullptr));
Free(model); Free(model);
} }
...@@ -898,8 +898,8 @@ HWTEST_F(ModelTest, SUB_AI_NNRt_Func_North_Model_GetSupportedOperation_0600, Fun ...@@ -898,8 +898,8 @@ HWTEST_F(ModelTest, SUB_AI_NNRt_Func_North_Model_GetSupportedOperation_0600, Fun
uint32_t devicesCount{0}; uint32_t devicesCount{0};
ASSERT_EQ(OH_NN_SUCCESS, OH_NNDevice_GetAllDevicesID(&devicesID, &devicesCount)); ASSERT_EQ(OH_NN_SUCCESS, OH_NNDevice_GetAllDevicesID(&devicesID, &devicesCount));
size_t targetDevice = devicesID[0]; size_t targetDevice = devicesID[0];
ASSERT_EQ(OH_NN_OPERATION_FORBIDDEN, OH_NNModel_GetAvailableOperations(model, targetDevice, &isSupported, &opCount)); ASSERT_EQ(OH_NN_OPERATION_FORBIDDEN, OH_NNModel_GetAvailableOperations(model, targetDevice,
&isSupported, &opCount));
Free(model); Free(model);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册