You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @copyright 2018-today The PLSSVM project - All Rights Reserved
6
+
* @license This file is part of the PLSSVM project which is released under the MIT license.
7
+
* See the LICENSE.md file in the project root for full license information.
8
+
*
9
+
* @brief Defines all available kernel invoke types when using SYCL.
10
+
*/
11
+
12
+
#pragma once
13
+
14
+
#include<iosfwd>// forward declare std::ostream and std::istream
15
+
16
+
namespaceplssvm::sycl {
17
+
18
+
/**
19
+
* @brief Enum class for all possible SYCL kernel invocation types.
20
+
*/
21
+
enumclasskernel_invocation_type {
22
+
/** Use the best kernel invocation type for the current SYCL implementation and target hardware platform. */
23
+
automatic,
24
+
/** Use the [*nd_range* invocation type](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#_parallel_for_invoke). */
25
+
nd_range,
26
+
/** Use the SYCL specific [hierarchical invocation type](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#_parallel_for_hierarchical_invoke). */
27
+
hierarchical
28
+
};
29
+
30
+
/**
31
+
* @brief Output the @p invocation type to the given output-stream @p out.
32
+
* @param[in,out] out the output-stream to write the backend type to
33
+
* @param[in] invocation the SYCL kernel invocation type
Copy file name to clipboardExpand all lines: include/plssvm/backends/SYCL/predict_kernel.hpp
+12-15Lines changed: 12 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -44,12 +44,11 @@ class device_kernel_w_linear {
44
44
45
45
/**
46
46
* @brief Function call operator overload performing the actual calculation.
47
-
* @param[in] nd_idx the [`sycl::item`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:item.class)
48
-
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
47
+
* @param[in] index the [`sycl::id`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#id-class)
48
+
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
49
49
*/
50
-
voidoperator()(::sycl::nd_item<1> nd_idx) const {
51
-
const kernel_index_type index = nd_idx.get_global_linear_id();
52
-
real_type temp = 0;
50
+
voidoperator()(::sycl::id<1> index) const {
51
+
real_type temp{ 0.0 };
53
52
if (index < num_features_) {
54
53
for (kernel_index_type dat = 0; dat < num_data_points_ - 1; ++dat) {
@@ -99,12 +98,11 @@ class device_kernel_predict_poly {
99
98
100
99
/**
101
100
* @brief Function call operator overload performing the actual calculation.
102
-
* @param[in] nd_idx the [`sycl::item`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:item.class)
103
-
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
101
+
* @param[in] idx the [`sycl::nd_item`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#nditem-class) identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
@@ -165,12 +163,11 @@ class device_kernel_predict_radial {
165
163
166
164
/**
167
165
* @brief Function call operator overload performing the actual calculation.
168
-
* @param[in] nd_idx the [`sycl::item`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:item.class)
169
-
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
166
+
* @param[in] idx the [`sycl::nd_item`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#nditem-class) identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
Copy file name to clipboardExpand all lines: include/plssvm/backends/SYCL/q_kernel.hpp
+9-12Lines changed: 9 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -41,11 +41,10 @@ class device_kernel_q_linear {
41
41
42
42
/**
43
43
* @brief Function call operator overload performing the actual calculation.
44
-
* @param[in] item the [`sycl::item`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:item.class)
45
-
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
44
+
* @param[in] index the [`sycl::id`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#id-class)
45
+
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
46
46
*/
47
-
voidoperator()(::sycl::nd_item<1> item) const {
48
-
const kernel_index_type index = item.get_global_linear_id();
47
+
voidoperator()(::sycl::id<1> index) const {
49
48
real_type temp{ 0.0 };
50
49
for (kernel_index_type i = 0; i < feature_range_; ++i) {
* @brief Function call operator overload performing the actual calculation.
91
-
* @param[in] item the [`sycl::item`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:item.class)
92
-
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
90
+
* @param[in] index the [`sycl::id`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#id-class)
91
+
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
93
92
*/
94
-
voidoperator()(::sycl::nd_item<1> item) const {
95
-
const kernel_index_type index = item.get_global_linear_id();
93
+
voidoperator()(::sycl::id<1> index) const {
96
94
real_type temp{ 0.0 };
97
95
for (kernel_index_type i = 0; i < num_cols_; ++i) {
@@ -136,11 +134,10 @@ class device_kernel_q_radial {
136
134
137
135
/**
138
136
* @brief Function call operator overload performing the actual calculation.
139
-
* @param[in] item the [`sycl::item`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:item.class)
140
-
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
137
+
* @param[in] index the [`sycl::id`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#id-class)
138
+
* identifying an instance of the functor executing at each point in a [`sycl::range`](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class)
141
139
*/
142
-
voidoperator()(::sycl::nd_item<1> item) const {
143
-
const kernel_index_type index = item.get_global_linear_id();
140
+
voidoperator()(::sycl::id<1> index) const {
144
141
real_type temp{ 0.0 };
145
142
for (kernel_index_type i = 0; i < num_cols_; ++i) {
0 commit comments