Skip to content
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
4 changes: 4 additions & 0 deletions src/runtime/vulkan/vulkan_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ VulkanDeviceProperties::VulkanDeviceProperties(const VulkanInstance& instance,
device_name = properties.properties.deviceName;
driver_version = properties.properties.driverVersion;

if (device.HasExtension("VK_KHR_driver_properties")) {
driver_name = driver.driverName;
}

switch (properties.properties.deviceType) {
case VK_PHYSICAL_DEVICE_TYPE_OTHER:
device_type = "other";
Expand Down
1 change: 1 addition & 0 deletions src/runtime/vulkan/vulkan_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ struct VulkanDeviceProperties {
uint32_t max_shared_memory_per_block{16384};
std::string device_type{"unknown_device_type"};
std::string device_name{"unknown_device_name"};
std::string driver_name{"unknown_driver_name"};
uint32_t driver_version{0};
uint32_t vulkan_api_version{VK_API_VERSION_1_0};
uint32_t max_spirv_version{0x10000};
Expand Down
3 changes: 3 additions & 0 deletions src/runtime/vulkan/vulkan_device_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ void VulkanDeviceAPI::GetTargetProperty(Device dev, const std::string& property,
if (property == "device_type") {
*rv = prop.device_type;
}
if (property == "driver_name") {
*rv = prop.driver_name;
}
if (property == "driver_version") {
*rv = int64_t(prop.driver_version);
}
Expand Down
1 change: 1 addition & 0 deletions src/target/target_kind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ TVM_REGISTER_TARGET_KIND("vulkan", kDLVulkan)
// Other device properties
.add_attr_option<String>("device_type")
.add_attr_option<String>("device_name")
.add_attr_option<String>("driver_name")
.add_attr_option<Integer>("driver_version")
.add_attr_option<Integer>("vulkan_api_version")
.add_attr_option<Integer>("max_spirv_version")
Expand Down