-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[Clang][HIP][CUDA] Add __cluster_dims__ and __no_cluster__ attribute
#156686
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5e1d259
[Clang][HIP][CUDA] Add `__cluster_dims__` and `__no_cluster__` attribute
shiltian 8afe643
add documentation
shiltian 31689ab
fix comments
shiltian 80f1be5
minor improvements
shiltian bff2aef
fix an error
shiltian 53733e7
fix another comment
shiltian 20acef0
more information on no_dims
shiltian c80c4de
drop `__` in `Declspec`
shiltian 8293cff
fix comments
shiltian 9c4cfca
refine target feature lookup; fix comments
shiltian 177be4e
fix more comments
shiltian 450fa2f
remove unused code
shiltian 16fcb25
use attribute for diag msg
shiltian c75b762
refine docs
shiltian 98d7e29
comments
shiltian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -target-cpu gfx1250 -fcuda-is-device -emit-llvm -x hip -o - %s | FileCheck %s | ||
| // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -aux-triple amdgcn-amd-amdhsa -emit-llvm -x hip -o - %s | FileCheck --check-prefix=HOST %s | ||
|
|
||
| #include "Inputs/cuda.h" | ||
|
|
||
| const int constint = 4; | ||
|
|
||
| // HOST-NOT: "amdgpu-cluster-dims" | ||
|
|
||
| // CHECK: "amdgpu-cluster-dims"="2,2,2" | ||
| __global__ void __cluster_dims__(2, 2, 2) test_literal_3d() {} | ||
|
|
||
| // CHECK: "amdgpu-cluster-dims"="2,2,1" | ||
| __global__ void __cluster_dims__(2, 2) test_literal_2d() {} | ||
|
|
||
| // CHECK: "amdgpu-cluster-dims"="4,1,1" | ||
| __global__ void __cluster_dims__(4) test_literal_1d() {} | ||
|
|
||
| // CHECK: "amdgpu-cluster-dims"="4,2,1" | ||
| __global__ void __cluster_dims__(constint, constint / 2, 1) test_constant() {} | ||
|
|
||
| // CHECK: "amdgpu-cluster-dims"="0,0,0" | ||
| __global__ void __no_cluster__ test_no_cluster() {} | ||
|
|
||
| // CHECK: "amdgpu-cluster-dims"="7,1,1" | ||
| template<unsigned a> | ||
| __global__ void __cluster_dims__(a) test_template_1d() {} | ||
| template __global__ void test_template_1d<7>(); | ||
|
|
||
| // CHECK: "amdgpu-cluster-dims"="2,6,1" | ||
| template<unsigned a, unsigned b> | ||
| __global__ void __cluster_dims__(a, b) test_template_2d() {} | ||
| template __global__ void test_template_2d<2, 6>(); | ||
|
|
||
| // CHECK: "amdgpu-cluster-dims"="1,2,3" | ||
| template<unsigned a, unsigned b, unsigned c> | ||
| __global__ void __cluster_dims__(a, b, c) test_template_3d() {} | ||
| template __global__ void test_template_3d<1, 2, 3>(); |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.