Fix cast of __half for HIP-clang (#1475)

This commit is contained in:
Yaxun (Sam) Liu
2019-09-30 01:10:42 -04:00
committad av Maneesh Gupta
förälder ff1b23b558
incheckning 7b3b82bd0d
2 ändrade filer med 6 tillägg och 0 borttagningar
+1
Visa fil
@@ -223,6 +223,7 @@ THE SOFTWARE.
Enable_if_t<
std::is_floating_point<T>{} &&
!std::is_same<T, double>{}>* = nullptr>
__host__ __device__
operator T() const { return data; }
#endif
__host__ __device__
@@ -30,6 +30,11 @@ THE SOFTWARE.
#if __HIP_ARCH_GFX803__ || __HIP_ARCH_GFX900__ || __HIP_ARCH_GFX906__ || __HIP_ARCH_GFX908__
__device__ void test_convert() {
__half x;
float y = (float)x;
}
__global__
void __halfMath(bool* result, __half a) {
result[0] = __heq(__hadd(a, __half{1}), __half{2});