MCPcopy Create free account
hub / github.com/KomputeProject/kompute / TEST

Function TEST

test/TestOpTensorSync.cpp:8–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "kompute/logger/Logger.hpp"
7
8TEST(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
29TEST(TestOpTensorSync, SyncToDeviceMemoryMultiTensor)
30{

Callers

nothing calls this directly

Calls 5

tensorMethod · 0.80
setDataMethod · 0.80
sequenceMethod · 0.80
isInitMethod · 0.45
vectorMethod · 0.45

Tested by

no test coverage detected