-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #915 Add support for all tt-metal semaphore functions, as well as some utility functions that are useful for using semaphores through compiler For example, code below ```cpp Value zero = i32(0, builder); auto sem_id = builder.create<ttkernel::GetArgValOp>(arithOrMathOp.getLoc(), zero); auto sem_addr = builder.create<ttkernel::GetSemaphoreOp>(arithOrMathOp.getLoc(), sem_id); auto sem_l1_ptr = builder.create<ttkernel::CastToL1PtrOp>(arithOrMathOp.getLoc(), sem_addr); builder.create<ttkernel::NocSemaphoreWaitOp>(arithOrMathOp.getLoc(), sem_l1_ptr, zero); ``` will generate kernel code ```cpp int32_t v5 = get_arg_val<uint32_t>(v4); int32_t v6 = get_semaphore(v5); volatile tt_l1_ptr uint32_t* v7 = reinterpret_cast<volatile tt_l1_ptr uint32_t*>(v6); noc_semaphore_wait(v7, v4); ``` ### TODO - [ ] Implement conversion to `tt_l1_ptr` properly --------- Co-authored-by: Jacob DeSousa <jdesousa@tenstorrent.com>
- Loading branch information
1 parent
16549e2
commit 4ba1b73
Showing
5 changed files
with
259 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.