KhronosGroup / KhronosGroup/OpenCL-Docs

l_khr_extended_async_copies cannot deal with arbitary strides.

Open
#862 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
420
Forks
131
Avg merge
5d 13h
Merged PRs (30d)
11

Description

Both async_work_group_copy_2D2D and async_work_group_copy_3D3D measure both num_elements_per_line and [src/dst]_total_line_length in terms of element.

This means the data length and the strides when measured in bytes must be a multiple of the num_bytes_per_element.

For the data length this natural and it is difficult to see how it could not be true. But for stride it can easily be true.

Take for example an element size of 3, that needs to be aligned on 8 byte boundaries. If the data length is 3 (9 bytes) then a stride of 16 (16 - 9 = 7) cannot be expressed in elements. One would need to make the stride 24 (24 - 9 = 15) = 5 elements.

So it can be expressed - wastefully - but often the input data is already on a stride.

The net effect if the people just convert everything into bytes, think in bytes (even for the power of 2 cases).

Stride would much more naturally be expressed in bytes - it is simple the distance between row starts.

Everything relating to line length must apply to plane area as well.

Contributor guide

Open the contributing guide

Research direction

Start with the definitions of async_work_group_copy_2D2D and async_work_group_copy_3D3D in the l_khr_extended_async_copies documentation. Compare the element-based line and plane measurements with the issue’s byte-stride example; done means the specification supports arbitrary byte strides and applies the same interpretation to plane area.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.