KhronosGroup / KhronosGroup/SYCL-Docs

The term "kernel" is used for multiple purposes

Open
#603 4 comments 2 reactions 1 assignee Claimed by @tahonermann View on GitHub
clarification
Dominant language
JavaScript
Stars
158
Forks
80
Avg merge
7d 6h
Merged PRs (30d)
5

Description

Consider this text from [SYCL 2020 section 4.12.4, "Rules for parameter passing to kernels"](https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:kernel.parameter.passing)

> A SYCL application passes parameters to a kernel in different ways depending on whether the kernel is a named function object or a lambda function. If the kernel is a named function object, the `operator()` member function (or other member functions that it calls) may reference member variables inside the same named function object. Any such member variables become parameters to the kernel. If the kernel is a lambda function, any variables captured by the lambda become parameters to the kernel.

The text is actually nonsensical as written. How can member variables (more precisely, non-static data members) of the kernel become parameters to the kernel?

Some uses of the term "kernel" refer to the named function object or lambda function (more precisely, closure object) that is passed to a kernel invocation function. Others appear to refer to something else; presumably an implementation dependent device entry point function; something the SYCL specification shouldn't have to concern itself with. Note that the term "entry point" appears exactly one time in the SYCL 2020 specification; in the definition of "SYCL kernel function" in the [glossary](https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#glossary).

> SYCL kernel function
> > A type which is callable with `operator()` that takes an id, item, nd-item or work-group, and an optional `kernel_handler` as its last parameter. This type can be passed to kernel enqueue member functions of the command group handler. A SYCL kernel function defines an entry point to a kernel. The function object can be a named device copyable type or lambda function.

This description conflates types and objects.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.