Skip to content

Commit 09e949a

Browse files
committed
Suppress extraneous invocation image writes when we have a streaming control interface
1 parent 4ad6816 commit 09e949a

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

src/acl_kernel_if.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,11 +1228,15 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
12281228
}
12291229

12301230
if ((kern->io.debug_verbosity) >= 2) {
1231-
for (uintptr_t p = 0; p < image_size_static; p += sizeof(int)) {
1232-
unsigned int pword = *(unsigned int *)(image_p + p);
1233-
ACL_KERNEL_IF_DEBUG_MSG_VERBOSE(
1234-
kern, 2, ":: Writing inv image [%2d] @%8p := %4x\n", (int)(p),
1235-
(void *)(offset + p), pword);
1231+
// We only write the static part of the invocation image if the kernel uses
1232+
// CRA control.
1233+
if (!kern->streaming_control_signal_names[accel_id]) {
1234+
for (uintptr_t p = 0; p < image_size_static; p += sizeof(int)) {
1235+
unsigned int pword = *(unsigned int *)(image_p + p);
1236+
ACL_KERNEL_IF_DEBUG_MSG_VERBOSE(
1237+
kern, 2, ":: Writing inv image [%2d] @%8p := %4x\n", (int)(p),
1238+
(void *)(offset + p), pword);
1239+
}
12361240
}
12371241

12381242
if (kern->csr_version != CSR_VERSION_ID_18_1) {
@@ -1246,10 +1250,13 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
12461250
}
12471251

12481252
// When csr version is 18.1, the kernel args is part of the image. otherwise,
1249-
// it is in dynamic memory
1250-
acl_kernel_cra_write_block(kern, accel_id, offset, (unsigned int *)image_p,
1251-
image_size_static);
1252-
if (kern->csr_version != CSR_VERSION_ID_18_1) {
1253+
// it is in dynamic memory. Only write the static part of the invocation
1254+
// image if this kernel uses CRA control.
1255+
if (!kern->streaming_control_signal_names[accel_id]) {
1256+
acl_kernel_cra_write_block(kern, accel_id, offset, (unsigned int *)image_p,
1257+
image_size_static);
1258+
}
1259+
if (kern->csr_version != CSR_VERSION_ID_18_1 && image->arg_value_size > 0) {
12531260
acl_kernel_cra_write_block(
12541261
kern, accel_id, offset + (unsigned int)image_size_static,
12551262
(unsigned int *)image->arg_value, image->arg_value_size);

0 commit comments

Comments
 (0)