Skip to content

Commit

Permalink
snRuntime: Add snrt_cluster_is_last_compute_core() function
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Aug 21, 2024
1 parent 216afd1 commit ffbae78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sw/snRuntime/src/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ extern uint32_t snrt_cluster_compute_core_num();

extern int snrt_is_compute_core();

extern int snrt_cluster_is_last_compute_core();

extern int snrt_is_dm_core();

extern uint32_t snrt_cluster_dm_core_num();
4 changes: 4 additions & 0 deletions sw/snRuntime/src/team.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ inline int __attribute__((const)) snrt_is_compute_core() {
return snrt_cluster_core_idx() < snrt_cluster_compute_core_num();
}

inline int __attribute__((const)) snrt_cluster_is_last_compute_core() {
return snrt_cluster_core_idx() == (snrt_cluster_compute_core_num() - 1);
}

inline int __attribute__((const)) snrt_is_dm_core() {
return !snrt_is_compute_core();
}

0 comments on commit ffbae78

Please sign in to comment.