From 4968fb8c025bdcf19ae72c50d3a4ffb00cbba5dd Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Sun, 25 Oct 2020 13:28:23 +0100 Subject: [PATCH] Rename *Indeces variables and parameters to *Indices The plural of index is indexes or indices, the latter seems to be more common in technical contexts. --- docs/overview/advanced-examples.rst | 4 ++-- docs/overview/async-parallel.rst | 4 ++-- single_include/kompute/Kompute.hpp | 8 ++++---- src/Manager.cpp | 18 +++++++++--------- src/include/kompute/Manager.hpp | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/overview/advanced-examples.rst b/docs/overview/advanced-examples.rst index d346eac12..cc0770a25 100644 --- a/docs/overview/advanced-examples.rst +++ b/docs/overview/advanced-examples.rst @@ -218,10 +218,10 @@ Back to `examples list <#simple-examples>`_. // In this case we select device 0, and for queues, one queue from familyIndex 0 // and one queue from familyIndex 2 uint32_t deviceIndex(0); - std::vector familyIndeces = {0, 2}; + std::vector familyIndices = {0, 2}; // We create a manager with device index, and queues by queue family index - kp::Manager mgr(deviceIndex, familyIndeces); + kp::Manager mgr(deviceIndex, familyIndices); // We need to create explicit sequences with their respective queues // The second parameter is the index in the familyIndex array which is relative diff --git a/docs/overview/async-parallel.rst b/docs/overview/async-parallel.rst index c06853475..88df7ac6f 100644 --- a/docs/overview/async-parallel.rst +++ b/docs/overview/async-parallel.rst @@ -189,10 +189,10 @@ You will want to keep track of the indices you initialize your manager, as you w // In this case we select device 0, and for queues, one queue from familyIndex 0 // and one queue from familyIndex 2 uint32_t deviceIndex(0); - std::vector familyIndeces = {0, 2}; + std::vector familyIndices = {0, 2}; // We create a manager with device index, and queues by queue family index - kp::Manager mgr(deviceIndex, familyIndeces); + kp::Manager mgr(deviceIndex, familyIndices); We are now able to create sequences with a particular queue. diff --git a/single_include/kompute/Kompute.hpp b/single_include/kompute/Kompute.hpp index 2e40b4e0f..8def06e4a 100755 --- a/single_include/kompute/Kompute.hpp +++ b/single_include/kompute/Kompute.hpp @@ -1267,12 +1267,12 @@ class Manager * they would like to create the resources on. * * @param physicalDeviceIndex The index of the physical device to use - * @param familyQueueIndeces (Optional) List of queue indices to add for + * @param familyQueueIndices (Optional) List of queue indices to add for * explicit allocation * @param totalQueues The total number of compute queues to create. */ Manager(uint32_t physicalDeviceIndex, - const std::vector& familyQueueIndeces = {}); + const std::vector& familyQueueIndices = {}); /** * Manager constructor which allows your own vulkan application to integrate @@ -1509,7 +1509,7 @@ class Manager std::unordered_map> mManagedSequences; - std::vector mComputeQueueFamilyIndeces; + std::vector mComputeQueueFamilyIndices; std::vector> mComputeQueues; uint32_t mCurrentSequenceIndex = -1; @@ -1523,7 +1523,7 @@ class Manager // Create functions void createInstance(); - void createDevice(const std::vector& familyQueueIndeces = {}); + void createDevice(const std::vector& familyQueueIndices = {}); }; } // End namespace kp diff --git a/src/Manager.cpp b/src/Manager.cpp index ce3cb4d2d..c779acbea 100644 --- a/src/Manager.cpp +++ b/src/Manager.cpp @@ -29,12 +29,12 @@ Manager::Manager() {} Manager::Manager(uint32_t physicalDeviceIndex, - const std::vector& familyQueueIndeces) + const std::vector& familyQueueIndices) { this->mPhysicalDeviceIndex = physicalDeviceIndex; this->createInstance(); - this->createDevice(familyQueueIndeces); + this->createDevice(familyQueueIndices); } Manager::Manager(std::shared_ptr instance, @@ -119,7 +119,7 @@ Manager::createManagedSequence(std::string sequenceName, uint32_t queueIndex) std::make_shared(this->mPhysicalDevice, this->mDevice, this->mComputeQueues[queueIndex], - this->mComputeQueueFamilyIndeces[queueIndex]); + this->mComputeQueueFamilyIndices[queueIndex]); sq->init(); if (sequenceName.empty()) { @@ -220,7 +220,7 @@ Manager::createInstance() } void -Manager::createDevice(const std::vector& familyQueueIndeces) +Manager::createDevice(const std::vector& familyQueueIndices) { SPDLOG_DEBUG("Kompute Manager creating Device"); @@ -251,7 +251,7 @@ Manager::createDevice(const std::vector& familyQueueIndeces) this->mPhysicalDeviceIndex, physicalDeviceProperties.deviceName); - if (!familyQueueIndeces.size()) { + if (!familyQueueIndices.size()) { // Find compute queue std::vector allQueueFamilyProperties = physicalDevice.getQueueFamilyProperties(); @@ -272,14 +272,14 @@ Manager::createDevice(const std::vector& familyQueueIndeces) throw std::runtime_error("Compute queue is not supported"); } - this->mComputeQueueFamilyIndeces.push_back(computeQueueFamilyIndex); + this->mComputeQueueFamilyIndices.push_back(computeQueueFamilyIndex); } else { - this->mComputeQueueFamilyIndeces = familyQueueIndeces; + this->mComputeQueueFamilyIndices = familyQueueIndices; } std::unordered_map familyQueueCounts; std::unordered_map> familyQueuePriorities; - for (const auto& value : this->mComputeQueueFamilyIndeces) { + for (const auto& value : this->mComputeQueueFamilyIndices) { familyQueueCounts[value]++; familyQueuePriorities[value].push_back(1.0f); } @@ -308,7 +308,7 @@ Manager::createDevice(const std::vector& familyQueueIndeces) &deviceCreateInfo, nullptr, this->mDevice.get()); SPDLOG_DEBUG("Kompute Manager device created"); - for (const uint32_t& familyQueueIndex : this->mComputeQueueFamilyIndeces) { + for (const uint32_t& familyQueueIndex : this->mComputeQueueFamilyIndices) { std::shared_ptr currQueue = std::make_shared(); this->mDevice->getQueue(familyQueueIndex, diff --git a/src/include/kompute/Manager.hpp b/src/include/kompute/Manager.hpp index 559eb38c6..32c04535b 100644 --- a/src/include/kompute/Manager.hpp +++ b/src/include/kompute/Manager.hpp @@ -29,12 +29,12 @@ class Manager * they would like to create the resources on. * * @param physicalDeviceIndex The index of the physical device to use - * @param familyQueueIndeces (Optional) List of queue indices to add for + * @param familyQueueIndices (Optional) List of queue indices to add for * explicit allocation * @param totalQueues The total number of compute queues to create. */ Manager(uint32_t physicalDeviceIndex, - const std::vector& familyQueueIndeces = {}); + const std::vector& familyQueueIndices = {}); /** * Manager constructor which allows your own vulkan application to integrate @@ -271,7 +271,7 @@ class Manager std::unordered_map> mManagedSequences; - std::vector mComputeQueueFamilyIndeces; + std::vector mComputeQueueFamilyIndices; std::vector> mComputeQueues; uint32_t mCurrentSequenceIndex = -1; @@ -285,7 +285,7 @@ class Manager // Create functions void createInstance(); - void createDevice(const std::vector& familyQueueIndeces = {}); + void createDevice(const std::vector& familyQueueIndices = {}); }; } // End namespace kp