Skip to content

Commit 7528ef0

Browse files
authored
[ESIMD][NFC] Remove some unused HOST code (#12122)
It is cascade removal of some unused code after removing esimd/detail/host_util.hpp and removing __ESIMD_EMU_DNS namespace. Even with this change ESIMD headers still have lots of unused HOST-only code. Signed-off-by: Klochkov, Vyacheslav N <[email protected]>
1 parent 9f9a1d5 commit 7528ef0

File tree

8 files changed

+104
-1988
lines changed

8 files changed

+104
-1988
lines changed

sycl/include/sycl/ext/intel/esimd/detail/bfloat16_type_traits.hpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,7 @@ template <int N> struct vector_conversion_traits<bfloat16, N> {
5555
// cast from _Float16 to int16_t:
5656
return sycl::bit_cast<vector_type_t<RawT, N>>(ConvVal);
5757
#else
58-
vector_type_t<RawT, N> Output = 0;
59-
60-
for (int i = 0; i < N; i++) {
61-
Output[i] = sycl::bit_cast<RawT>(static_cast<bfloat16>(Val[i]));
62-
}
63-
return Output;
58+
__ESIMD_UNSUPPORTED_ON_HOST;
6459
#endif // __SYCL_DEVICE_ONLY__
6560
}
6661

@@ -71,12 +66,7 @@ template <int N> struct vector_conversion_traits<bfloat16, N> {
7166
RawVecT Bits = sycl::bit_cast<RawVecT>(Val);
7267
return __esimd_bf_cvt<StdT, vc_be_bfloat16_raw_t, N>(Bits);
7368
#else
74-
vector_type_t<StdT, N> Output;
75-
76-
for (int i = 0; i < N; i++) {
77-
Output[i] = sycl::bit_cast<bfloat16>(Val[i]);
78-
}
79-
return Output;
69+
__ESIMD_UNSUPPORTED_ON_HOST;
8070
#endif // __SYCL_DEVICE_ONLY__
8171
}
8272
};

sycl/include/sycl/ext/intel/esimd/detail/defines_elementary.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
// Macros for internal use
5454
#define __ESIMD_NS sycl::ext::intel::esimd
5555
#define __ESIMD_DNS sycl::ext::intel::esimd::detail
56-
#define __ESIMD_EMU_DNS sycl::ext::intel::esimd::emu::detail
5756
#define __ESIMD_ENS sycl::ext::intel::experimental::esimd
5857
#define __ESIMD_EDNS sycl::ext::intel::experimental::esimd::detail
5958
#define __ESIMD_XMX_NS sycl::ext::intel::esimd::xmx

sycl/include/sycl/ext/intel/esimd/detail/half_type_traits.hpp

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,7 @@ template <int N> struct vector_conversion_traits<sycl::half, N> {
6363
;
6464
#else
6565
{
66-
vector_type_t<half_raw_type, N> Output = 0;
67-
68-
for (int i = 0; i < N; i += 1) {
69-
// 1. Convert Val[i] to float (x) using c++ static_cast
70-
// 2. Convert x to half (using float2half)
71-
// 3. Output[i] = half_of(x)
72-
Output[i] = ::sycl::detail::float2Half(static_cast<float>(Val[i]));
73-
}
74-
return Output;
66+
__ESIMD_UNSUPPORTED_ON_HOST;
7567
}
7668
#endif // __SYCL_DEVICE_ONLY__
7769

@@ -82,15 +74,7 @@ template <int N> struct vector_conversion_traits<sycl::half, N> {
8274
;
8375
#else
8476
{
85-
vector_type_t<StdT, N> Output;
86-
87-
for (int i = 0; i < N; i += 1) {
88-
// 1. Convert Val[i] to float y(using half2float)
89-
// 2. Convert y to StdT using c++ static_cast
90-
// 3. Store in Output[i]
91-
Output[i] = static_cast<StdT>(::sycl::detail::half2Float(Val[i]));
92-
}
93-
return Output;
77+
__ESIMD_UNSUPPORTED_ON_HOST;
9478
}
9579
#endif // __SYCL_DEVICE_ONLY__
9680
};
@@ -111,7 +95,7 @@ class WrapperElementTypeProxy {
11195

11296
static ESIMD_INLINE sycl::half bitcast_to_wrapper_scalar(half_raw_type Val) {
11397
#ifndef __SYCL_DEVICE_ONLY__
114-
return sycl::half(::sycl::detail::host_half_impl::half(Val));
98+
__ESIMD_UNSUPPORTED_ON_HOST;
11599
#else
116100
sycl::half Res;
117101
Res.Data = Val;

0 commit comments

Comments
 (0)