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

fix: avoid out-of-boundary access by profile_add kernel #100

Merged

Conversation

MaciejBielski
Copy link
Contributor

@MaciejBielski MaciejBielski commented Nov 6, 2024

The kernel uses get_global_id() to index the values_out[] array.
The index is therefore related to "global work-group size" (GWS) and
belongs to [0, GWS).

Adjust the GWS so that the kernel does not reach out-of-boundary while
accessing each element of the array.

  • set the "local work-group size" (LWS) to 1 with set_group_size()
  • adjust the GWS by setting group_count = elems_nb when
    (GWS = LWS * group_count)`

Fix other tests in the same manner.

Signed-off-by: Maciej Bielski maciej.bielski@intel.com

@MaciejBielski MaciejBielski force-pushed the fix-kernel_timestamp_event_tests branch from c6d43cf to b7db2a9 Compare November 6, 2024 16:55
@MaciejBielski MaciejBielski marked this pull request as ready for review November 6, 2024 16:56
@MaciejBielski MaciejBielski marked this pull request as draft November 6, 2024 17:11
The kernel uses `get_global_id()` to index the `values_out[]` array.
The index is therefore related to "global work-group size" (GWS) and
belongs to `[0, GWS)`.

Adjust the GWS so that the kernel does not reach out-of-boundary while
accessing each element of the array.
- set the "local work-group size" (LWS) to 1 with `set_group_size()`
- adjust the GWS by setting `group_count = elems_nb` when
  (`GWS = LWS * group_count`)`

Fix other tests in the same manner.

Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
@MaciejBielski MaciejBielski force-pushed the fix-kernel_timestamp_event_tests branch from b7db2a9 to 8dd4e8a Compare November 6, 2024 19:11
@MaciejBielski MaciejBielski marked this pull request as ready for review November 6, 2024 19:14
@nrspruit nrspruit merged commit 18ecdba into oneapi-src:master Nov 7, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants