Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Fix get_local_linear_id
Browse files Browse the repository at this point in the history
Change-Id: I100415c2e5e38ca39c4a491ecfded68f599e9b52
(cherry picked from commit a52dd03)
  • Loading branch information
b-sumner authored and searlmc1 committed May 2, 2023
1 parent 3465f2e commit 2b9acb0
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions ockl/src/workitem.cl
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,9 @@ get_global_linear_id_z(void)
ATTR static size_t
get_local_linear_id_(void)
{
if (OLD_ABI) {
return (__builtin_amdgcn_workitem_id_z() * __builtin_amdgcn_workgroup_size_y() +
__builtin_amdgcn_workitem_id_y()) * __builtin_amdgcn_workgroup_size_x() +
__builtin_amdgcn_workitem_id_x();
} else {
return (__builtin_amdgcn_workitem_id_z() * IMPLICITARG(ushort)[7] +
__builtin_amdgcn_workitem_id_y()) * IMPLICITARG(ushort)[6] +
__builtin_amdgcn_workitem_id_x();
}
return (__builtin_amdgcn_workitem_id_z() * (uint)get_local_size_y() +
__builtin_amdgcn_workitem_id_y()) * (uint)get_local_size_x() +
__builtin_amdgcn_workitem_id_x();
}

ATTR size_t
Expand Down

0 comments on commit 2b9acb0

Please sign in to comment.