Updated tests to reflect staging
This commit is contained in:
parent
04853df469
commit
8a66c6b1e2
4 changed files with 13 additions and 13 deletions
|
|
@ -105,12 +105,12 @@ TEST(TestLogisticRegressionAlgorithm, TestMainLogisticRegressionManualCopy)
|
|||
std::shared_ptr<kp::Tensor> y{ new kp::Tensor({ 0, 0, 0, 1, 1 }) };
|
||||
|
||||
std::shared_ptr<kp::Tensor> wIn{ new kp::Tensor(
|
||||
wInVec, kp::Tensor::TensorTypes::eStaging) };
|
||||
wInVec, kp::Tensor::TensorTypes::eHost) };
|
||||
std::shared_ptr<kp::Tensor> wOutI{ new kp::Tensor({ 0, 0, 0, 0, 0 }) };
|
||||
std::shared_ptr<kp::Tensor> wOutJ{ new kp::Tensor({ 0, 0, 0, 0, 0 }) };
|
||||
|
||||
std::shared_ptr<kp::Tensor> bIn{ new kp::Tensor(
|
||||
bInVec, kp::Tensor::TensorTypes::eStaging) };
|
||||
bInVec, kp::Tensor::TensorTypes::eHost) };
|
||||
std::shared_ptr<kp::Tensor> bOut{ new kp::Tensor({ 0, 0, 0, 0, 0 }) };
|
||||
|
||||
std::shared_ptr<kp::Tensor> lOut{ new kp::Tensor({ 0, 0, 0, 0, 0 }) };
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ TEST(TestManager, TestCreateInitTensor)
|
|||
EXPECT_EQ(tensorB->data(), std::vector<float>({ 0, 1, 2 }));
|
||||
|
||||
std::shared_ptr<kp::Tensor> tensorC =
|
||||
mgr.buildTensor({ 0, 0, 0 }, kp::Tensor::TensorTypes::eStaging);
|
||||
mgr.buildTensor({ 0, 0, 0 }, kp::Tensor::TensorTypes::eHost);
|
||||
|
||||
mgr.evalOpDefault<kp::OpTensorCopy>({ tensorA, tensorC });
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ TEST(TestOpTensorCopy, CopyDeviceToDeviceTensorMulti)
|
|||
EXPECT_EQ(tensorA->data(), tensorC->data());
|
||||
}
|
||||
|
||||
TEST(TestOpTensorCopy, CopyDeviceToStagingTensor)
|
||||
TEST(TestOpTensorCopy, CopyDeviceToHostTensor)
|
||||
{
|
||||
|
||||
kp::Manager mgr;
|
||||
|
|
@ -68,7 +68,7 @@ TEST(TestOpTensorCopy, CopyDeviceToStagingTensor)
|
|||
|
||||
std::shared_ptr<kp::Tensor> tensorA{ new kp::Tensor(testVecA) };
|
||||
std::shared_ptr<kp::Tensor> tensorB{ new kp::Tensor(
|
||||
testVecB, kp::Tensor::TensorTypes::eStaging) };
|
||||
testVecB, kp::Tensor::TensorTypes::eHost) };
|
||||
|
||||
mgr.evalOpDefault<kp::OpTensorCreate>({ tensorA, tensorB });
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ TEST(TestOpTensorCopy, CopyDeviceToStagingTensor)
|
|||
EXPECT_EQ(tensorA->data(), tensorB->data());
|
||||
}
|
||||
|
||||
TEST(TestOpTensorCopy, CopyStagingToDeviceTensor)
|
||||
TEST(TestOpTensorCopy, CopyHostToDeviceTensor)
|
||||
{
|
||||
|
||||
kp::Manager mgr;
|
||||
|
|
@ -93,7 +93,7 @@ TEST(TestOpTensorCopy, CopyStagingToDeviceTensor)
|
|||
std::vector<float> testVecB{ 0, 0, 0 };
|
||||
|
||||
std::shared_ptr<kp::Tensor> tensorA{ new kp::Tensor(
|
||||
testVecA, kp::Tensor::TensorTypes::eStaging) };
|
||||
testVecA, kp::Tensor::TensorTypes::eHost) };
|
||||
std::shared_ptr<kp::Tensor> tensorB{ new kp::Tensor(testVecB) };
|
||||
|
||||
mgr.evalOpDefault<kp::OpTensorCreate>({ tensorA, tensorB });
|
||||
|
|
@ -110,7 +110,7 @@ TEST(TestOpTensorCopy, CopyStagingToDeviceTensor)
|
|||
EXPECT_EQ(tensorA->data(), tensorB->data());
|
||||
}
|
||||
|
||||
TEST(TestOpTensorCopy, CopyStagingToStagingTensor)
|
||||
TEST(TestOpTensorCopy, CopyHostToHostTensor)
|
||||
{
|
||||
|
||||
kp::Manager mgr;
|
||||
|
|
@ -119,9 +119,9 @@ TEST(TestOpTensorCopy, CopyStagingToStagingTensor)
|
|||
std::vector<float> testVecB{ 0, 0, 0 };
|
||||
|
||||
std::shared_ptr<kp::Tensor> tensorA{ new kp::Tensor(
|
||||
testVecA, kp::Tensor::TensorTypes::eStaging) };
|
||||
testVecA, kp::Tensor::TensorTypes::eHost) };
|
||||
std::shared_ptr<kp::Tensor> tensorB{ new kp::Tensor(
|
||||
testVecB, kp::Tensor::TensorTypes::eStaging) };
|
||||
testVecB, kp::Tensor::TensorTypes::eHost) };
|
||||
|
||||
mgr.evalOpDefault<kp::OpTensorCreate>({ tensorA, tensorB });
|
||||
|
||||
|
|
@ -145,7 +145,7 @@ TEST(TestOpTensorCopy, SingleTensorShouldFail)
|
|||
std::vector<float> testVecA{ 9, 8, 7 };
|
||||
|
||||
std::shared_ptr<kp::Tensor> tensorA{ new kp::Tensor(
|
||||
testVecA, kp::Tensor::TensorTypes::eStaging) };
|
||||
testVecA, kp::Tensor::TensorTypes::eHost) };
|
||||
|
||||
mgr.evalOpDefault<kp::OpTensorCreate>({ tensorA });
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ TEST(TestTensor, CopyFromHostData)
|
|||
std::vector<float> vecB{ 0, 0, 0 };
|
||||
|
||||
std::shared_ptr<kp::Tensor> tensorA =
|
||||
std::make_shared<kp::Tensor>(vecA, kp::Tensor::TensorTypes::eStaging);
|
||||
std::make_shared<kp::Tensor>(vecA, kp::Tensor::TensorTypes::eHost);
|
||||
std::shared_ptr<kp::Tensor> tensorB =
|
||||
std::make_shared<kp::Tensor>(vecB, kp::Tensor::TensorTypes::eStaging);
|
||||
std::make_shared<kp::Tensor>(vecB, kp::Tensor::TensorTypes::eHost);
|
||||
|
||||
kp::Manager mgr;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue