Fix hipTestFMA to align with libcxx
The HIP-Clang math headers upstream have been updated
to perform type promotion on math function overloads.
If any argument has integral type, it will be cast to
double.
Change-Id: I38d9e6240c40c4092b946851469498b2ae6500ae
[ROCm/clr commit: 9c041b1984]
Этот коммит содержится в:
коммит произвёл
Laurent Morichetti
родитель
48f0f9f8ad
Коммит
aee19bb761
@@ -43,19 +43,19 @@ THE SOFTWARE.
|
||||
double doubleResult = fma(d, d, 3.0);
|
||||
Check(floatResult != doubleResult);
|
||||
|
||||
// check promote to float.
|
||||
Check(fma(f, f, 3) == floatResult);
|
||||
Check(fma(f, f, (char)3) == floatResult);
|
||||
Check(fma(f, f, (unsigned char)3) == floatResult);
|
||||
Check(fma(f, f, (short)3) == floatResult);
|
||||
Check(fma(f, f, (unsigned short)3) == floatResult);
|
||||
Check(fma(f, f, (int)3) == floatResult);
|
||||
Check(fma(f, f, (unsigned int)3) == floatResult);
|
||||
Check(fma(f, f, (long)3) == floatResult);
|
||||
Check(fma(f, f, (unsigned long)3) == floatResult);
|
||||
Check(fma(f, f, true) == fma(f, f, 1.0f));
|
||||
|
||||
// check promote to double.
|
||||
// To align with libcxx, if any argument has integral type,
|
||||
// it is cast to double.
|
||||
// Check type promotes to double.
|
||||
Check(fma(f, f, 3) == doubleResult);
|
||||
Check(fma(f, f, (char)3) == doubleResult);
|
||||
Check(fma(f, f, (unsigned char)3) == doubleResult);
|
||||
Check(fma(f, f, (short)3) == doubleResult);
|
||||
Check(fma(f, f, (unsigned short)3) == doubleResult);
|
||||
Check(fma(f, f, (int)3) == doubleResult);
|
||||
Check(fma(f, f, (unsigned int)3) == doubleResult);
|
||||
Check(fma(f, f, (long)3) == doubleResult);
|
||||
Check(fma(f, f, (unsigned long)3) == doubleResult);
|
||||
Check(fma(f, f, true) == fma((double)f, (double)f, 1.0));
|
||||
Check(fma(d, (double)f, 3) == doubleResult);
|
||||
Check(fma(d, (double)f, (char)3) == doubleResult);
|
||||
Check(fma(d, (double)f, (unsigned char)3) == doubleResult);
|
||||
|
||||
Ссылка в новой задаче
Block a user