Updated todo comments
This commit is contained in:
parent
1b4e4b6b18
commit
e6f4097acb
3 changed files with 29 additions and 4 deletions
|
|
@ -84,10 +84,7 @@ OpTensorCreate::postSubmit()
|
|||
{
|
||||
SPDLOG_DEBUG("Kompute OpTensorCreate postSubmit called");
|
||||
|
||||
// TODO: Remove and add a test that checks that the memory in
|
||||
// the staging tensor is actually storing the data
|
||||
SPDLOG_DEBUG("Kompute OpTensorCreate destroying staging tensors");
|
||||
// TODO: This would cause issues if there is no CPU barrier
|
||||
this->mStagingTensors.clear();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ OpTensorSyncLocal::postSubmit()
|
|||
|
||||
// Remove all staging tensors as they are not required after operation
|
||||
SPDLOG_DEBUG("Kompute OpTensorSyncLocal destroying staging tensors");
|
||||
// TODO: This would cause issues if there is no CPU barrier
|
||||
this->mStagingTensors.clear();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,35 @@ TEST(TestOpTensorCopy, CopyDeviceToDeviceTensor) {
|
|||
EXPECT_EQ(tensorA->data(), tensorB->data());
|
||||
}
|
||||
|
||||
TEST(TestOpTensorCopy, CopyDeviceToDeviceTensorMulti) {
|
||||
|
||||
kp::Manager mgr;
|
||||
|
||||
std::vector<float> testVecA{ 9, 8, 7 };
|
||||
std::vector<float> testVecB{ 0, 0, 0 };
|
||||
std::vector<float> testVecC{ 0, 0, 0 };
|
||||
|
||||
std::shared_ptr<kp::Tensor> tensorA{new kp::Tensor(testVecA)};
|
||||
std::shared_ptr<kp::Tensor> tensorB{new kp::Tensor(testVecB)};
|
||||
std::shared_ptr<kp::Tensor> tensorC{new kp::Tensor(testVecC)};
|
||||
|
||||
mgr.evalOpDefault<kp::OpTensorCreate>({tensorA, tensorB, tensorC});
|
||||
|
||||
EXPECT_TRUE(tensorA->isInit());
|
||||
EXPECT_TRUE(tensorB->isInit());
|
||||
EXPECT_TRUE(tensorC->isInit());
|
||||
|
||||
mgr.evalOpDefault<kp::OpTensorCopy>({tensorA, tensorB, tensorC});
|
||||
|
||||
EXPECT_EQ(tensorA->data(), tensorB->data());
|
||||
EXPECT_EQ(tensorA->data(), tensorC->data());
|
||||
|
||||
// Making sure the GPU holds the same data
|
||||
mgr.evalOpDefault<kp::OpTensorSyncLocal>({tensorB, tensorC});
|
||||
EXPECT_EQ(tensorA->data(), tensorB->data());
|
||||
EXPECT_EQ(tensorA->data(), tensorC->data());
|
||||
}
|
||||
|
||||
TEST(TestOpTensorCopy, CopyDeviceToStagingTensor) {
|
||||
|
||||
kp::Manager mgr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue