Skip to content

Commit abe13cf

Browse files
pcolbergsophimao
authored andcommitted
hal_mmd: add streaming control signal functions
Signed-off-by: Peter Colberg <[email protected]>
1 parent 7e4f157 commit abe13cf

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

include/acl_hal.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ typedef struct {
239239
/// Allocate USM shared memory
240240
void *(*shared_alloc)(cl_device_id device, size_t size, size_t alignment,
241241
mem_properties_t *properties, int *error);
242+
243+
void (*simulation_streaming_kernel_start)(unsigned int physical_device_id,
244+
const std::string &kernel_name);
245+
void (*simulation_streaming_kernel_done)(unsigned int physical_device_id,
246+
const std::string &kernel_name,
247+
unsigned int &finish_counter);
242248
} acl_hal_t;
243249

244250
/// Linked list of MMD library names to load.

src/acl_hal_mmd.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ int acl_hal_mmd_set_profile_start_count(unsigned int physical_device_id,
154154
int acl_hal_mmd_set_profile_stop_count(unsigned int physical_device_id,
155155
unsigned int accel_id, uint64_t value);
156156

157+
void acl_hal_mmd_simulation_streaming_kernel_start(
158+
unsigned int physical_device_id, const std::string &kernel_name);
159+
void acl_hal_mmd_simulation_streaming_kernel_done(
160+
unsigned int physical_device_id, const std::string &kernel_name,
161+
unsigned int &finish_counter);
162+
157163
static size_t acl_kernel_if_read(acl_bsp_io *io, dev_addr_t src, char *dest,
158164
size_t size);
159165
static size_t acl_kernel_if_write(acl_bsp_io *io, dev_addr_t dest,
@@ -344,7 +350,9 @@ static acl_hal_t acl_hal_mmd = {
344350
acl_hal_mmd_close_devices, // close_devices
345351
acl_hal_mmd_host_alloc, // host_alloc
346352
acl_hal_mmd_free, // free
347-
acl_hal_mmd_shared_alloc // shared_alloc
353+
acl_hal_mmd_shared_alloc, // shared_alloc
354+
acl_hal_mmd_simulation_streaming_kernel_start, // simulation_streaming_kernel_start
355+
acl_hal_mmd_simulation_streaming_kernel_done, // simulation_streaming_kernel_done
348356
};
349357

350358
// This will contain the device physical id to tell us which device across all
@@ -2827,3 +2835,18 @@ unsigned acl_convert_mmd_capabilities(unsigned mmd_capabilities) {
28272835
}
28282836
return capability;
28292837
}
2838+
2839+
void acl_hal_mmd_simulation_streaming_kernel_start(
2840+
unsigned int physical_device_id, const std::string &kernel_name) {
2841+
device_info[physical_device_id]
2842+
.mmd_dispatch->aocl_mmd_simulation_streaming_kernel_start(
2843+
device_info[physical_device_id].handle, kernel_name);
2844+
}
2845+
2846+
void acl_hal_mmd_simulation_streaming_kernel_done(
2847+
unsigned int physical_device_id, const std::string &kernel_name,
2848+
unsigned int &finish_counter) {
2849+
device_info[physical_device_id]
2850+
.mmd_dispatch->aocl_mmd_simulation_streaming_kernel_done(
2851+
device_info[physical_device_id].handle, kernel_name, finish_counter);
2852+
}

0 commit comments

Comments
 (0)