Open
Description
Consider the following example, which implements a complex multiply-add function named "mad" with a signature that clashes with the
builtin OpenCL math function mad(gentype, gentype, gentype)
(where gentype includes double2).
__attribute__((overloadable)) double2 mad(double2 a, double2 b, double2 c) {
return (double2) (fma(a.x, b.x, fma(a.y, -b.y, c.x)), fma(a.x, b.y, fma(a.y, b.x, c.y)));
}
kernel void testKernel(global double2* out, global double2* in) {
uint me = get_local_id(0);
double2 a = in[3*me];
double2 b = in[3*me + 1];
double2 c = in[3*me + 2];
out[me] = mad(a, b, c);
}
This example is compiled very differently by ROCm 6.1.3 and ROCm 6.2.0.
In both case it is accepted without errors or warnings.
The resulting compilation is:
With ROCm 6.1.3, the user-defined mad() is used,
with ROCm 6.2.0, the built-in mad() is used.
In particular the 6.2.0 behavior, where the user defined function is accepted without errors and silently ignored afterwards, is not acceptable IMO and represents a bug.