DPC++ Runtime
Runtime libraries for oneAPI DPC++
alt_ui.hpp
Go to the documentation of this file.
1 //==-------------- alt_ui.hpp - DPC++ Explicit SIMD API ------------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 // "Alternative" convenience Explicit SIMD APIs.
9 //===----------------------------------------------------------------------===//
10 
11 #pragma once
12 
15 
16 namespace sycl {
17 inline namespace _V1 {
18 namespace ext::intel::esimd {
21 
29 template <class T, int N>
31  b.merge(a, m);
32  return b;
33 }
34 
42 template <int N>
44  b.merge(a, m);
45  return a;
46 }
47 
57 template <class BaseT1, class BaseT2, class RegionT1, class RegionT2,
58  class = std::enable_if_t<
60  std::is_same_v<detail::element_type_t<BaseT1>,
61  detail::element_type_t<BaseT2>>>>
62 __ESIMD_API auto merge(simd_view<BaseT1, RegionT1> v1,
65  return merge(v1.read(), v2.read(), m);
66 }
67 
69 
70 } // namespace ext::intel::esimd
71 } // namespace _V1
72 } // namespace sycl
value_type read() const
Reads the viewed region from the target w/o any conversion and returns as an object of the value_type...
This class represents a reference to a sub-region of a base simd object.
Definition: simd_view.hpp:37
The main simd vector class.
Definition: simd.hpp:53
__ESIMD_API simd< T, N > merge(simd< T, N > a, simd< T, N > b, simd_mask< N > m)
"Merges" elements of the input simd object according to the merge mask.
Definition: alt_ui.hpp:30
auto autodecltype(a) b
Definition: access.hpp:18
ValueT length(const ValueT *a, const int len)
Calculate the square root of the input array.
Definition: math.hpp:161