-
Couldn't load subscription status.
- Fork 573
Update and combine HIP porting guides #3862
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
Conversation
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.
Good work, I think this is a really nice unification of both pages. Some remarks:
| called. When ``__hipRegisterFunction`` is called, the stub functions are | ||
| associated with the corresponding kernels in the code objects. | ||
|
|
||
| HIP-Clang implements two sets of APIs for launching kernels. |
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.
What is the second set?
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.
HIP-Clang implements two sets of APIs for launching kernels:
- By default, when HIP-Clang encounters the <<<>>> statement in the host code, it first calls hipConfigureCall to set up the threads and grids. It then calls the stub function with the given arguments.
- The stub function calls hipSetupArgument for each kernel argument, then calls hipLaunchByPtr with a function pointer to the stub function. In hipLaunchByPtr, the actual kernel associated with the stub function is launched.
-or-
- By default, when HIP-Clang encounters the <<<>>> statement in the host code, it first calls hipConfigureCall to set up the threads and grids. It then calls the stub function with the given arguments. The stub function calls hipSetupArgument for each kernel argument, then calls hipLaunchByPtr with a function pointer to the stub function.
- In hipLaunchByPtr, the actual kernel associated with the stub function is launched.
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.
Are those distinct sets? When reading the paragraph from top to bottom, this sounds like a logical sequence of events:
- Encounter
<<<>>>, then - call
hipConfigureCallfor the grid configuration, then - call the stub function, then
- call
hipSetupArgumentfor each kernel argument, then - call
hipLaunchByPtr, then - launch actual kernel.
I think we need some input from the HIP-Clang team here, I assume the "two sets" description comes from them.
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.
@jujiang-del or @yxsamliu can you comment on this question and the issue of the two sets of APIs for launching kernels?
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.
Looks good overall. A few small things I've noticed:
a0176a3 to
7206a33
Compare
Co-authored-by: Jan Stephan <[email protected]>
Co-authored-by: Jan Stephan <[email protected]>
Co-authored-by: Jan Stephan <[email protected]>
Co-authored-by: Jan Stephan <[email protected]>
Update with Jan's comments. Reorder Compiler and Architecture discussion.
insert header to fix sequence
indent HIPIFY bullets
450e242 to
6ee8bb6
Compare
|
Please add these changes too: |
|
@randyh62 I do not have more comments. Others looks good. |
Updated from additional comments from Jan
fix :cpp:type:`` errors
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.
I'm done
|
@randyh62, just a minor suggestion about PRs like this. Please separate PRs that change and move code. It would drastically save reviewing time. Thanks! |
Implement Leo's feedback.
Added Istvan and Evgeniy comments
Co-authored-by: Julia Jiang <[email protected]>
Co-authored-by: Julia Jiang <[email protected]>
What type of PR is this? (check all applicable)
What were the changes?
Combined content from HIP porting guide and HIP driver porting guide.
Updated text as needed.
Why are these changes needed?
The two topics covered similar concepts, and needed to be updated.
Updated CHANGELOG?
Added/Updated documentation?
Additional Checks