-
Notifications
You must be signed in to change notification settings - Fork 421
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
add various GPU device query functions #25945
Conversation
--- Signed-off-by: Andy Stone <[email protected]>
--- Signed-off-by: Andy Stone <[email protected]>
--- Signed-off-by: Andy Stone <[email protected]>
--- Signed-off-by: Andy Stone <[email protected]>
--- Signed-off-by: Andy Stone <[email protected]>
--- Signed-off-by: Andy Stone <[email protected]>
--- Signed-off-by: Andy Stone <[email protected]>
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.
It'd be great if you can move memory allocation for the name query into the top-level code in the runtime. Otherwise, looks good! Thanks!
runtime/src/gpu/amd/gpu-amd.c
Outdated
@@ -512,5 +512,60 @@ void chpl_gpu_impl_host_unregister(void* var) { | |||
ROCM_CALL(hipHostUnregister(var)); | |||
} | |||
|
|||
void chpl_gpu_impl_name(int dev, char **result) { | |||
char* name = (char *)chpl_mem_alloc(0xFF, CHPL_RT_MD_IO_BUFFER, __LINE__, 0); |
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.
Why 0xFF
for size?
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 have a preference towards doing this allocation in chpl-gpu.c
as I don't see this as a vendor-specific operation.
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.
Why 0xFF for size?
I need to have some cap on the size and that seems like a nice, round, number that won't waste too much memory but will be large enough to store any reasonable device name.
I've factored out the (non GPU-vendor specific) allocation into chpl-gpu.c
.
Also, don't forget to remove "draft" from the PR message. :) |
--- Signed-off-by: Andy Stone <[email protected]>
--- Signed-off-by: Andy Stone <[email protected]>
This PR adds a
DeviceAttributes
type that includes a number of parenless proc functions to query various attributes about the GPU. (for example: max threads per block, device name, etc.)This aims to resolve #23638