diff options
Diffstat (limited to 'runtimes/neurun/test/interp/ExecManager.cc')
-rw-r--r-- | runtimes/neurun/test/interp/ExecManager.cc | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/runtimes/neurun/test/interp/ExecManager.cc b/runtimes/neurun/test/interp/ExecManager.cc index 05388810a..bce87a9b5 100644 --- a/runtimes/neurun/test/interp/ExecManager.cc +++ b/runtimes/neurun/test/interp/ExecManager.cc @@ -110,21 +110,13 @@ TEST_F(InterpExecManagerTest, setInput) CreateSimpleModel(); auto input1 = operand::IO::Index{0}; - auto input1_idx = _graph->getInputs().at(input1); - - auto input1_type = _graph->operands().at(input1_idx).typeInfo(); - auto input1_shape = _graph->operands().at(input1_idx).shape(); - const int32_t input1_buffer[4] = {1, 0, -1, -2}; - EXPECT_THROW(_executor->setInput(input1, input1_type, input1_shape, - reinterpret_cast<const void *>(input1_buffer), 4), + EXPECT_THROW(_executor->setInput(input1, reinterpret_cast<const void *>(input1_buffer), 4), std::runtime_error); - EXPECT_THROW(_executor->setInput(input1, input1_type, input1_shape, - reinterpret_cast<const void *>(input1_buffer), 12), + EXPECT_THROW(_executor->setInput(input1, reinterpret_cast<const void *>(input1_buffer), 12), std::runtime_error); - EXPECT_NO_THROW(_executor->setInput(input1, input1_type, input1_shape, - reinterpret_cast<const void *>(input1_buffer), 16)); + EXPECT_NO_THROW(_executor->setInput(input1, reinterpret_cast<const void *>(input1_buffer), 16)); } TEST_F(InterpExecManagerTest, setOutput) @@ -134,19 +126,13 @@ TEST_F(InterpExecManagerTest, setOutput) auto output = operand::IO::Index{0}; auto output_idx = _graph->getOutputs().at(output); - auto output_type = _graph->operands().at(output_idx).typeInfo(); - auto output_shape = _graph->operands().at(output_idx).shape(); - int32_t output_buffer[4] = {}; - EXPECT_THROW(_executor->setOutput(output, output_type, output_shape, - reinterpret_cast<void *>(output_buffer), 4), + EXPECT_THROW(_executor->setOutput(output, reinterpret_cast<void *>(output_buffer), 4), std::runtime_error); - EXPECT_THROW(_executor->setOutput(output, output_type, output_shape, - reinterpret_cast<void *>(output_buffer), 12), + EXPECT_THROW(_executor->setOutput(output, reinterpret_cast<void *>(output_buffer), 12), std::runtime_error); - EXPECT_NO_THROW(_executor->setOutput(output, output_type, output_shape, - reinterpret_cast<void *>(output_buffer), 16)); + EXPECT_NO_THROW(_executor->setOutput(output, reinterpret_cast<void *>(output_buffer), 16)); } TEST_F(InterpExecManagerTest, execute) @@ -158,9 +144,6 @@ TEST_F(InterpExecManagerTest, execute) auto input1_idx = _graph->getInputs().at(input1); auto input2_idx = _graph->getInputs().at(input2); - auto operand_type = _graph->operands().at(input1_idx).typeInfo(); - auto operand_shape = _graph->operands().at(input1_idx).shape(); - const int32_t input1_buffer[4] = {1, 0, -1, -2}; const int32_t input2_buffer[4] = {1, 3, 2, 4}; @@ -169,12 +152,9 @@ TEST_F(InterpExecManagerTest, execute) int32_t output_buffer[4] = {}; - EXPECT_NO_THROW(_executor->setInput(input1, operand_type, operand_shape, - reinterpret_cast<const void *>(input1_buffer), 16)); - EXPECT_NO_THROW(_executor->setInput(input2, operand_type, operand_shape, - reinterpret_cast<const void *>(input2_buffer), 16)); - EXPECT_NO_THROW(_executor->setOutput(output, operand_type, operand_shape, - reinterpret_cast<void *>(output_buffer), 16)); + EXPECT_NO_THROW(_executor->setInput(input1, reinterpret_cast<const void *>(input1_buffer), 16)); + EXPECT_NO_THROW(_executor->setInput(input2, reinterpret_cast<const void *>(input2_buffer), 16)); + EXPECT_NO_THROW(_executor->setOutput(output, reinterpret_cast<void *>(output_buffer), 16)); EXPECT_THROW(_executor->execute(), std::runtime_error); } |