Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler errors on compilers other than msvc #66

Merged
merged 2 commits into from
Sep 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions examples/array_multiplication/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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"
)

6 changes: 3 additions & 3 deletions single_include/kompute/Kompute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ class Manager
*/
template<typename T, typename... TArgs>
void evalOp(std::vector<std::shared_ptr<Tensor>> tensors,
std::string sequenceName = KP_DEFAULT_SESSION,
std::string sequenceName,
TArgs&&... params)
{
SPDLOG_DEBUG("Kompute Manager evalOp triggered");
Expand Down Expand Up @@ -1195,7 +1195,7 @@ OpAlgoBase<tX, tY, tZ>::init()

SPDLOG_DEBUG("Kompute OpAlgoBase fetching spirv data");

std::vector<char>& shaderFileData = this->fetchSpirvBinaryData();
std::vector<char> shaderFileData = this->fetchSpirvBinaryData();

SPDLOG_DEBUG("Kompute OpAlgoBase Initialising algorithm component");

Expand Down Expand Up @@ -1427,7 +1427,7 @@ OpAlgoLhsRhsOut<tX, tY, tZ>::init()

SPDLOG_DEBUG("Kompute OpAlgoLhsRhsOut fetching spirv data");

std::vector<char>& shaderFileData = this->fetchSpirvBinaryData();
std::vector<char> shaderFileData = this->fetchSpirvBinaryData();

SPDLOG_DEBUG("Kompute OpAlgoLhsRhsOut Initialising algorithm component");

Expand Down
3 changes: 1 addition & 2 deletions src/include/kompute/Manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Manager
*/
template<typename T, typename... TArgs>
void evalOp(std::vector<std::shared_ptr<Tensor>> tensors,
std::string sequenceName = KP_DEFAULT_SESSION,
std::string sequenceName,
TArgs&&... params)
{
SPDLOG_DEBUG("Kompute Manager evalOp triggered");
Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/include/kompute/operations/OpAlgoBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ OpAlgoBase<tX, tY, tZ>::init()

SPDLOG_DEBUG("Kompute OpAlgoBase fetching spirv data");

std::vector<char>& shaderFileData = this->fetchSpirvBinaryData();
std::vector<char> shaderFileData = this->fetchSpirvBinaryData();

SPDLOG_DEBUG("Kompute OpAlgoBase Initialising algorithm component");

Expand Down
2 changes: 1 addition & 1 deletion src/include/kompute/operations/OpAlgoLhsRhsOut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ OpAlgoLhsRhsOut<tX, tY, tZ>::init()

SPDLOG_DEBUG("Kompute OpAlgoLhsRhsOut fetching spirv data");

std::vector<char>& shaderFileData = this->fetchSpirvBinaryData();
std::vector<char> shaderFileData = this->fetchSpirvBinaryData();

SPDLOG_DEBUG("Kompute OpAlgoLhsRhsOut Initialising algorithm component");

Expand Down
10 changes: 5 additions & 5 deletions test/TestManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ TEST(TestManager, EndToEndOpMultFlow)
kp::Manager mgr;

std::shared_ptr<kp::Tensor> tensorLHS{ new kp::Tensor({ 0, 1, 2 }) };
mgr.evalOp<kp::OpTensorCreate>({ tensorLHS });
mgr.evalOpDefault<kp::OpTensorCreate>({ tensorLHS });

std::shared_ptr<kp::Tensor> tensorRHS{ new kp::Tensor({ 2, 4, 6 }) };
mgr.evalOp<kp::OpTensorCreate>({ tensorRHS });
mgr.evalOpDefault<kp::OpTensorCreate>({ tensorRHS });

std::shared_ptr<kp::Tensor> tensorOutput{ new kp::Tensor({ 0, 0, 0 }) };

mgr.evalOp<kp::OpTensorCreate>({ tensorOutput });
mgr.evalOpDefault<kp::OpTensorCreate>({ tensorOutput });

mgr.evalOp<kp::OpMult<>>({ tensorLHS, tensorRHS, tensorOutput });
mgr.evalOpDefault<kp::OpMult<>>({ tensorLHS, tensorRHS, tensorOutput });

mgr.evalOp<kp::OpTensorSyncLocal>({ tensorOutput });
mgr.evalOpDefault<kp::OpTensorSyncLocal>({ tensorOutput });

EXPECT_EQ(tensorOutput->data(), std::vector<float>({ 0, 4, 12 }));
}
Expand Down