You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.
I am trying to add support for missing HIP intrisics to HIPCL (see here for a WIP https://github.com/Kerilk/hipcl/tree/fence).
I encountered an issue when trying to add support for printf:
This "almost" works. The only issue is being unable to declare the function as:
extern"C" __device__ intprintf(__constant__ char * format, ...);
as pointers in function arguments cannot be in the constant address space. This causes the OpenCL kernel build to fail due to the printf argument format usually being in the constant address space (as it should), but the format then needs to be cast to the generic address space which is forbidden.
I am no expert in llvm pass and how they are written, but I think I see a couple ways to get around this:
define a new address space (__cl_constant__) in hip for the printf format causing the OpenCL counterpart to be decorated with the constant address space
add a quirk for printf automatically adding the constant address space to it's first argument. There are already several quirks for printf support in the various part of the tool chain, as it is the only allowed var_arg function.
What would seem to you the most reasonable (maybe a different one of course) approach to solve this issue?
Thanks
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
I am trying to add support for missing HIP intrisics to HIPCL (see here for a WIP https://github.com/Kerilk/hipcl/tree/fence).
I encountered an issue when trying to add support for printf:
This "almost" works. The only issue is being unable to declare the function as:
as pointers in function arguments cannot be in the constant address space. This causes the OpenCL kernel build to fail due to the printf argument format usually being in the constant address space (as it should), but the format then needs to be cast to the generic address space which is forbidden.
I am no expert in llvm pass and how they are written, but I think I see a couple ways to get around this:
__cl_constant__
) in hip for the printf format causing the OpenCL counterpart to be decorated with theconstant
address spaceconstant
address space to it's first argument. There are already several quirks for printf support in the various part of the tool chain, as it is the only allowed var_arg function.What would seem to you the most reasonable (maybe a different one of course) approach to solve this issue?
Thanks
The text was updated successfully, but these errors were encountered: