Repository navigation
GPU: make the kernel entry-point signature work on Metal #15895
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: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,8 +63,17 @@ | |
| #define GPUCA_ATTRRES(...) GPUCA_M_EXPAND(GPUCA_M_CAT(GPUCA_ATTRRES_, GPUCA_M_FIRST(__VA_ARGS__)))(__VA_ARGS__) | ||
|
|
||
| // GPU Kernel entry point | ||
| // MSL requires every kernel parameter to carry an attribute, and supplies the | ||
| // grid dimensions the same way, so the backend gets to shape both ends of the | ||
| // parameter list. | ||
| #ifndef GPUCA_KRNL_SECTOR_ARG | ||
| #define GPUCA_KRNL_SECTOR_ARG int32_t _iSector_internal | ||
| #endif | ||
| #ifndef GPUCA_KRNL_GRID_ARGS | ||
| #define GPUCA_KRNL_GRID_ARGS | ||
| #endif | ||
| #define GPUCA_KRNLGPU_DEF(x_class, x_attributes, x_arguments, ...) \ | ||
| GPUg() void GPUCA_ATTRRES(GPUCA_M_STRIP(x_attributes)) GPUCA_M_CAT(krnl_, GPUCA_M_KRNL_NAME(x_class))(GPUCA_CONSMEM_PTR int32_t _iSector_internal GPUCA_M_STRIP(x_arguments)) | ||
| GPUg() void GPUCA_ATTRRES(GPUCA_M_STRIP(x_attributes)) GPUCA_M_CAT(krnl_, GPUCA_M_KRNL_NAME(x_class))(GPUCA_CONSMEM_PTR GPUCA_KRNL_SECTOR_ARG GPUCA_M_STRIP(x_arguments) GPUCA_KRNL_GRID_ARGS) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, but this means that you pass in local and global id and size as argument to the kernel function. |
||
|
|
||
| #ifdef GPUCA_KRNL_DEFONLY | ||
| #define GPUCA_KRNLGPU(...) GPUCA_KRNLGPU_DEF(__VA_ARGS__); | ||
|
|
||
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 don't understand why you need a special treatment for the sector variable in metal?
The sector variable is a normal variable, which is passed in like any other parameter to function calls.