From dcdee743b64a4eada0c43c5d7dc2b2c388d98f18 Mon Sep 17 00:00:00 2001 From: Olivier BICHLER <olivier.bichler@cea.fr> Date: Sun, 10 Dec 2023 22:39:31 +0100 Subject: [PATCH] Missing backend --- unit_tests/Test_Convert.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unit_tests/Test_Convert.cpp b/unit_tests/Test_Convert.cpp index 21f9d43..1097630 100644 --- a/unit_tests/Test_Convert.cpp +++ b/unit_tests/Test_Convert.cpp @@ -113,16 +113,19 @@ TEST_CASE("[cuda/convert] Convert(forward)") { std::shared_ptr<Tensor> other1 = std::static_pointer_cast<OperatorTensor>(g->getNode("conv1")->getOperator())->getOutput(0); Tensor hostOther1(other1->dataType()); + hostOther1.setBackend("cpu"); hostOther1.copyCastFrom(*other1); REQUIRE(approxEq<half_float::half, int>(hostOther1, *expectedOutput1, 0.0, 1.0e-12)); std::shared_ptr<Tensor> other2 = std::static_pointer_cast<OperatorTensor>(g->getNode("conv2")->getOperator())->getOutput(0); Tensor hostOther2(other2->dataType()); + hostOther2.setBackend("cpu"); hostOther2.copyCastFrom(*other2); REQUIRE(approxEq<float, int>(hostOther2, *expectedOutput2, 0.0, 1.0e-12)); std::shared_ptr<Tensor> other3 = std::static_pointer_cast<OperatorTensor>(g->getNode("conv3")->getOperator())->getOutput(0); Tensor hostOther3(other3->dataType()); + hostOther3.setBackend("cpu"); hostOther3.copyCastFrom(*other3); REQUIRE(approxEq<double, int>(hostOther3, *expectedOutput3, 0.0, 1.0e-12)); } @@ -197,16 +200,19 @@ TEST_CASE("[cuda/convert] Convert(forward)") { std::shared_ptr<Tensor> other1 = std::static_pointer_cast<OperatorTensor>(g->getNode("conv1")->getOperator())->getOutput(0); Tensor hostOther1(other1->dataType()); + hostOther1.setBackend("cpu"); hostOther1.copyCastFrom(*other1); REQUIRE(approxEq<half_float::half, int>(hostOther1, *expectedOutput1, 0.0, 1.0e-12)); std::shared_ptr<Tensor> other2 = std::static_pointer_cast<OperatorTensor>(g->getNode("conv2")->getOperator())->getOutput(0); Tensor hostOther2(other2->dataType()); + hostOther2.setBackend("cpu"); hostOther2.copyCastFrom(*other2); REQUIRE(approxEq<float, int>(hostOther2, *expectedOutput2, 0.0, 1.0e-12)); std::shared_ptr<Tensor> other3 = std::static_pointer_cast<OperatorTensor>(g->getNode("conv3")->getOperator())->getOutput(0); Tensor hostOther3(other3->dataType()); + hostOther3.setBackend("cpu"); hostOther3.copyCastFrom(*other3); REQUIRE(approxEq<double, int>(hostOther3, *expectedOutput3, 0.0, 1.0e-12)); } -- GitLab