File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
test/optional_kernel_features Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 8
8
9
9
#pragma once
10
10
11
+ #include < sycl/aspects.hpp>
11
12
#include < sycl/detail/defines.hpp>
12
13
#include < sycl/detail/export.hpp>
13
14
#include < sycl/detail/iostream_proxy.hpp>
@@ -265,7 +266,11 @@ using Vec8StorageT = half_vec<8>;
265
266
using Vec16StorageT = half_vec<16 >;
266
267
#endif
267
268
269
+ #ifndef __SYCL_DEVICE_ONLY__
268
270
class half {
271
+ #else
272
+ class [[__sycl_detail__::__uses_aspects__(aspect::fp16)]] half {
273
+ #endif
269
274
public:
270
275
half () = default ;
271
276
constexpr half (const half &) = default ;
Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx %s -S -o %t.ll -fsycl-device-only
2
+ // RUN: FileCheck %s --input-file %t.ll
3
+
4
+ // CHECK: !sycl_types_that_use_aspects = !{![[#MDNUM:]]}
5
+ // CHECK: ![[#MDNUM]] = !{!"class.sycl::_V1::detail::half_impl::half", i32 [[#ASPECT_NUM:]]}
6
+ // CHECK: !{{.*}} = !{!"fp16", i32 [[#ASPECT_NUM]]}
7
+
8
+ #include < sycl/sycl.hpp>
9
+
10
+ int main () {
11
+ sycl::queue q;
12
+ q.submit ([&](sycl::handler &h) {
13
+ h.single_task ([=]() {
14
+ sycl::half h;
15
+ h = 10.0 ;
16
+ });
17
+ });
18
+ return 0 ;
19
+ }
You can’t perform that action at this time.
0 commit comments