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
#include <
sycl/ext/intel/esimd/simd.hpp
>
12
#include <
sycl/ext/intel/esimd/simd_view.hpp
>
13
14
__SYCL_INLINE_NAMESPACE
(
cl
) {
15
namespace
__ESIMD_NS {
16
19
27
template
<
class
T,
int
N>
28
__ESIMD_API
simd<T, N>
merge
(
simd<T, N>
a,
simd<T, N>
b,
simd_mask<N>
m) {
29
b.merge(
a
, m);
30
return
b;
31
}
32
40
template
<
int
N>
41
__ESIMD_API
simd_mask<N>
merge
(
simd_mask<N>
a,
simd_mask<N>
b,
simd_mask<N>
m) {
42
b.merge(
a
, m);
43
return
a
;
44
}
45
55
template
<
class
BaseT1,
class
BaseT2,
class
RegionT1,
class
RegionT2,
56
class
=
std::enable_if_t
<
57
(
shape_type<RegionT1>::length
==
shape_type<RegionT2>::length
) &&
58
std::is_same_v<detail::element_type_t<BaseT1>,
59
detail::element_type_t<BaseT2>>>>
60
__ESIMD_API
auto
merge
(
simd_view<BaseT1, RegionT1>
v1,
61
simd_view<BaseT2, RegionT2>
v2,
62
simd_mask
<
shape_type<RegionT1>::length
> m) {
63
return
merge
(v1.read(), v2.read(), m);
64
}
65
67
68
}
// namespace __ESIMD_NS
69
}
// __SYCL_INLINE_NAMESPACE(cl)
simd_mask
Definition:
simd.hpp:1029
simd_view.hpp
cl::sycl::length
float length(T p) __NOEXC
Definition:
builtins.hpp:1032
cl::sycl::ext::intel::esimd::simd_view
This class represents a reference to a sub-region of a base simd object.
Definition:
types.hpp:32
cl::sycl::ext::intel::esimd::simd
The main simd vector class.
Definition:
types.hpp:31
cl::sycl::ext::intel::esimd::merge
__ESIMD_API auto merge(simd_view< BaseT1, RegionT1 > v1, simd_view< BaseT2, RegionT2 > v2, simd_mask< shape_type< RegionT1 >::length > m)
"Merges" elements of vectors referenced by the input views.
Definition:
alt_ui.hpp:60
cl
We provide new interfaces for matrix muliply in this patch:
Definition:
access.hpp:13
simd.hpp
cl::sycl::image_channel_order::a
@ a
cl::sycl::detail::enable_if_t
typename std::enable_if< B, T >::type enable_if_t
Definition:
stl_type_traits.hpp:24
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition:
defines_elementary.hpp:12
include
sycl
ext
intel
esimd
alt_ui.hpp
Generated by
1.8.17