Skip to content

Commit 2f290b5

Browse files
committed
vulkan: remove unneeded variables
1 parent a9e8dc4 commit 2f290b5

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

ggml-vulkan.cpp

+11-12
Original file line numberDiff line numberDiff line change
@@ -1745,23 +1745,22 @@ void ggml_vk_instance_init() {
17451745

17461746
// Default to using all dedicated GPUs
17471747
for (size_t i = 0; i < devices.size(); i++) {
1748-
vk::PhysicalDeviceProperties new_props_1 = devices[i].getProperties();
1749-
vk::PhysicalDeviceProperties2 new_props_2;
1748+
vk::PhysicalDeviceProperties2 new_props;
17501749
vk::PhysicalDeviceDriverProperties new_driver;
17511750
vk::PhysicalDeviceIDProperties new_id;
1752-
new_props_2.pNext = &new_driver;
1751+
new_props.pNext = &new_driver;
17531752
new_driver.pNext = &new_id;
1754-
devices[i].getProperties2(&new_props_2);
1753+
devices[i].getProperties2(&new_props);
17551754

1756-
if (new_props_1.deviceType == vk::PhysicalDeviceType::eDiscreteGpu) {
1755+
if (new_props.properties.deviceType == vk::PhysicalDeviceType::eDiscreteGpu) {
17571756
// Check if there are two physical devices corresponding to the same GPU
17581757
auto old_device = std::find_if(
17591758
vk_instance.device_indices.begin(),
17601759
vk_instance.device_indices.end(),
1761-
[&devices, &new_id](const size_t k){
1762-
vk::PhysicalDeviceProperties2 old_props_2;
1760+
[&devices, &new_id](const size_t k){
1761+
vk::PhysicalDeviceProperties2 old_props;
17631762
vk::PhysicalDeviceIDProperties old_id;
1764-
devices[k].getProperties2(&old_props_2);
1763+
devices[k].getProperties2(&old_props);
17651764
return std::equal(std::begin(old_id.deviceUUID), std::end(old_id.deviceUUID), std::begin(new_id.deviceUUID));
17661765
}
17671766
);
@@ -1772,18 +1771,18 @@ void ggml_vk_instance_init() {
17721771
// This can cause error when splitting layers aross the devices, need to keep only 1
17731772
VK_LOG_DEBUG("Device " << i << " and device " << *old_device << " have the same deviceUUID");
17741773

1775-
vk::PhysicalDeviceProperties2 old_props_2;
1774+
vk::PhysicalDeviceProperties2 old_props;
17761775
vk::PhysicalDeviceDriverProperties old_driver;
1777-
old_props_2.pNext = &old_driver;
1778-
devices[*old_device].getProperties2(&old_props_2);
1776+
old_props.pNext = &old_driver;
1777+
devices[*old_device].getProperties2(&old_props);
17791778

17801779
std::map<vk::DriverId, int> driver_priorities {};
17811780
int old_priority = std::numeric_limits<int>::max();
17821781
int new_priority = std::numeric_limits<int>::max();
17831782

17841783
// Check https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDriverId.html for the list of driver id
17851784
// Smaller number -> higher priority
1786-
switch (old_props_2.properties.vendorID) {
1785+
switch (old_props.properties.vendorID) {
17871786
case VK_VENDOR_ID_AMD:
17881787
driver_priorities[vk::DriverId::eMesaRadv] = 1;
17891788
driver_priorities[vk::DriverId::eAmdOpenSource] = 2;

0 commit comments

Comments
 (0)