Skip to content
This repository was archived by the owner on Mar 2, 2026. It is now read-only.

Commit c60be0a

Browse files
committed
Pass information on whether a streaming kernel has CRA arguments to MMD
(cherry picked from commit 71d91e4)
1 parent c373172 commit c60be0a

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

include/acl_hal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ typedef struct {
242242

243243
void (*simulation_streaming_kernel_start)(unsigned int physical_device_id,
244244
const std::string &signal_name,
245-
const int accel_id);
245+
const int accel_id,
246+
const bool accel_has_agent_args);
246247
void (*simulation_streaming_kernel_done)(unsigned int physical_device_id,
247248
const std::string &signal_name,
248249
unsigned int &finish_counter);

include/acl_hal_mmd.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ typedef struct {
244244

245245
// Submits streaming kernel control start signal to simulator.
246246
void (*aocl_mmd_simulation_streaming_kernel_start)(
247-
int handle, const std::string &signal_name, const int accel_id);
247+
int handle, const std::string &signal_name, const int accel_id,
248+
const bool accel_has_agent_args);
248249

249250
// Queries streaming kernel control done signal from simulator.
250251
// Returns non-negative number of finished kernels invocations.

src/acl_hal_mmd.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int acl_hal_mmd_set_profile_stop_count(unsigned int physical_device_id,
164164

165165
void acl_hal_mmd_simulation_streaming_kernel_start(
166166
unsigned int physical_device_id, const std::string &kernel_name,
167-
const int accel_id);
167+
const int accel_id, const bool accel_has_agent_args);
168168
void acl_hal_mmd_simulation_streaming_kernel_done(
169169
unsigned int physical_device_id, const std::string &kernel_name,
170170
unsigned int &finish_counter);
@@ -2970,10 +2970,11 @@ unsigned acl_convert_mmd_capabilities(unsigned mmd_capabilities) {
29702970

29712971
void acl_hal_mmd_simulation_streaming_kernel_start(
29722972
unsigned int physical_device_id, const std::string &kernel_name,
2973-
const int accel_id) {
2973+
const int accel_id, const bool accel_has_agent_args) {
29742974
device_info[physical_device_id]
29752975
.mmd_dispatch->aocl_mmd_simulation_streaming_kernel_start(
2976-
device_info[physical_device_id].handle, kernel_name, accel_id);
2976+
device_info[physical_device_id].handle, kernel_name, accel_id,
2977+
accel_has_agent_args);
29772978
}
29782979

29792980
void acl_hal_mmd_simulation_streaming_kernel_done(

src/acl_kernel_if.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,8 +1185,10 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
11851185
image_size_static);
11861186
}
11871187

1188+
bool accel_has_agent_args = false;
11881189
if (kern->csr_version.has_value() &&
11891190
(kern->csr_version != CSR_VERSION_ID_18_1 && image->arg_value_size > 0)) {
1191+
accel_has_agent_args = true;
11901192
if (kern->accel_arg_cache[accel_id] == nullptr) {
11911193
acl_kernel_cra_write_block(
11921194
kern, accel_id, offset + (unsigned int)image_size_static,
@@ -1238,7 +1240,8 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
12381240
if (kern->streaming_control_signal_names[accel_id]) {
12391241
acl_get_hal()->simulation_streaming_kernel_start(
12401242
kern->physical_device_id,
1241-
kern->streaming_control_signal_names[accel_id]->start, accel_id);
1243+
kern->streaming_control_signal_names[accel_id]->start, accel_id,
1244+
accel_has_agent_args);
12421245
return;
12431246
}
12441247

0 commit comments

Comments
 (0)