Skip to content

Commit d22a7b4

Browse files
Modify streaming_kernel_star function in the HAL
This commit changes the signature of the `simulation_streaming_kernel_start()` function to allow for the code to pass in an `accel_id` argument. The purpose of this parameter is to tell the simulator which kernel should start. The simulator uses this information to send a start signal to the kernel with id `accel_id`.
1 parent f66baab commit d22a7b4

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

include/acl_hal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ typedef struct {
241241
mem_properties_t *properties, int *error);
242242

243243
void (*simulation_streaming_kernel_start)(unsigned int physical_device_id,
244-
const std::string &signal_name);
244+
const std::string &signal_name,
245+
const int accel_id);
245246
void (*simulation_streaming_kernel_done)(unsigned int physical_device_id,
246247
const std::string &signal_name,
247248
unsigned int &finish_counter);

include/acl_hal_mmd.h

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

140140
// Submits streaming kernel control start signal to simulator.
141141
void (*aocl_mmd_simulation_streaming_kernel_start)(
142-
int handle, const std::string &signal_name);
142+
int handle, const std::string &signal_name, const int accel_id);
143143

144144
// Queries streaming kernel control done signal from simulator.
145145
// Returns non-negative number of finished kernels invocations.
@@ -149,6 +149,7 @@ typedef struct {
149149
// accounted and returned in a subsequent invocation of this function.
150150
void (*aocl_mmd_simulation_streaming_kernel_done)(
151151
int handle, const std::string &signal_name, unsigned int &finish_counter);
152+
152153
} acl_mmd_dispatch_t;
153154

154155
typedef struct {

src/acl_hal_mmd.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ int acl_hal_mmd_set_profile_stop_count(unsigned int physical_device_id,
155155
unsigned int accel_id, uint64_t value);
156156

157157
void acl_hal_mmd_simulation_streaming_kernel_start(
158-
unsigned int physical_device_id, const std::string &kernel_name);
158+
unsigned int physical_device_id, const std::string &kernel_name,
159+
const int accel_id);
159160
void acl_hal_mmd_simulation_streaming_kernel_done(
160161
unsigned int physical_device_id, const std::string &kernel_name,
161162
unsigned int &finish_counter);
@@ -2810,10 +2811,11 @@ unsigned acl_convert_mmd_capabilities(unsigned mmd_capabilities) {
28102811
}
28112812

28122813
void acl_hal_mmd_simulation_streaming_kernel_start(
2813-
unsigned int physical_device_id, const std::string &kernel_name) {
2814+
unsigned int physical_device_id, const std::string &kernel_name,
2815+
const int accel_id) {
28142816
device_info[physical_device_id]
28152817
.mmd_dispatch->aocl_mmd_simulation_streaming_kernel_start(
2816-
device_info[physical_device_id].handle, kernel_name);
2818+
device_info[physical_device_id].handle, kernel_name, accel_id);
28172819
}
28182820

28192821
void acl_hal_mmd_simulation_streaming_kernel_done(

src/acl_kernel_if.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
13081308
if (kern->streaming_control_signal_names[accel_id]) {
13091309
acl_get_hal()->simulation_streaming_kernel_start(
13101310
kern->physical_device_id,
1311-
kern->streaming_control_signal_names[accel_id]->start);
1311+
kern->streaming_control_signal_names[accel_id]->start, accel_id);
13121312
return;
13131313
}
13141314

0 commit comments

Comments
 (0)