Skip to content

Commit 5a006c1

Browse files
committed
Not skip kernel if update in sim kernel if init
1 parent e1e9468 commit 5a006c1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

include/acl_hal_mmd.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@
129129

130130
#include <MMD/aocl_mmd.h>
131131

132-
133-
134132
extern acl_kernel_update_callback acl_kernel_update_fn;
135133
extern acl_process_printf_buffer_callback acl_process_printf_buffer_fn;
136134

src/acl_kernel_if.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,15 @@ int acl_kernel_if_init(acl_kernel_if *kern, acl_bsp_io bsp_io,
699699
auto load_result = acl_load_device_def_from_str(
700700
config_string, sysdef->device[kern->physical_device_id].autodiscovery_def,
701701
auto_config_err_str);
702-
if (load_result)
703-
++sysdef->num_devices;
702+
if (load_result) {
703+
if (acl_platform.offline_mode == ACL_CONTEXT_MPSIM) {
704+
sysdef->device[kern->physical_device_id].autodiscovery_def.name =
705+
ACL_MPSIM_DEVICE_NAME;
706+
sysdef->num_devices = 1;
707+
} else {
708+
++sysdef->num_devices;
709+
}
710+
}
704711
result |= load_result ? 0 : -1;
705712

706713
if (result != 0) {
@@ -712,13 +719,8 @@ int acl_kernel_if_init(acl_kernel_if *kern, acl_bsp_io bsp_io,
712719
return -1;
713720
}
714721

715-
if (acl_platform.offline_mode == ACL_CONTEXT_MPSIM) {
716-
sysdef->device[kern->physical_device_id].autodiscovery_def.name =
717-
ACL_MPSIM_DEVICE_NAME;
718-
} else {
719-
result = acl_kernel_if_update(
720-
sysdef->device[kern->physical_device_id].autodiscovery_def, kern);
721-
}
722+
result = acl_kernel_if_update(
723+
sysdef->device[kern->physical_device_id].autodiscovery_def, kern);
722724

723725
return result;
724726
}

0 commit comments

Comments
 (0)