From 4e9888e7d6e399810cc664ede35974f84601fcc2 Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Tue, 9 Feb 2021 21:30:33 +0000 Subject: [PATCH] Updated examples --- .../android-simple/app/src/main/cpp/KomputeModelML.cpp | 4 ++-- examples/array_multiplication/src/Main.cpp | 6 +++--- .../custom_module/kompute_summator/KomputeSummatorNode.cpp | 6 +++--- .../godot_examples/gdnative_shared/src/KomputeSummator.cpp | 6 +++--- .../custom_module/kompute_model_ml/KomputeModelMLNode.cpp | 4 ++-- .../gdnative_shared/src/KomputeModelML.cpp | 4 ++-- examples/logistic_regression/src/Main.cpp | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/android/android-simple/app/src/main/cpp/KomputeModelML.cpp b/examples/android/android-simple/app/src/main/cpp/KomputeModelML.cpp index e22f2aa00..80c039515 100755 --- a/examples/android/android-simple/app/src/main/cpp/KomputeModelML.cpp +++ b/examples/android/android-simple/app/src/main/cpp/KomputeModelML.cpp @@ -44,14 +44,14 @@ void KomputeModelML::train(std::vector yData, std::vector xIData, { std::shared_ptr sqTensor = - mgr.createManagedSequence(); + mgr.sequence(); sqTensor->begin(); sqTensor->record(params); sqTensor->end(); sqTensor->eval(); - std::shared_ptr sq = mgr.createManagedSequence(); + std::shared_ptr sq = mgr.sequence(); // Record op algo base sq->begin(); diff --git a/examples/array_multiplication/src/Main.cpp b/examples/array_multiplication/src/Main.cpp index 14b58cba9..161bb8bd4 100755 --- a/examples/array_multiplication/src/Main.cpp +++ b/examples/array_multiplication/src/Main.cpp @@ -14,9 +14,9 @@ int main() kp::Manager mgr; - auto tensorInA = mgr.buildTensor({ 2.0, 4.0, 6.0 }); - auto tensorInB = mgr.buildTensor({ 0.0, 1.0, 2.0 }); - auto tensorOut = mgr.buildTensor({ 0.0, 0.0, 0.0 }); + auto tensorInA = mgr.tensor({ 2.0, 4.0, 6.0 }); + auto tensorInB = mgr.tensor({ 0.0, 1.0, 2.0 }); + auto tensorOut = mgr.tensor({ 0.0, 0.0, 0.0 }); #ifdef KOMPUTE_ANDROID_SHADER_FROM_STRING std::string shader(R"( diff --git a/examples/godot_examples/custom_module/kompute_summator/KomputeSummatorNode.cpp b/examples/godot_examples/custom_module/kompute_summator/KomputeSummatorNode.cpp index 3f17f0888..05c800b2c 100644 --- a/examples/godot_examples/custom_module/kompute_summator/KomputeSummatorNode.cpp +++ b/examples/godot_examples/custom_module/kompute_summator/KomputeSummatorNode.cpp @@ -29,9 +29,9 @@ float KomputeSummatorNode::get_total() const { void KomputeSummatorNode::_init() { std::cout << "CALLING INIT" << std::endl; - this->mPrimaryTensor = this->mManager.buildTensor({ 0.0 }); - this->mSecondaryTensor = this->mManager.buildTensor({ 0.0 }); - this->mSequence = this->mManager.getOrCreateManagedSequence("AdditionSeq"); + this->mPrimaryTensor = this->mManager.tensor({ 0.0 }); + this->mSecondaryTensor = this->mManager.tensor({ 0.0 }); + this->mSequence = this->mManager.sequence("AdditionSeq"); // We now record the steps in the sequence if (std::shared_ptr sq = this->mSequence.lock()) diff --git a/examples/godot_examples/gdnative_shared/src/KomputeSummator.cpp b/examples/godot_examples/gdnative_shared/src/KomputeSummator.cpp index 788486e82..26a38181e 100644 --- a/examples/godot_examples/gdnative_shared/src/KomputeSummator.cpp +++ b/examples/godot_examples/gdnative_shared/src/KomputeSummator.cpp @@ -28,9 +28,9 @@ float KomputeSummator::get_total() const { void KomputeSummator::_init() { std::cout << "CALLING INIT" << std::endl; - this->mPrimaryTensor = this->mManager.buildTensor({ 0.0 }); - this->mSecondaryTensor = this->mManager.buildTensor({ 0.0 }); - this->mSequence = this->mManager.getOrCreateManagedSequence("AdditionSeq"); + this->mPrimaryTensor = this->mManager.tensor({ 0.0 }); + this->mSecondaryTensor = this->mManager.tensor({ 0.0 }); + this->mSequence = this->mManager.sequence("AdditionSeq"); // We now record the steps in the sequence { diff --git a/examples/godot_logistic_regression/custom_module/kompute_model_ml/KomputeModelMLNode.cpp b/examples/godot_logistic_regression/custom_module/kompute_model_ml/KomputeModelMLNode.cpp index f583d910f..38dd6772e 100644 --- a/examples/godot_logistic_regression/custom_module/kompute_model_ml/KomputeModelMLNode.cpp +++ b/examples/godot_logistic_regression/custom_module/kompute_model_ml/KomputeModelMLNode.cpp @@ -51,14 +51,14 @@ void KomputeModelMLNode::train(Array yArr, Array xIArr, Array xJArr) { kp::Manager mgr; std::shared_ptr sqTensor = - mgr.createManagedSequence(); + mgr.sequence(); sqTensor->begin(); sqTensor->record(params); sqTensor->end(); sqTensor->eval(); - std::shared_ptr sq = mgr.createManagedSequence(); + std::shared_ptr sq = mgr.sequence(); // Record op algo base sq->begin(); diff --git a/examples/godot_logistic_regression/gdnative_shared/src/KomputeModelML.cpp b/examples/godot_logistic_regression/gdnative_shared/src/KomputeModelML.cpp index 4135e83ed..f868f5069 100644 --- a/examples/godot_logistic_regression/gdnative_shared/src/KomputeModelML.cpp +++ b/examples/godot_logistic_regression/gdnative_shared/src/KomputeModelML.cpp @@ -56,14 +56,14 @@ void KomputeModelML::train(Array yArr, Array xIArr, Array xJArr) { { std::shared_ptr sqTensor = - mgr.createManagedSequence(); + mgr.sequence(); sqTensor->begin(); sqTensor->record(params); sqTensor->end(); sqTensor->eval(); - std::shared_ptr sq = mgr.createManagedSequence(); + std::shared_ptr sq = mgr.sequence(); // Record op algo base sq->begin(); diff --git a/examples/logistic_regression/src/Main.cpp b/examples/logistic_regression/src/Main.cpp index d3b8b3557..1efbe83ba 100755 --- a/examples/logistic_regression/src/Main.cpp +++ b/examples/logistic_regression/src/Main.cpp @@ -36,14 +36,14 @@ int main() kp::Manager mgr; std::shared_ptr sqTensor = - mgr.createManagedSequence(); + mgr.sequence(); sqTensor->begin(); sqTensor->record(params); sqTensor->end(); sqTensor->eval(); - std::shared_ptr sq = mgr.createManagedSequence(); + std::shared_ptr sq = mgr.sequence(); // Record op algo base sq->begin();