Commit 20969c24 authored by Brice Videau's avatar Brice Videau
Browse files

Added support for subdevice profiling.

parent 7589832a
Pipeline #14057 failed with stage
......@@ -7,6 +7,7 @@ enum _ze_obj_type {
struct _ze_device_obj_data {
ze_driver_handle_t driver;
ze_device_handle_t parent;
ze_device_properties_t properties;
};
......@@ -58,7 +59,8 @@ static inline void _delete_ze_obj(struct _ze_obj_h *o_h) {
static inline void _register_ze_device(
ze_device_handle_t device,
ze_driver_handle_t driver) {
ze_driver_handle_t driver,
ze_device_handle_t parent) {
struct _ze_obj_h *o_h = NULL;
struct _ze_device_obj_data *d_data = NULL;
......@@ -77,6 +79,7 @@ static inline void _register_ze_device(
o_h->ptr = (void *)device;
o_h->type = DEVICE;
d_data->driver = driver;
d_data->parent = parent;
o_h->obj_data = (void *)d_data;
d_data->properties.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES;
......
......@@ -686,7 +686,16 @@ register_epilogue "zeDeviceGet", <<EOF
if (_do_profile) {
if (_retval == ZE_RESULT_SUCCESS && phDevices && pCount) {
for (uint32_t i = 0; i < *pCount; i++)
_register_ze_device(phDevices[i], hDriver);
_register_ze_device(phDevices[i], hDriver, NULL);
}
}
EOF
register_epilogue "zeDeviceGetSubDevices", <<EOF
if (_do_profile) {
if (_retval == ZE_RESULT_SUCCESS && phSubdevices && pCount) {
for (uint32_t i = 0; i < *pCount; i++)
_register_ze_device(phSubdevices[i], NULL, hDevice);
}
}
EOF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment