Skip to content

Commit f786219

Browse files
Andrew Savonichevvladimirlaz
Andrew Savonichev
authored andcommitted
Reword functor -> function object
Signed-off-by: Andrew Savonichev <[email protected]>
1 parent 9877623 commit f786219

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

clang/include/clang/Basic/AttrDocs.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,12 +1841,12 @@ def SYCLIntelKernelArgsRestrictDocs : Documentation {
18411841
let Content = [{
18421842
The attribute ``intel::kernel_args_restrict`` is legal on device functions, and
18431843
can be ignored on non-device functions. When applied to a function, lambda, or
1844-
function call operator (of a functor), the attribute is a hint to the compiler
1845-
equivalent to specifying the C99 restrict attribute on all pointer arguments or
1846-
the pointer member of any accessors, which are a function argument, lambda
1847-
capture, or functor member, of the callable to which the attribute was
1848-
applied. This effect is equivalent to annotating restrict on **all** kernel
1849-
pointer arguments in an OpenCL or SPIR-V kernel.
1844+
function call operator (of a function object), the attribute is a hint to the
1845+
compiler equivalent to specifying the C99 restrict attribute on all pointer
1846+
arguments or the pointer member of any accessors, which are a function argument,
1847+
lambda capture, or function object member, of the callable to which the
1848+
attribute was applied. This effect is equivalent to annotating restrict on
1849+
**all** kernel pointer arguments in an OpenCL or SPIR-V kernel.
18501850

18511851
If ``intel::kernel_args_restrict`` is applied to a function called from a device
18521852
kernel, the attribute is ignored and it is not propagated to a kernel.

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ class MarkDeviceFunction : public RecursiveASTVisitor<MarkDeviceFunction> {
428428
else if (auto *A = FD->getAttr<ReqdWorkGroupSizeAttr>())
429429
Attrs.insert(A);
430430
else if (auto *A = FD->getAttr<SYCLIntelKernelArgsRestrictAttr>()) {
431-
// Allow the intel::kernel_args_restrict only on the lambda (functor
431+
// Allow the intel::kernel_args_restrict only on the lambda (function
432432
// object) function, that is called directly from a kernel (i.e. the one
433433
// passed to the parallel_for function). Emit a warning and ignore all
434434
// other cases.

clang/test/SemaSYCL/intel-restrict.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
void func_ignore() {}
66

77

8-
struct Functor {
8+
struct FuncObj {
99
[[intel::kernel_args_restrict]]
1010
void operator()() {}
1111
};
@@ -19,7 +19,7 @@ int main() {
1919
// CHECK-LABEL: FunctionDecl {{.*}} _ZTSZ4mainE12test_kernel1
2020
// CHECK: SYCLIntelKernelArgsRestrictAttr
2121
kernel<class test_kernel1>(
22-
Functor());
22+
FuncObj());
2323

2424
// CHECK-LABEL: FunctionDecl {{.*}} _ZTSZ4mainE12test_kernel2
2525
// CHECK: SYCLIntelKernelArgsRestrictAttr

0 commit comments

Comments
 (0)