Skip to content

[ESIMD][NFC] Remove some unused HOST code #12122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ template <int N> struct vector_conversion_traits<bfloat16, N> {
// cast from _Float16 to int16_t:
return sycl::bit_cast<vector_type_t<RawT, N>>(ConvVal);
#else
vector_type_t<RawT, N> Output = 0;

for (int i = 0; i < N; i++) {
Output[i] = sycl::bit_cast<RawT>(static_cast<bfloat16>(Val[i]));
}
return Output;
__ESIMD_UNSUPPORTED_ON_HOST;
#endif // __SYCL_DEVICE_ONLY__
}

Expand All @@ -71,12 +66,7 @@ template <int N> struct vector_conversion_traits<bfloat16, N> {
RawVecT Bits = sycl::bit_cast<RawVecT>(Val);
return __esimd_bf_cvt<StdT, vc_be_bfloat16_raw_t, N>(Bits);
#else
vector_type_t<StdT, N> Output;

for (int i = 0; i < N; i++) {
Output[i] = sycl::bit_cast<bfloat16>(Val[i]);
}
return Output;
__ESIMD_UNSUPPORTED_ON_HOST;
#endif // __SYCL_DEVICE_ONLY__
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
// Macros for internal use
#define __ESIMD_NS sycl::ext::intel::esimd
#define __ESIMD_DNS sycl::ext::intel::esimd::detail
#define __ESIMD_EMU_DNS sycl::ext::intel::esimd::emu::detail
#define __ESIMD_ENS sycl::ext::intel::experimental::esimd
#define __ESIMD_EDNS sycl::ext::intel::experimental::esimd::detail
#define __ESIMD_XMX_NS sycl::ext::intel::esimd::xmx
Expand Down
22 changes: 3 additions & 19 deletions sycl/include/sycl/ext/intel/esimd/detail/half_type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,7 @@ template <int N> struct vector_conversion_traits<sycl::half, N> {
;
#else
{
vector_type_t<half_raw_type, N> Output = 0;

for (int i = 0; i < N; i += 1) {
// 1. Convert Val[i] to float (x) using c++ static_cast
// 2. Convert x to half (using float2half)
// 3. Output[i] = half_of(x)
Output[i] = ::sycl::detail::float2Half(static_cast<float>(Val[i]));
}
return Output;
__ESIMD_UNSUPPORTED_ON_HOST;
}
#endif // __SYCL_DEVICE_ONLY__

Expand All @@ -82,15 +74,7 @@ template <int N> struct vector_conversion_traits<sycl::half, N> {
;
#else
{
vector_type_t<StdT, N> Output;

for (int i = 0; i < N; i += 1) {
// 1. Convert Val[i] to float y(using half2float)
// 2. Convert y to StdT using c++ static_cast
// 3. Store in Output[i]
Output[i] = static_cast<StdT>(::sycl::detail::half2Float(Val[i]));
}
return Output;
__ESIMD_UNSUPPORTED_ON_HOST;
}
#endif // __SYCL_DEVICE_ONLY__
};
Expand All @@ -111,7 +95,7 @@ class WrapperElementTypeProxy {

static ESIMD_INLINE sycl::half bitcast_to_wrapper_scalar(half_raw_type Val) {
#ifndef __SYCL_DEVICE_ONLY__
return sycl::half(::sycl::detail::host_half_impl::half(Val));
__ESIMD_UNSUPPORTED_ON_HOST;
#else
sycl::half Res;
Res.Data = Val;
Expand Down
Loading