From 8abac9fb5890aa9aa1907a9d90f95b2cd2fc3384 Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Sun, 1 Nov 2020 10:46:16 +0000 Subject: [PATCH] Added fix to work for versions 1.2.55+ of vulkan headers --- src/Algorithm.cpp | 12 ++++++------ src/Manager.cpp | 6 +++--- src/Sequence.cpp | 4 ++-- src/Tensor.cpp | 6 +++--- test/TestLogisticRegression.cpp | 2 +- test/TestMain.cpp | 3 +-- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/Algorithm.cpp b/src/Algorithm.cpp index 845036475..70092a3d6 100644 --- a/src/Algorithm.cpp +++ b/src/Algorithm.cpp @@ -34,7 +34,7 @@ Algorithm::~Algorithm() SPDLOG_ERROR("Kompute Algorithm Error requested to destroy " "pipeline but it is null"); } - this->mDevice->destroy(*this->mPipeline); + this->mDevice->destroy(*this->mPipeline, (vk::Optional)nullptr); } if (this->mFreePipelineCache) { @@ -43,7 +43,7 @@ Algorithm::~Algorithm() SPDLOG_ERROR("Kompute Algorithm Error requested to destroy " "pipeline cache but it is null"); } - this->mDevice->destroy(*this->mPipelineCache); + this->mDevice->destroy(*this->mPipelineCache, (vk::Optional)nullptr); } if (this->mFreePipelineLayout) { @@ -52,7 +52,7 @@ Algorithm::~Algorithm() SPDLOG_ERROR("Kompute Algorithm Error requested to destroy " "pipeline layout but it is null"); } - this->mDevice->destroy(*this->mPipelineLayout); + this->mDevice->destroy(*this->mPipelineLayout, (vk::Optional)nullptr); } if (this->mFreeShaderModule) { @@ -61,7 +61,7 @@ Algorithm::~Algorithm() SPDLOG_ERROR("Kompute Algorithm Error requested to destroy shader " "module but it is null"); } - this->mDevice->destroy(*this->mShaderModule); + this->mDevice->destroy(*this->mShaderModule, (vk::Optional)nullptr); } if (this->mFreeDescriptorSet) { @@ -80,7 +80,7 @@ Algorithm::~Algorithm() SPDLOG_ERROR("Kompute Algorithm Error requested to destroy " "descriptor set layout but it is null"); } - this->mDevice->destroy(*this->mDescriptorSetLayout); + this->mDevice->destroy(*this->mDescriptorSetLayout, (vk::Optional)nullptr); } if (this->mFreeDescriptorPool) { @@ -89,7 +89,7 @@ Algorithm::~Algorithm() SPDLOG_ERROR("Kompute Algorithm Error requested to destroy " "descriptor pool but it is null"); } - this->mDevice->destroy(*this->mDescriptorPool); + this->mDevice->destroy(*this->mDescriptorPool, (vk::Optional)nullptr); } } diff --git a/src/Manager.cpp b/src/Manager.cpp index c779acbea..ec86b18ed 100644 --- a/src/Manager.cpp +++ b/src/Manager.cpp @@ -65,7 +65,7 @@ Manager::~Manager() if (this->mFreeDevice) { SPDLOG_INFO("Destroying device"); - this->mDevice->destroy(); + this->mDevice->destroy((vk::Optional)nullptr); SPDLOG_DEBUG("Kompute Manager Destroyed Device"); } @@ -86,7 +86,7 @@ Manager::~Manager() #endif if (this->mFreeInstance) { - this->mInstance->destroy(); + this->mInstance->destroy((vk::Optional)nullptr); SPDLOG_DEBUG("Kompute Manager Destroyed Instance"); } } @@ -175,7 +175,7 @@ Manager::createInstance() std::vector availableLayerProperties = vk::enumerateInstanceLayerProperties(); for (vk::LayerProperties layerProperties : availableLayerProperties) { - std::string layerName(layerProperties.layerName); + std::string layerName(layerProperties.layerName.data()); uniqueLayerNames.insert(layerName); } for (const char* desiredLayerName : desiredLayerNames) { diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 39db62128..c4446ff37 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -52,7 +52,7 @@ Sequence::~Sequence() "CommandPool pointer"); return; } - this->mDevice->destroy(*this->mCommandPool); + this->mDevice->destroy(*this->mCommandPool, (vk::Optional)nullptr); SPDLOG_DEBUG("Kompute Sequence Destroyed CommandPool"); } } @@ -186,7 +186,7 @@ Sequence::evalAwait(uint64_t waitFor) vk::Result result = this->mDevice->waitForFences(1, &this->mFence, VK_TRUE, waitFor); - this->mDevice->destroy(this->mFence); + this->mDevice->destroy(this->mFence, (vk::Optional)nullptr); this->mIsRunning = false; diff --git a/src/Tensor.cpp b/src/Tensor.cpp index bec1d77f8..31777286f 100644 --- a/src/Tensor.cpp +++ b/src/Tensor.cpp @@ -2,7 +2,7 @@ #if DEBUG #if KOMPUTE_ENABLE_SPDLOG // Only enabled if spdlog is enabled -#include +#include #endif #endif @@ -357,7 +357,7 @@ Tensor::freeMemoryDestroyGPUResources() "Kompose Tensor expected to free buffer but got null buffer"); } else { SPDLOG_DEBUG("Kompose Tensor destroying buffer"); - this->mDevice->destroy(*this->mBuffer); + this->mDevice->destroy(*this->mBuffer, (vk::Optional)nullptr); this->mBuffer = nullptr; } } @@ -368,7 +368,7 @@ Tensor::freeMemoryDestroyGPUResources() "Kompose Tensor expected to free buffer but got null memory"); } else { SPDLOG_DEBUG("Kompose Tensor freeing memory"); - this->mDevice->freeMemory(*this->mMemory); + this->mDevice->freeMemory(*this->mMemory, (vk::Optional)nullptr); this->mDevice = nullptr; } } diff --git a/test/TestLogisticRegression.cpp b/test/TestLogisticRegression.cpp index 9dfd72822..3b710678a 100644 --- a/test/TestLogisticRegression.cpp +++ b/test/TestLogisticRegression.cpp @@ -1,7 +1,7 @@ #include "gtest/gtest.h" -#include "fmt/ranges.h" +#include #include "kompute/Kompute.hpp" TEST(TestLogisticRegressionAlgorithm, TestMainLogisticRegression) diff --git a/test/TestMain.cpp b/test/TestMain.cpp index dd4cd9fe2..147a77f57 100644 --- a/test/TestMain.cpp +++ b/test/TestMain.cpp @@ -1,5 +1,5 @@ -#include +#include #include @@ -7,7 +7,6 @@ int main(int argc, char* argv[]) { testing::InitGoogleTest(&argc, argv); - testing::InitGoogleMock(&argc, argv); #if KOMPUTE_ENABLE_SPDLOG spdlog::set_level(