@@ -169,12 +169,12 @@ class type_erased_cgfo_ty {
169
169
// by a queue. The function object can be a named type, lambda function or
170
170
// std::function.
171
171
template <typename T> struct invoker {
172
- static void call (void *object, handler &cgh) {
173
- (*static_cast <T *>(object))(cgh);
172
+ static void call (const void *object, handler &cgh) {
173
+ (*const_cast <T *>( static_cast <const T *>(object) ))(cgh);
174
174
}
175
175
};
176
- void *object;
177
- using invoker_ty = void (*)(void *, handler &);
176
+ const void *object;
177
+ using invoker_ty = void (*)(const void *, handler &);
178
178
const invoker_ty invoker_f;
179
179
180
180
public:
@@ -183,15 +183,15 @@ class type_erased_cgfo_ty {
183
183
// NOTE: Even if `T` is a pointer to a function, `&f` is a pointer to a
184
184
// pointer to a function and as such can be casted to `void *` (pointer to
185
185
// a function cannot be casted).
186
- : object(static_cast <void *>(&f)), invoker_f(&invoker<T>::call) {}
186
+ : object(static_cast <const void *>(&f)), invoker_f(&invoker<T>::call) {}
187
187
~type_erased_cgfo_ty () = default ;
188
188
189
189
type_erased_cgfo_ty (const type_erased_cgfo_ty &) = delete ;
190
190
type_erased_cgfo_ty (type_erased_cgfo_ty &&) = delete ;
191
191
type_erased_cgfo_ty &operator =(const type_erased_cgfo_ty &) = delete ;
192
192
type_erased_cgfo_ty &operator =(type_erased_cgfo_ty &&) = delete ;
193
193
194
- void operator ()(sycl:: handler &cgh) const { invoker_f (object, cgh); }
194
+ void operator ()(handler &cgh) const { invoker_f (object, cgh); }
195
195
};
196
196
197
197
class kernel_bundle_impl ;
0 commit comments