Skip to content

Commit

Permalink
device_properties: make driverVersion and driverId available
Browse files Browse the repository at this point in the history
  • Loading branch information
rjodinchr committed Jan 9, 2025
1 parent 5c59aa5 commit 77fd9c5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
7 changes: 5 additions & 2 deletions src/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ void cvk_device::init_vulkan_properties(VkInstance instance) {
}

void cvk_device::init_clvk_runtime_behaviors() {
m_clvk_properties = create_cvk_device_properties(
m_properties.deviceName, m_properties.vendorID, m_properties.deviceID,
m_properties.driverVersion, m_driver_properties.driverID);
#define SET_DEVICE_PROPERTY(option, print) \
do { \
if (config.option.set) { \
Expand Down Expand Up @@ -1146,10 +1149,10 @@ bool cvk_device::init(VkInstance instance) {
return false;
}

init_clvk_runtime_behaviors();

init_vulkan_properties(instance);

init_clvk_runtime_behaviors();

init_driver_behaviors();

init_features(instance);
Expand Down
4 changes: 0 additions & 4 deletions src/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ struct cvk_device : public _cl_device_id,
m_type = CL_DEVICE_TYPE_ACCELERATOR;
break;
}

m_clvk_properties = create_cvk_device_properties(
m_properties.deviceName, m_properties.vendorID,
m_properties.deviceID);
}

static cvk_device* create(cvk_platform* platform, VkInstance instance,
Expand Down
6 changes: 3 additions & 3 deletions src/device_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ static bool isNVIDIADevice(const uint32_t vendorID) {
cvk_info_fn(#x); \
return std::make_unique<x>(__VA_ARGS__);

std::unique_ptr<cvk_device_properties>
create_cvk_device_properties(const char* name, const uint32_t vendorID,
const uint32_t deviceID) {
std::unique_ptr<cvk_device_properties> create_cvk_device_properties(
const char* name, const uint32_t vendorID, const uint32_t deviceID,
const uint32_t driverVersion, const VkDriverId driverID) {
if (isMaliDevice(name, vendorID)) {
#ifdef __ANDROID__
// Find out which SoC this is.
Expand Down
6 changes: 3 additions & 3 deletions src/device_properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ struct cvk_device_properties {
virtual ~cvk_device_properties() {}
};

std::unique_ptr<cvk_device_properties>
create_cvk_device_properties(const char* name, const uint32_t vendorID,
const uint32_t deviceID);
std::unique_ptr<cvk_device_properties> create_cvk_device_properties(
const char* name, const uint32_t vendorID, const uint32_t deviceID,
const uint32_t driverVersion, const VkDriverId driverId);

0 comments on commit 77fd9c5

Please sign in to comment.