Skip to content

Commit 4629ba8

Browse files
authored
Enqueueing a Kernel: add const qualifier (#379)
SYCL 2020 spec section 4.12.1 requires the operator() in a kernel function object to be const-qualified.
1 parent 3d5db69 commit 4629ba8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Binary file not shown.

Lesson_Materials/Enqueueing_a_Kernel/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@
374374
<div class="col">
375375
<code><pre>
376376
struct my_kernel {
377-
void operator()(){
377+
void operator()() const {
378378
/* kernel function */
379379
}
380380
};
@@ -383,6 +383,7 @@
383383
<div class="col" data-markdown>
384384
* As well as defining SYCL kernels using lambda expressions,
385385
You can also define a SYCL kernel using a regular C++ function object.
386+
* Define a type with a public const-qualified `operator()` member function.
386387
</div>
387388
</div>
388389
</section>
@@ -395,7 +396,7 @@
395396
<div class="col">
396397
<code><pre>
397398
struct my_kernel {
398-
void operator()(){
399+
void operator()() const {
399400
/* kernel function */
400401
}
401402
};

0 commit comments

Comments
 (0)