Allow passing locks to C code.#288
Open
stephenneuendorffer wants to merge 1 commit intoXilinx:mainfrom
Open
Conversation
b8694db to
51d3d9f
Compare
keryell
reviewed
Apr 28, 2023
| #include "kernel.h" | ||
|
|
||
| void func(int32_t *a, int32_t *b) | ||
| void func(int32_t *a, int32_t *b, int64_t lock) |
Contributor
There was a problem hiding this comment.
Bad for the carbon footprint to have 64 bits here?
Collaborator
Author
There was a problem hiding this comment.
Yes.. this is the main reason why this hasn't been checked in. Today, it's relatively easy to lower from locks to a constant 'index' type in MLIR, but the size of the index type is something 'implementation defined' (by default 64 bits). This really should be cleaner in the lowering to result in something more convenient.
| %lock13_5 = AIE.lock(%tile13, 5) { sym_name = "output_lock" } | ||
|
|
||
| func.func private @func(%A: memref<256xi32>, %B: memref<256xi32>) -> () | ||
| func.func private @func(%A: memref<256xi32>, %B: memref<256xi32>, %lock: index) -> () |
Contributor
There was a problem hiding this comment.
Perhaps index could be a more precise type depending on the architecture?
Or at least lowered to a more precise concrete type before calling the real AIE kernel?
Contributor
|
To be merged? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.