From ce7c7eba3d6be8c1467417b6c9d4a7795300a2e6 Mon Sep 17 00:00:00 2001 From: Dudecake Date: Sun, 27 Sep 2020 18:00:23 +0200 Subject: [PATCH 1/2] Fixed array_multiplication compile errors --- examples/array_multiplication/CMakeLists.txt | 11 +++-------- single_include/kompute/Kompute.hpp | 4 ++-- src/include/kompute/Manager.hpp | 1 - src/include/kompute/operations/OpAlgoBase.hpp | 2 +- src/include/kompute/operations/OpAlgoLhsRhsOut.hpp | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/examples/array_multiplication/CMakeLists.txt b/examples/array_multiplication/CMakeLists.txt index d42a754e9..5aeebb450 100644 --- a/examples/array_multiplication/CMakeLists.txt +++ b/examples/array_multiplication/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.17.0) -project(kompute_godot VERSION 0.1.0) +project(kompute_array_mult VERSION 0.1.0) set(CMAKE_CXX_STANDARD 14) @@ -13,15 +13,10 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DRELEASE=1 ${KOMPUTE_EX find_package(kompute REQUIRED) find_package(Vulkan REQUIRED) -add_executable(kompute_godot +add_executable(kompute_array_mult src/Main.cpp) -target_link_libraries(kompute_godot +target_link_libraries(kompute_array_mult kompute::kompute Vulkan::Vulkan ) - -target_link_libraries(kompute_godot - "lib/godot.windows.tools.64.lib" -) - diff --git a/single_include/kompute/Kompute.hpp b/single_include/kompute/Kompute.hpp index 0ef873e58..757c637ec 100755 --- a/single_include/kompute/Kompute.hpp +++ b/single_include/kompute/Kompute.hpp @@ -1195,7 +1195,7 @@ OpAlgoBase::init() SPDLOG_DEBUG("Kompute OpAlgoBase fetching spirv data"); - std::vector& shaderFileData = this->fetchSpirvBinaryData(); + std::vector shaderFileData = this->fetchSpirvBinaryData(); SPDLOG_DEBUG("Kompute OpAlgoBase Initialising algorithm component"); @@ -1427,7 +1427,7 @@ OpAlgoLhsRhsOut::init() SPDLOG_DEBUG("Kompute OpAlgoLhsRhsOut fetching spirv data"); - std::vector& shaderFileData = this->fetchSpirvBinaryData(); + std::vector shaderFileData = this->fetchSpirvBinaryData(); SPDLOG_DEBUG("Kompute OpAlgoLhsRhsOut Initialising algorithm component"); diff --git a/src/include/kompute/Manager.hpp b/src/include/kompute/Manager.hpp index 943cb7180..44c6263cd 100644 --- a/src/include/kompute/Manager.hpp +++ b/src/include/kompute/Manager.hpp @@ -101,7 +101,6 @@ class Manager * sequences. * * @param tensors The tensors to be used in the operation recorded - * @param sequenceName The name of the sequence to be retrieved or created * @param TArgs Template parameters that will be used to initialise * Operation to allow for extensible configurations on initialisation */ diff --git a/src/include/kompute/operations/OpAlgoBase.hpp b/src/include/kompute/operations/OpAlgoBase.hpp index 03109ec34..3d1de2992 100644 --- a/src/include/kompute/operations/OpAlgoBase.hpp +++ b/src/include/kompute/operations/OpAlgoBase.hpp @@ -236,7 +236,7 @@ OpAlgoBase::init() SPDLOG_DEBUG("Kompute OpAlgoBase fetching spirv data"); - std::vector& shaderFileData = this->fetchSpirvBinaryData(); + std::vector shaderFileData = this->fetchSpirvBinaryData(); SPDLOG_DEBUG("Kompute OpAlgoBase Initialising algorithm component"); diff --git a/src/include/kompute/operations/OpAlgoLhsRhsOut.hpp b/src/include/kompute/operations/OpAlgoLhsRhsOut.hpp index 2f4352579..23dc2dcc6 100644 --- a/src/include/kompute/operations/OpAlgoLhsRhsOut.hpp +++ b/src/include/kompute/operations/OpAlgoLhsRhsOut.hpp @@ -162,7 +162,7 @@ OpAlgoLhsRhsOut::init() SPDLOG_DEBUG("Kompute OpAlgoLhsRhsOut fetching spirv data"); - std::vector& shaderFileData = this->fetchSpirvBinaryData(); + std::vector shaderFileData = this->fetchSpirvBinaryData(); SPDLOG_DEBUG("Kompute OpAlgoLhsRhsOut Initialising algorithm component"); From 4ad74665620a55699dd7c49e2a99ff3128ddfa72 Mon Sep 17 00:00:00 2001 From: Dudecake Date: Sun, 27 Sep 2020 18:01:09 +0200 Subject: [PATCH 2/2] Removed default arg before parameter pack --- single_include/kompute/Kompute.hpp | 2 +- src/include/kompute/Manager.hpp | 2 +- test/TestManager.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/single_include/kompute/Kompute.hpp b/single_include/kompute/Kompute.hpp index 757c637ec..a3afd44bf 100755 --- a/single_include/kompute/Kompute.hpp +++ b/single_include/kompute/Kompute.hpp @@ -792,7 +792,7 @@ class Manager */ template void evalOp(std::vector> tensors, - std::string sequenceName = KP_DEFAULT_SESSION, + std::string sequenceName, TArgs&&... params) { SPDLOG_DEBUG("Kompute Manager evalOp triggered"); diff --git a/src/include/kompute/Manager.hpp b/src/include/kompute/Manager.hpp index 44c6263cd..e3e522791 100644 --- a/src/include/kompute/Manager.hpp +++ b/src/include/kompute/Manager.hpp @@ -73,7 +73,7 @@ class Manager */ template void evalOp(std::vector> tensors, - std::string sequenceName = KP_DEFAULT_SESSION, + std::string sequenceName, TArgs&&... params) { SPDLOG_DEBUG("Kompute Manager evalOp triggered"); diff --git a/test/TestManager.cpp b/test/TestManager.cpp index 56687a252..1550d8efb 100644 --- a/test/TestManager.cpp +++ b/test/TestManager.cpp @@ -8,18 +8,18 @@ TEST(TestManager, EndToEndOpMultFlow) kp::Manager mgr; std::shared_ptr tensorLHS{ new kp::Tensor({ 0, 1, 2 }) }; - mgr.evalOp({ tensorLHS }); + mgr.evalOpDefault({ tensorLHS }); std::shared_ptr tensorRHS{ new kp::Tensor({ 2, 4, 6 }) }; - mgr.evalOp({ tensorRHS }); + mgr.evalOpDefault({ tensorRHS }); std::shared_ptr tensorOutput{ new kp::Tensor({ 0, 0, 0 }) }; - mgr.evalOp({ tensorOutput }); + mgr.evalOpDefault({ tensorOutput }); - mgr.evalOp>({ tensorLHS, tensorRHS, tensorOutput }); + mgr.evalOpDefault>({ tensorLHS, tensorRHS, tensorOutput }); - mgr.evalOp({ tensorOutput }); + mgr.evalOpDefault({ tensorOutput }); EXPECT_EQ(tensorOutput->data(), std::vector({ 0, 4, 12 })); }