Move fp16 dot functions to hip_fp16

[ROCm/clr commit: 7ba7d9a0f6]
This commit is contained in:
Aaron Enye Shi
2019-01-14 21:50:32 +00:00
vanhempi 896b320c5f
commit 87ed1bcf69
4 muutettua tiedostoa jossa 10 lisäystä ja 10 poistoa
@@ -1405,6 +1405,13 @@ THE SOFTWARE.
// Math functions
inline
__device__
float amd_mixed_dot(__half2 a, __half2 b, float c, bool saturate) {
return __ockl_fdot2(static_cast<__half2_raw>(a).data,
static_cast<__half2_raw>(b).data,
c, saturate);
}
inline
__device__
__half htrunc(__half x)
{
return __half_raw{
@@ -53,6 +53,8 @@ extern "C"
typedef _Float16 __2f16 __attribute__((ext_vector_type(2)));
typedef short __2i16 __attribute__((ext_vector_type(2)));
__device__ __attribute__((const)) float __ockl_fdot2(__2f16 a, __2f16 b, float c, bool s);
__device__ __attribute__((const)) __2f16 __ocml_ceil_2f16(__2f16);
__device__ __2f16 __ocml_cos_2f16(__2f16);
__device__ __attribute__((pure)) __2f16 __ocml_exp_2f16(__2f16);
@@ -75,4 +77,4 @@ extern "C"
__device__ __2f16 __ocml_sin_2f16(__2f16);
__device__ __attribute__((const)) __2f16 __ocml_sqrt_2f16(__2f16);
__device__ __attribute__((const)) __2f16 __ocml_trunc_2f16(__2f16);
}
}
@@ -123,11 +123,6 @@ uint64_t __make_mantissa(const char* tagp)
// DOT FUNCTIONS
__DEVICE__
inline
float amd_mixed_dot(__2f16 a, __2f16 b, float c, bool saturate) {
return __ockl_fdot2(a, b, c, saturate);
}
__DEVICE__
inline
int amd_mixed_dot(short2 a, short2 b, int c, bool saturate) {
return __ockl_sdot2(a, b, c, saturate);
}
@@ -29,10 +29,6 @@ THE SOFTWARE.
#endif
// DOT FUNCTIONS
typedef _Float16 __2f16 __attribute__((ext_vector_type(2)));
__device__
__attribute__((const))
float __ockl_fdot2(__2f16 a, __2f16 b, float c, bool s);
__device__
__attribute__((const))
int __ockl_sdot2(short2 a, short2 b, int c, bool s);