P4 to Git Change 1778949 by michliao@hliao-dev-00-hip.rocm-workspace on 2019/05/06 16:36:53
SWDEV-144570 - Fix build failure after switching to gcc-7
- Hex representation of float needs gnu++11. We'd better not relying on
that. Change the float in hex format into alternative representation.
RBT: http://ocltc.amd.com/reviews/r/17300/
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#29 edit
[ROCm/hip commit: 09920e6024]
此提交包含在:
@@ -642,9 +642,9 @@ static inline int clamp_int(int i, int l, int h) { return std::min(std::max(i, l
|
||||
// half float, the f16 is in the low 16 bits of the input argument
|
||||
static inline float __convert_half_to_float(std::uint32_t a) noexcept {
|
||||
std::uint32_t u = ((a << 13) + 0x70000000U) & 0x8fffe000U;
|
||||
std::uint32_t v = f32_as_u32(u32_as_f32(u) * 0x1.0p+112f) + 0x38000000U;
|
||||
std::uint32_t v = f32_as_u32(u32_as_f32(u) * u32_as_f32(0x77800000U)/*0x1.0p+112f*/) + 0x38000000U;
|
||||
u = (a & 0x7fff) != 0 ? v : u;
|
||||
return u32_as_f32(u) * 0x1.0p-112f;
|
||||
return u32_as_f32(u) * u32_as_f32(0x07800000U)/*0x1.0p-112f*/;
|
||||
}
|
||||
|
||||
// float half with nearest even rounding
|
||||
|
||||
新增問題並參考
封鎖使用者