@@ -82,9 +82,9 @@ namespace syclcompat {
82
82
class dim3 {
83
83
public:
84
84
const size_t x, y, z;
85
- constexpr dim3(const sycl::range<3> &r);
86
- constexpr dim3(const sycl::range<2> &r);
87
- constexpr dim3(const sycl::range<1> &r);
85
+ dim3(const sycl::range<3> &r);
86
+ dim3(const sycl::range<2> &r);
87
+ dim3(const sycl::range<1> &r);
88
88
constexpr dim3(size_t x, size_t y = 1, size_t z = 1);
89
89
90
90
constexpr size_t size();
@@ -95,9 +95,9 @@ public:
95
95
};
96
96
97
97
// Element-wise operators
98
- dim3 operator* (const dim3 &a, const dim3 &b);
99
- dim3 operator+(const dim3 &a, const dim3 &b);
100
- dim3 operator-(const dim3 &a, const dim3 &b);
98
+ inline dim3 operator* (const dim3 &a, const dim3 &b);
99
+ inline dim3 operator+(const dim3 &a, const dim3 &b);
100
+ inline dim3 operator-(const dim3 &a, const dim3 &b);
101
101
102
102
} // syclcompat
103
103
```
@@ -113,39 +113,39 @@ addition to the global range, the following helper functions are also provided:
113
113
namespace syclcompat {
114
114
115
115
namespace local_id {
116
- size_t x();
117
- size_t y();
118
- size_t z();
116
+ inline size_t x();
117
+ inline size_t y();
118
+ inline size_t z();
119
119
} // namespace local_id
120
120
121
121
namespace local_range {
122
- size_t x();
123
- size_t y();
124
- size_t z();
122
+ inline size_t x();
123
+ inline size_t y();
124
+ inline size_t z();
125
125
} // namespace local_range
126
126
127
127
namespace work_group_id {
128
- size_t x();
129
- size_t y();
130
- size_t z();
128
+ inline size_t x();
129
+ inline size_t y();
130
+ inline size_t z();
131
131
} // namespace work_group_id
132
132
133
133
namespace work_group_range {
134
- size_t x();
135
- size_t y();
136
- size_t z();
134
+ inline size_t x();
135
+ inline size_t y();
136
+ inline size_t z();
137
137
} // namespace work_group_range
138
138
139
139
namespace global_range {
140
- size_t x();
141
- size_t y();
142
- size_t z();
140
+ inline size_t x();
141
+ inline size_t y();
142
+ inline size_t z();
143
143
} // namespace global_range
144
144
145
145
namespace global_id {
146
- size_t x();
147
- size_t y();
148
- size_t z();
146
+ inline size_t x();
147
+ inline size_t y();
148
+ inline size_t z();
149
149
} // namespace global_id
150
150
151
151
} // syclcompat
@@ -308,12 +308,13 @@ group size in each dimension.
308
308
```c++
309
309
namespace syclcompat {
310
310
311
- void wg_barrier();
311
+ inline void wg_barrier();
312
312
313
313
template <int Dim>
314
- sycl::nd_range<Dim> compute_nd_range(sycl::range<Dim> global_size_in,
315
- sycl::range<Dim> work_group_size);
316
- sycl::nd_range<1> compute_nd_range(int global_size_in, int work_group_size);
314
+ inline sycl::nd_range<Dim> compute_nd_range(sycl::range<Dim> global_size_in,
315
+ sycl::range<Dim> work_group_size);
316
+ inline sycl::nd_range<1> compute_nd_range(int global_size_in,
317
+ int work_group_size);
317
318
318
319
} // syclcompat
319
320
```
@@ -330,8 +331,8 @@ out-of-order queue, either created manually or retrieved via a call to
330
331
``` c++
331
332
namespace syclcompat {
332
333
333
- sycl::queue create_queue(bool print_on_async_exceptions = false,
334
- bool in_order = true);
334
+ inline sycl::queue create_queue(bool print_on_async_exceptions = false,
335
+ bool in_order = true);
335
336
336
337
} // syclcompat
337
338
```
@@ -739,46 +740,46 @@ follows:
739
740
namespace syclcompat {
740
741
741
742
// Util function to create a new queue for the current device
742
- sycl::queue create_queue(bool print_on_async_exceptions = false,
743
- bool in_order = true);
743
+ static inline sycl::queue create_queue(bool print_on_async_exceptions = false,
744
+ bool in_order = true);
744
745
745
746
// Util function to get the default queue of current device in
746
747
// device manager.
747
- sycl::queue get_default_queue();
748
+ static inline sycl::queue get_default_queue();
748
749
749
750
// Util function to set the default queue of the current device in the
750
751
// device manager.
751
752
// If the device extension saved queue is the default queue,
752
753
// the previous saved queue will be overwritten as well.
753
754
// This function will be blocking if there are submitted kernels in the
754
755
// previous default queue.
755
- void set_default_queue(const sycl::queue &q);
756
+ static inline void set_default_queue(const sycl::queue &q);
756
757
757
758
// Util function to wait for the queued kernels.
758
- void wait(sycl::queue q = get_default_queue());
759
+ static inline void wait(sycl::queue q = get_default_queue());
759
760
760
761
// Util function to wait for the queued kernels and throw unhandled errors.
761
- void wait_and_throw(sycl::queue q = get_default_queue());
762
+ static inline void wait_and_throw(sycl::queue q = get_default_queue());
762
763
763
764
// Util function to get the id of current device in
764
765
// device manager.
765
- unsigned int get_current_device_id();
766
+ static inline unsigned int get_current_device_id();
766
767
767
768
// Util function to get the current device.
768
- device_ext &get_current_device();
769
+ static inline device_ext &get_current_device();
769
770
770
771
// Util function to get a device by id.
771
- device_ext &get_device(unsigned int id);
772
+ static inline device_ext &get_device(unsigned int id);
772
773
773
774
// Util function to get the context of the default queue of current
774
775
// device in device manager.
775
- sycl::context get_default_context();
776
+ static inline sycl::context get_default_context();
776
777
777
778
// Util function to get a CPU device.
778
- device_ext &cpu_device();
779
+ static inline device_ext &cpu_device();
779
780
780
781
// Util function to select a device by its id
781
- unsigned int select_device(unsigned int id);
782
+ static inline unsigned int select_device(unsigned int id);
782
783
783
784
} // syclcompat
784
785
```
0 commit comments