Skip to content
Open
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions hls4ml/templates/coyote_accelerator/host_libs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ void CoyoteInference::predict() {
}

// Poll on completion; each batch increments the counter by one
while (coyote_thread.checkCompleted(coyote::CoyoteOper::LOCAL_TRANSFER) != batch_size) {
std::this_thread::sleep_for(std::chrono::nanoseconds(50));
}
while (coyote_thread.checkCompleted(coyote::CoyoteOper::LOCAL_TRANSFER) != batch_size) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this cause 100% CPU usage while the program is polling?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On one of the cores, yes.

But sleep for less than 50us is not well-defined on most Linux platforms. Hence, measured latency can go from ~4us to >50us even though the "true" execution latency is still 4us.

}

void CoyoteInference::set_data(float *x, unsigned int i) {
Expand Down
Loading