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/hip commit: 1f0037eefc]
이 커밋은 다음에 포함됨:
@@ -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);
|
||||
|
||||
새 이슈에서 참조
사용자 차단