boostorg / boostorg/compute

Sorting subset of buffer

Open
#784 6 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
1.7k
Forks
340
PR merge metrics
No merged PRs in 30d

Description

Not sure of a mailing list so I hope posting a use question here is appropriate. I have been able to use `boost::compute::sort` successfully on a general OpenCL buffer. However, I am often dealing with 'padded' buffers that are interpreted as matrices (row-wise storage). For example, the matrix

```
8 2 7
6 5 4
1 3 9
```

Is actually stored as

```
8 2 7 0 0 0
6 5 4 0 0 0
1 3 9 0 0 0
```

So the internal flat buffer would be

```
8 2 7 0 0 0 6 5 4 0 0 0 1 3 9 0 0 0
```

How could I use `sort` on just the 'non-padded' elements?

Likewise, the column wise may also be padded (less common but might as well include here)

```
8 2 7 0 0 0
6 5 4 0 0 0
1 3 9 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.