From 3cc4f66e432ae2d6c91707642e4bf4eb18802bfa Mon Sep 17 00:00:00 2001 From: xudaliang Date: Mon, 1 Apr 2024 08:41:06 +0000 Subject: [PATCH] refactor: cpu split input execute --- src/backends/cpu/CPUSplitInput.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/backends/cpu/CPUSplitInput.cpp b/src/backends/cpu/CPUSplitInput.cpp index e8397668..5a6d039f 100644 --- a/src/backends/cpu/CPUSplitInput.cpp +++ b/src/backends/cpu/CPUSplitInput.cpp @@ -34,20 +34,14 @@ ErrorCode CPUSplitInput::setUp(vector> inputs, vector> inputs, vector> outputs) { - std::cout << "CPUSplitInput::execute" << std::endl; - std::cout << inputs[0]->dtype() << std::endl; - std::cout << outputs[0]->dtype() << std::endl; - std::cout << outputs[1]->dtype() << std::endl; - std::cout << outputs[2]->dtype() << std::endl; - - // copy data from input to output int offset = 0; memcpy(outputs[0]->hostPtr(), inputs[0]->hostPtr(), outputs[0]->cntSize()); offset += outputs[0]->cntSize(); - memcpy(outputs[1]->hostPtr(), (bool*)inputs[0]->hostPtr() + offset, outputs[1]->cntSize()); + memcpy(outputs[1]->hostPtr(), inputs[0]->hostPtr() + offset, outputs[1]->cntSize()); offset += outputs[1]->cntSize(); - memcpy(outputs[2]->hostPtr(), (bool*)inputs[0]->hostPtr() + offset, outputs[2]->cntSize()); + memcpy(outputs[2]->hostPtr(), inputs[0]->hostPtr() + offset, outputs[2]->cntSize()); + return Op::execute(inputs, outputs); } } // namespace mllm