Skip to content

Suppress extraneous invocation image writes when we have a streaming control interface #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions src/acl_kernel_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,11 +1228,15 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
}

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

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

// When csr version is 18.1, the kernel args is part of the image. otherwise,
// it is in dynamic memory
acl_kernel_cra_write_block(kern, accel_id, offset, (unsigned int *)image_p,
image_size_static);
if (kern->csr_version != CSR_VERSION_ID_18_1) {
// it is in dynamic memory. Only write the static part of the invocation
// image if this kernel uses CRA control.
if (!kern->streaming_control_signal_names[accel_id]) {
acl_kernel_cra_write_block(kern, accel_id, offset, (unsigned int *)image_p,
image_size_static);
}
if (kern->csr_version != CSR_VERSION_ID_18_1 && image->arg_value_size > 0) {
acl_kernel_cra_write_block(
kern, accel_id, offset + (unsigned int)image_size_static,
(unsigned int *)image->arg_value, image->arg_value_size);
Expand Down