File tree Expand file tree Collapse file tree 2 files changed +14
-18
lines changed
include/sycl/ext/intel/experimental Expand file tree Collapse file tree 2 files changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,16 @@ class [[sycl_detail::uses_aspects(ext_intel_bf16_conversion)]] bfloat16 {
30
30
#if defined(__SYCL_DEVICE_ONLY__)
31
31
return __spirv_ConvertFToBF16INTEL (a);
32
32
#else
33
- throw runtime_error ( " Bfloat16 conversion is not supported on HOST device. " ,
34
- PI_INVALID_DEVICE) ;
33
+ throw exception{errc::feature_not_supported ,
34
+ Bfloat16 conversion is not supported on host device} ;
35
35
#endif
36
36
}
37
37
static float to_float (const storage_t &a) {
38
38
#if defined(__SYCL_DEVICE_ONLY__)
39
39
return __spirv_ConvertBF16ToFINTEL (a);
40
40
#else
41
- throw runtime_error ( " Bfloat16 conversion is not supported on HOST device. " ,
42
- PI_INVALID_DEVICE) ;
41
+ throw exception{errc::feature_not_supported ,
42
+ Bfloat16 conversion is not supported on host device} ;
43
43
#endif
44
44
}
45
45
Original file line number Diff line number Diff line change @@ -36,19 +36,15 @@ float op(float a, float b) {
36
36
// CHECK-NOT: fptoui
37
37
}
38
38
39
- int main (int argc, char *argv[])
40
- {
41
- float data[3 ] = {7.0 , 8.1 , 0.0 };
42
- cl::sycl::queue deviceQueue;
43
- cl::sycl::buffer<float , 1 > buf {data, cl::sycl::range<1 > {3 }};
44
-
45
- deviceQueue.submit ([&] (cl::sycl::handler& cgh)
46
- {
47
- auto numbers = buf.get_access <cl::sycl::access::mode::read_write> (cgh);
48
- cgh.single_task <class simple_kernel > ([=] ()
49
- {
50
- numbers[2 ] = op (numbers[0 ], numbers[1 ]);
51
- });
52
- });
39
+ int main (int argc, char *argv[]) {
40
+ float data[3 ] = {7.0 , 8.1 , 0.0 };
41
+ cl::sycl::queue deviceQueue;
42
+ cl::sycl::buffer<float , 1 > buf{data, cl::sycl::range<1 >{3 }};
43
+
44
+ deviceQueue.submit ([&](cl::sycl::handler &cgh) {
45
+ auto numbers = buf.get_access <cl::sycl::access::mode::read_write>(cgh);
46
+ cgh.single_task <class simple_kernel >(
47
+ [=]() { numbers[2 ] = op (numbers[0 ], numbers[1 ]); });
48
+ });
53
49
return 0 ;
54
50
}
You can’t perform that action at this time.
0 commit comments