| 6 | #include "kompute/logger/Logger.hpp" |
| 7 | |
| 8 | TEST(TestOpTensorSync, SyncToDeviceMemorySingleTensor) |
| 9 | { |
| 10 | |
| 11 | kp::Manager mgr; |
| 12 | |
| 13 | std::vector<float> testVecPreA{ 0, 0, 0 }; |
| 14 | std::vector<float> testVecPostA{ 9, 8, 7 }; |
| 15 | |
| 16 | std::shared_ptr<kp::TensorT<float>> tensorA = mgr.tensor(testVecPreA); |
| 17 | |
| 18 | EXPECT_TRUE(tensorA->isInit()); |
| 19 | |
| 20 | tensorA->setData(testVecPostA); |
| 21 | |
| 22 | mgr.sequence()->eval<kp::OpTensorSyncDevice>({ tensorA }); |
| 23 | |
| 24 | mgr.sequence()->eval<kp::OpTensorSyncLocal>({ tensorA }); |
| 25 | |
| 26 | EXPECT_EQ(tensorA->vector(), testVecPostA); |
| 27 | } |
| 28 | |
| 29 | TEST(TestOpTensorSync, SyncToDeviceMemoryMultiTensor) |
| 30 | { |