@@ -10,9 +10,9 @@ SYCLcompat provides:
10
10
11
11
* A high-level API that provides closer semantics to other programming models,
12
12
simplifying line by line conversions.
13
- * Alternative submission APIs that encapusulate SYCL-specific "queue" and
13
+ * Alternative submission APIs that encapsulate SYCL-specific "queue" and
14
14
"event" APIs for easier reference.
15
- * Ability to gradually introduce other SYCL concepts as the user familiarises
15
+ * Ability to gradually introduce other SYCL concepts as the user familiarizes
16
16
themselves with the core SYCL API.
17
17
* Clear distinction between core SYCL API and the compatibility interface via
18
18
separate namespaces.
@@ -292,9 +292,10 @@ This `launch` interface allows users to define an internal memory pool, or
292
292
scratchpad, that can then be reinterpreted as the datatype required by the user
293
293
within the kernel function.
294
294
295
- To launch a kernel with a specified sub-group size, overloads similar to above `launch`
296
- functions are present in the `syclcompat::experimental` namespace, which accept SubgroupSize
297
- as a template parameter and can be called as `launch<Function, SubgroupSize>`
295
+ To launch a kernel with a specified sub-group size, overloads similar to above
296
+ `launch` functions are present in the `syclcompat::experimental` namespace,
297
+ which accept SubgroupSize as a template parameter and can be called as
298
+ `launch<Function, SubgroupSize>`
298
299
299
300
```cpp
300
301
@@ -840,8 +841,9 @@ The exposed functionalities include creation and destruction of queues, through
840
841
` syclcompat::create_queue ` and ` syclcompat::destroy_queue ` , and providing the
841
842
ability to wait for submitted kernels using ` syclcompat::wait ` or
842
843
` syclcompat::wait_and_throw ` . Any async errors will be output to ` stderr ` if
843
- ` print_on_async_exceptions ` , and will have the default behavior otherwise, which calls ` std:terminate ` . Synchronous exceptions have to be managed
844
- by users independently of what is set in this parameter.
844
+ ` print_on_async_exceptions ` , and will have the default behavior otherwise, which
845
+ calls ` std:terminate ` . Synchronous exceptions have to be managed by users
846
+ independently of what is set in this parameter.
845
847
846
848
Devices are managed through a helper class, ` device_ext ` . The ` device_ext ` class
847
849
associates a vector of ` sycl::queues ` with its ` sycl::device ` . The ` device_ext `
@@ -853,16 +855,16 @@ can be queried through `device_ext` as well.
853
855
throws a ` sycl::exception ` if the device does not have the specified list of
854
856
` sycl::aspect ` .
855
857
856
- Users can manage queues through the ` syclcompat::set_default_queue(sycl::queue q) `
857
- free function, and the ` device_ext ` ` set_saved_queue ` , ` set_default_queue ` ,
858
+ Users can manage queues through the `syclcompat::set_default_queue(sycl::queue
859
+ q) ` free function, and the ` device_ext` ` set_saved_queue` , ` set_default_queue`,
858
860
and ` get_saved_queue ` member functions.
859
- ` set_default_queue ` is blocking, and
860
- overwrites the previous default queue with a user defined one, waiting for any
861
- submitted kernels to finish.
861
+ ` set_default_queue ` is blocking, and overwrites the previous default queue with
862
+ a user defined one, waiting for any submitted kernels to finish.
862
863
The ` device_ext ` automatically sets the saved queue to the default queue.
863
864
Therefore, it's important to note that if the previous default queue was the
864
865
device's saved queue, setting a new default queue will update the reference of
865
- the saved queue to the new default one to keep the state of the class consistent.
866
+ the saved queue to the new default one to keep the state of the class
867
+ consistent.
866
868
867
869
The class is exposed as follows:
868
870
@@ -946,7 +948,7 @@ atomic operations is defined as `syclcompat::type_identity_t<T>` to avoid
946
948
template deduction issues when an operand of a different type (e.g. double
947
949
literal) is supplied. Atomic addition and subtraction free functions make use of
948
950
`syclcompat::arith_t<T>` to differentiate between numeric and pointer
949
- arithmetics .
951
+ arithmetic .
950
952
951
953
The available operations are exposed as follows:
952
954
@@ -1142,8 +1144,8 @@ low 32-bits back into an integer.
1142
1144
position of the first least significant set bit in an integer.
1143
1145
`byte_level_permute` returns a byte-permutation of two input unsigned integers,
1144
1146
with bytes selected according to a third unsigned integer argument.
1145
- `match_all_over_sub_group` and `match_any_over_sub_group` allows comparison of values
1146
- across work-items within a sub-group.
1147
+ `match_all_over_sub_group` and `match_any_over_sub_group` allows comparison of
1148
+ values across work-items within a sub-group.
1147
1149
1148
1150
The functions `select_from_sub_group`, `shift_sub_group_left`,
1149
1151
`shift_sub_group_right` and `permute_sub_group_by_xor` provide equivalent
@@ -1153,17 +1155,17 @@ However, they provide an optional argument to represent the `logical_group` size
1153
1155
(default 32).
1154
1156
1155
1157
`int_as_queue_ptr` helps with translation of code by reinterpret casting an
1156
- address to `sycl::queue *`, or returning a pointer to Syclcompat 's default queue
1158
+ address to `sycl::queue *`, or returning a pointer to SYCLcompat 's default queue
1157
1159
if the address is <= 2.
1158
1160
`args_selector` is a helper class for extracting arguments from an array of
1159
1161
pointers to arguments or buffer of arguments to pass to a kernel function.
1160
1162
The class allows users to exclude parameters such as `sycl::nd_item`.
1161
1163
Experimental support for masked versions of `select_from_sub_group`,
1162
1164
`shift_sub_group_left`, `shift_sub_group_right` and `permute_sub_group_by_xor`
1163
- is provided only for SPIRV or cuda devices.
1165
+ is provided only for SPIRV or CUDA devices.
1164
1166
1165
- As part of the compatibility utilities to facilitate machine translation to SYCL,
1166
- two aliases for errors are provided, `err0` and `err1`.
1167
+ As part of the compatibility utilities to facilitate machine translation to
1168
+ SYCL, two aliases for errors are provided, `err0` and `err1`.
1167
1169
1168
1170
```c++
1169
1171
namespace syclcompat {
@@ -1349,11 +1351,10 @@ kernel names during machine translation.
1349
1351
SYCL spec supported by the current SYCL compiler.
1350
1352
1351
1353
The `SYCLCOMPAT_CHECK_ERROR` macro encapsulates an error-handling mechanism for
1352
- expressions that might throw `sycl::exception` and `std::runtime_error`.
1353
- If no exceptions are thrown, it returns `syclcompat::error_code::SUCCESS`.
1354
- If a `sycl::exception` is caught, it returns `syclcompat::error_code::BACKEND_ERROR`.
1354
+ expressions that might throw `sycl::exception` and `std::runtime_error`. If no
1355
+ exceptions are thrown, it returns `syclcompat::error_code::SUCCESS`. If a
1356
+ `sycl::exception` is caught, it returns `syclcompat::error_code::BACKEND_ERROR`.
1355
1357
If a `std::runtime_error` exception is caught,
1356
-
1357
1358
`syclcompat::error_code::DEFAULT_ERROR` is returned instead. For both cases, it
1358
1359
prints the error message to the standard error stream.
1359
1360
@@ -1407,12 +1408,12 @@ current version, `kernel_function_info` describes only maximum work-group size.
1407
1408
1408
1409
SYCLcompat also provides the ` kernel_library ` and ` kernel_function ` classes.
1409
1410
` kernel_library ` facilitates the loading and unloading of kernel libraries.
1410
- ` kernel_function ` represents a specific kernel function within a loaded librariy
1411
+ ` kernel_function ` represents a specific kernel function within a loaded library
1411
1412
and can be invoked with specified arguments.
1412
- ` load_kernel_library ` , ` load_kernel_library_mem ` , and ` unload_kernel_library ` are
1413
- free functions to handle the loading and unloading of ` kernel_library ` objects.
1414
- ` get_kernel_function ` , and ` invoke_kernel_function ` offer a similar functionality
1415
- for ` kernel_function ` objects.
1413
+ ` load_kernel_library ` , ` load_kernel_library_mem ` , and ` unload_kernel_library `
1414
+ are free functions to handle the loading and unloading of ` kernel_library `
1415
+ objects. ` get_kernel_function ` , and ` invoke_kernel_function ` offer a similar
1416
+ functionality for ` kernel_function ` objects.
1416
1417
1417
1418
``` c++
1418
1419
namespace syclcompat {
@@ -1487,8 +1488,8 @@ as a vector of elements, and returning `0` for vector components for which
1487
1488
`vectorized_sum_abs_diff` calculates the absolute difference for two values
1488
1489
without modulo overflow for vector types.
1489
1490
1490
- The functions `cmul`,`cdiv`,`cabs`, `cmul_add`, and `conj` define complex math operations
1491
- which accept `sycl::vec<T,2>` arguments representing complex values.
1491
+ The functions `cmul`,`cdiv`,`cabs`, `cmul_add`, and `conj` define complex math
1492
+ operations which accept `sycl::vec<T,2>` arguments representing complex values.
1492
1493
1493
1494
```cpp
1494
1495
inline unsigned int funnelshift_l(unsigned int low, unsigned int high,
0 commit comments