Bug#1116585: amd_hip_bf16.h: bf16 functions need to be static
Control: tags -1 - pending
Whoa there, Christian. Changing the definition of __HOST_DEVICE__ to
implicitly be static inline is using a bazooka to kill a housefly.
That would have knock-on effects on any code that uses the
__HOST_DEVICE__ macro, not just the handful of functions defined in the
bf16 header. That header is indeed quite difficult to use without static
or inline qualifiers on all the functions it defines and those functions
were clearly always intended to have inline and/or static qualifiers.
However, if we want to backport a fix to trixie, changing the macro is
not going to be acceptable. User code might be using that
__HOST_DEVICE__ macro, in which case the impact may be much larger than
just bf16 if we change that definition.
For this specific patch, there is also the problem that the
__HOST_DEVICE__ macro is defined in multiple different headers, but
you've only changed the definition in one. That will result in a warning
when both headers are included in the same translation unit (and
inconsistent definitions if different translation units include
different headers).
I would recommend that we consider narrowly adding the appropriate
static and/or inline qualifiers to the specific functions in
amd_hip_bf16.h where they are needed.
Sincerely,
Cory Bloor
Reply to: