@@ -1964,6 +1964,10 @@ void acl_hal_mmd_unstall_kernel(unsigned int physical_device_id,
1964
1964
acl_kernel_if_unstall_kernel (&kern[physical_device_id], activation_id);
1965
1965
}
1966
1966
1967
+ static bool l_is_simulator_dispatch (acl_mmd_dispatch_t *mmd_dispatch) {
1968
+ return mmd_dispatch->aocl_mmd_simulation_device_info != NULL ;
1969
+ }
1970
+
1967
1971
static void update_simulator (int handle, unsigned int physical_device_id,
1968
1972
const acl_device_def_autodiscovery_t &dev) {
1969
1973
std::vector<aocl_mmd_memory_info_t > mem_info (dev.num_global_mem_systems );
@@ -2076,8 +2080,8 @@ int acl_hal_mmd_program_device(unsigned int physical_device_id,
2076
2080
// cases (e.g. features/printf/test), where there are multiple kernels and
2077
2081
// resources are released between kernel runs. For the simulator, only print
2078
2082
// this message once. This is a horrible kludge.
2079
- is_simulator = device_info[physical_device_id]
2080
- .mmd_dispatch -> aocl_mmd_simulation_device_info != NULL ;
2083
+ is_simulator =
2084
+ l_is_simulator_dispatch (device_info[physical_device_id] .mmd_dispatch ) ;
2081
2085
msg_printed = (cl_bool)CL_FALSE;
2082
2086
if (!(is_simulator && msg_printed)) {
2083
2087
ACL_HAL_DEBUG_MSG_VERBOSE (1 , " Reprogramming device [%d] with handle %d\n " ,
@@ -2988,9 +2992,11 @@ void acl_hal_mmd_simulation_streaming_kernel_done(
2988
2992
void acl_hal_mmd_simulation_set_kernel_cra_address_map (
2989
2993
unsigned int physical_device_id,
2990
2994
const std::vector<uintptr_t > &kernel_csr_address_map) {
2991
- device_info[physical_device_id]
2992
- .mmd_dispatch ->aocl_mmd_simulation_set_kernel_cra_address_map (
2993
- device_info[physical_device_id].handle , kernel_csr_address_map);
2995
+ if (l_is_simulator_dispatch (device_info[physical_device_id].mmd_dispatch )) {
2996
+ device_info[physical_device_id]
2997
+ .mmd_dispatch ->aocl_mmd_simulation_set_kernel_cra_address_map (
2998
+ device_info[physical_device_id].handle , kernel_csr_address_map);
2999
+ }
2994
3000
}
2995
3001
2996
3002
size_t acl_hal_mmd_read_csr (unsigned int physical_device_id, uintptr_t offset,
0 commit comments