Skip to content

Commit

Permalink
Rename *Indeces variables and parameters to *Indices
Browse files Browse the repository at this point in the history
The plural of index is indexes or indices, the latter seems to be more
common in technical contexts.
  • Loading branch information
pH5 committed Oct 25, 2020
1 parent e6473a6 commit 4968fb8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions docs/overview/advanced-examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t> familyIndeces = {0, 2};
std::vector<uint32_t> 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
Expand Down
4 changes: 2 additions & 2 deletions docs/overview/async-parallel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t> familyIndeces = {0, 2};
std::vector<uint32_t> 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.

Expand Down
8 changes: 4 additions & 4 deletions single_include/kompute/Kompute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>& familyQueueIndeces = {});
const std::vector<uint32_t>& familyQueueIndices = {});

/**
* Manager constructor which allows your own vulkan application to integrate
Expand Down Expand Up @@ -1509,7 +1509,7 @@ class Manager
std::unordered_map<std::string, std::shared_ptr<Sequence>>
mManagedSequences;

std::vector<uint32_t> mComputeQueueFamilyIndeces;
std::vector<uint32_t> mComputeQueueFamilyIndices;
std::vector<std::shared_ptr<vk::Queue>> mComputeQueues;

uint32_t mCurrentSequenceIndex = -1;
Expand All @@ -1523,7 +1523,7 @@ class Manager

// Create functions
void createInstance();
void createDevice(const std::vector<uint32_t>& familyQueueIndeces = {});
void createDevice(const std::vector<uint32_t>& familyQueueIndices = {});
};

} // End namespace kp
Expand Down
18 changes: 9 additions & 9 deletions src/Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ Manager::Manager()
{}

Manager::Manager(uint32_t physicalDeviceIndex,
const std::vector<uint32_t>& familyQueueIndeces)
const std::vector<uint32_t>& familyQueueIndices)
{
this->mPhysicalDeviceIndex = physicalDeviceIndex;

this->createInstance();
this->createDevice(familyQueueIndeces);
this->createDevice(familyQueueIndices);
}

Manager::Manager(std::shared_ptr<vk::Instance> instance,
Expand Down Expand Up @@ -119,7 +119,7 @@ Manager::createManagedSequence(std::string sequenceName, uint32_t queueIndex)
std::make_shared<Sequence>(this->mPhysicalDevice,
this->mDevice,
this->mComputeQueues[queueIndex],
this->mComputeQueueFamilyIndeces[queueIndex]);
this->mComputeQueueFamilyIndices[queueIndex]);
sq->init();

if (sequenceName.empty()) {
Expand Down Expand Up @@ -220,7 +220,7 @@ Manager::createInstance()
}

void
Manager::createDevice(const std::vector<uint32_t>& familyQueueIndeces)
Manager::createDevice(const std::vector<uint32_t>& familyQueueIndices)
{

SPDLOG_DEBUG("Kompute Manager creating Device");
Expand Down Expand Up @@ -251,7 +251,7 @@ Manager::createDevice(const std::vector<uint32_t>& familyQueueIndeces)
this->mPhysicalDeviceIndex,
physicalDeviceProperties.deviceName);

if (!familyQueueIndeces.size()) {
if (!familyQueueIndices.size()) {
// Find compute queue
std::vector<vk::QueueFamilyProperties> allQueueFamilyProperties =
physicalDevice.getQueueFamilyProperties();
Expand All @@ -272,14 +272,14 @@ Manager::createDevice(const std::vector<uint32_t>& 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<uint32_t, uint32_t> familyQueueCounts;
std::unordered_map<uint32_t, std::vector<float>> familyQueuePriorities;
for (const auto& value : this->mComputeQueueFamilyIndeces) {
for (const auto& value : this->mComputeQueueFamilyIndices) {
familyQueueCounts[value]++;
familyQueuePriorities[value].push_back(1.0f);
}
Expand Down Expand Up @@ -308,7 +308,7 @@ Manager::createDevice(const std::vector<uint32_t>& 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<vk::Queue> currQueue = std::make_shared<vk::Queue>();

this->mDevice->getQueue(familyQueueIndex,
Expand Down
8 changes: 4 additions & 4 deletions src/include/kompute/Manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>& familyQueueIndeces = {});
const std::vector<uint32_t>& familyQueueIndices = {});

/**
* Manager constructor which allows your own vulkan application to integrate
Expand Down Expand Up @@ -271,7 +271,7 @@ class Manager
std::unordered_map<std::string, std::shared_ptr<Sequence>>
mManagedSequences;

std::vector<uint32_t> mComputeQueueFamilyIndeces;
std::vector<uint32_t> mComputeQueueFamilyIndices;
std::vector<std::shared_ptr<vk::Queue>> mComputeQueues;

uint32_t mCurrentSequenceIndex = -1;
Expand All @@ -285,7 +285,7 @@ class Manager

// Create functions
void createInstance();
void createDevice(const std::vector<uint32_t>& familyQueueIndeces = {});
void createDevice(const std::vector<uint32_t>& familyQueueIndices = {});
};

} // End namespace kp

0 comments on commit 4968fb8

Please sign in to comment.