-
Notifications
You must be signed in to change notification settings - Fork 81
KI Sub-groups #668
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
Open
christiangnrd
wants to merge
10
commits into
JuliaGPU:main
Choose a base branch
from
christiangnrd:subgroups
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
KI Sub-groups #668
Conversation
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
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/intrinsics.jl b/src/intrinsics.jl
index 5f5528c7..4884c87f 100644
--- a/src/intrinsics.jl
+++ b/src/intrinsics.jl
@@ -269,7 +269,7 @@ kernel on the host.
Backends must also implement the on-device kernel launch functionality.
"""
-struct Kernel{B,Kern}
+struct Kernel{B, Kern}
backend::B
kern::Kern
end
@@ -410,7 +410,7 @@ There are a few keyword arguments that influence the behavior of `KI.@kernel`:
"""
macro kernel(backend, ex...)
call = ex[end]
- kwargs = map(ex[1:(end-1)]) do kwarg
+ kwargs = map(ex[1:(end - 1)]) do kwarg
if kwarg isa Symbol
:($kwarg = $kwarg)
elseif Meta.isexpr(kwarg, :(=))
diff --git a/test/intrinsics.jl b/test/intrinsics.jl
index 8dcddfc7..076fd3e3 100644
--- a/test/intrinsics.jl
+++ b/test/intrinsics.jl
@@ -12,12 +12,14 @@ function test_intrinsics_kernel(results)
i = KI.get_global_id().x
if i <= length(results)
- @inbounds results[i] = KernelData(KI.get_global_size().x,
- KI.get_global_id().x,
- KI.get_local_size().x,
- KI.get_local_id().x,
- KI.get_num_groups().x,
- KI.get_group_id().x)
+ @inbounds results[i] = KernelData(
+ KI.get_global_size().x,
+ KI.get_global_id().x,
+ KI.get_local_size().x,
+ KI.get_local_id().x,
+ KI.get_num_groups().x,
+ KI.get_group_id().x
+ )
end
return
end
@@ -32,11 +34,13 @@ function test_subgroup_kernel(results)
i = KI.get_global_id().x
if i <= length(results)
- @inbounds results[i] = SubgroupData(KI.get_sub_group_size(),
- KI.get_max_sub_group_size(),
- KI.get_num_sub_groups(),
- KI.get_sub_group_id(),
- KI.get_sub_group_local_id())
+ @inbounds results[i] = SubgroupData(
+ KI.get_sub_group_size(),
+ KI.get_max_sub_group_size(),
+ KI.get_num_sub_groups(),
+ KI.get_sub_group_id(),
+ KI.get_sub_group_local_id()
+ )
end
return
end
diff --git a/test/localmem.jl b/test/localmem.jl
index 7894ee61..c1d63c7a 100644
--- a/test/localmem.jl
+++ b/test/localmem.jl
@@ -57,7 +57,7 @@ end
lmem1 = @localmem Int (N,) # Ok iff groupsize is static
lmem2 = @localmem Int (N,) # Ok iff groupsize is static
@inbounds begin
- lmem1[i] = i-1
+ lmem1[i] = i - 1
lmem2[i] = 1
@synchronize
A[I] = lmem1[N2 - i + 1] + lmem2[N2 - i + 1] |
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.