-
Notifications
You must be signed in to change notification settings - Fork 79
KernelIntrinsics API #635
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
base: main
Are you sure you want to change the base?
KernelIntrinsics API #635
Conversation
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/KernelAbstractions.jl b/src/KernelAbstractions.jl
index 7b626618..1e27573a 100644
--- a/src/KernelAbstractions.jl
+++ b/src/KernelAbstractions.jl
@@ -247,7 +247,7 @@ macro localmem(T, dims)
# id = gensym("static_shmem")
return quote
- $SharedMemory($(esc(T)), Val($(esc(dims))))#, Val($(QuoteNode(id))))
+ $SharedMemory($(esc(T)), Val($(esc(dims)))) #, Val($(QuoteNode(id))))
end
end
diff --git a/src/intrinsics.jl b/src/intrinsics.jl
index 37cbba88..4aaedd24 100644
--- a/src/intrinsics.jl
+++ b/src/intrinsics.jl
@@ -63,7 +63,7 @@ Declare memory that is local to a workgroup.
```
As well as the on-device functionality.
"""
-localmemory(::Type{T}, dims) where T = localmemory(T, Val(dims))
+localmemory(::Type{T}, dims) where {T} = localmemory(T, Val(dims))
# @inline localmemory(::Type{T}, dims::Val{Dims}) where {T, Dims} = localmemory(T, dims, Val(gensym("static_shmem")))
"""
diff --git a/test/intrinsics.jl b/test/intrinsics.jl
index e58b58a6..a586de08 100644
--- a/test/intrinsics.jl
+++ b/test/intrinsics.jl
@@ -20,7 +20,7 @@ end
function intrinsics_testsuite(backend, AT)
- @testset "KernelIntrinsics Tests" begin
+ return @testset "KernelIntrinsics Tests" begin
@testset "Basic intrinsics functionality" begin
# Test with small kernel |
c16a665 to
b166baa
Compare
|
Can you rebase? |
b166baa to
928e6fd
Compare
This comment was marked as outdated.
This comment was marked as outdated.
928e6fd to
cd7476e
Compare
src/intrinsics.jl
Outdated
| function localmemory end | ||
| function barrier() | ||
| error("Group barrier used outside kernel or not captured") | ||
| end | ||
| function print end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs docs.
|
@christiangnrd do you think we need a lower-level kernel launch interface? Otherwise the three-dimensional indices would be superflous. |
cd7476e to
84d0c68
Compare
I'd been thinking about that and I think so. Would something that, assuming you wrote the whole kernel with |
The goal is to allow for kernels to be written without relying on KernelAbstractions macros
See #562 for initial discussion
@vchuravy @maleadt