SWDEV-529927 - add missing operations for fp16/bf16 (#238)

이 커밋은 다음에 포함됨:
Chaudhary, Jatin Jaikishan 작성하고 GitHub가 2025-05-06 09:41:21 +01:00를 커밋함
1 부모 65a0181a7c
커밋 b1ebf33850
2 파일이 변경됨
+13 -4

검색과 일치하는 파일 없음

+12 -3
파일 보기
@@ -453,7 +453,7 @@ __BF16_HOST_DEVICE_STATIC__ __hip_bfloat162 __bfloat162bfloat162(const __hip_bfl
}
/**
* \ingroup HIP_INTRINSIC_BFLOAT162_CONV
* \ingroup HIP_INTRINSIC_BFLOAT16_CONV
* \brief Reinterprets bits in a __hip_bfloat16 as a signed short integer
*/
__BF16_HOST_DEVICE_STATIC__ short int __bfloat16_as_short(const __hip_bfloat16 h) {
@@ -466,7 +466,7 @@ __BF16_HOST_DEVICE_STATIC__ short int __bfloat16_as_short(const __hip_bfloat16 h
}
/**
* \ingroup HIP_INTRINSIC_BFLOAT162_CONV
* \ingroup HIP_INTRINSIC_BFLOAT16_CONV
* \brief Reinterprets bits in a __hip_bfloat16 as an unsigned signed short integer
*/
__BF16_HOST_DEVICE_STATIC__ unsigned short int __bfloat16_as_ushort(const __hip_bfloat16 h) {
@@ -479,7 +479,7 @@ __BF16_HOST_DEVICE_STATIC__ unsigned short int __bfloat16_as_ushort(const __hip_
}
/**
* \ingroup HIP_INTRINSIC_BFLOAT162_CONV
* \ingroup HIP_INTRINSIC_BFLOAT16_CONV
* \brief Convert double to __hip_bfloat16
*/
__BF16_HOST_DEVICE_STATIC__ __hip_bfloat16 __double2bfloat16(const double a) {
@@ -487,6 +487,15 @@ __BF16_HOST_DEVICE_STATIC__ __hip_bfloat16 __double2bfloat16(const double a) {
return ret;
}
/**
* \ingroup HIP_INTRINSIC_BFLOAT16_CONV
* \brief Convert int to __hip_bfloat16
*/
__BF16_HOST_DEVICE_STATIC__ __hip_bfloat16 __int2bfloat16_rn(const int a) {
__hip_bfloat16 ret{a};
return ret;
}
/**
* \ingroup HIP_INTRINSIC_BFLOAT162_CONV
* \brief Convert float2 to __hip_bfloat162
+1 -1
파일 보기
@@ -783,7 +783,7 @@ THE SOFTWARE.
// int -> half
inline
__device__
__HOST_DEVICE__
__half __int2half_rn(int x)
{
return __half_raw{static_cast<_Float16>(x)};