Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][Doc] Add kernel_function lambda wrapper #17633

Open
wants to merge 6 commits into
base: sycl
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -387,20 +387,44 @@ struct kernel_function {

// Available only if Function is invocable with Args
template <typename... Args>
void operator()(Args... args) const {
f(std::forward<Args>(args)...);
}
void operator()(Args... args) const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void operator()(Args... args) const;
void operator()(Args&& ...args) const;

is still needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same as the other suggestion? I'm a bit confused by how GitHub is rendering this.


auto get(syclx::properties_tag) {
return Properties{};
}
// Available only if Properties contains no run-time properties
static constexpr auto get(syclx::properties_tag) const;

private:
const Function f; // exposition only
// Available only if Properties contains at least one run-time property
auto get(syclx::properties_tag) const;

} // namespace sycl::ext::oneapi::experimental
```

---

```c++
template <typename... Args>
void operator()(Args... args) const;
```

_Constraints_: `Function` is invocable with `Args`.

_Effects_: Invokes `Function` with `Args`.

---

```c++
static constexpr auto get(syclx::properties_tag) const; (1)

auto get(syclx::properties_tag) const; (2)
```

_Constraints_ (1): `Properties` contains no run-time properties.

_Constraints_ (2): `Properties` contains at least one run-time property.

_Returns_: The property list associated with this kernel function.

---

The example below shows how the `KernelFunctor` example from the previous
section can be written using this wrapper:

Expand Down