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

Add blocking view #4

Open
Nemandza82 opened this issue Jun 10, 2021 · 0 comments
Open

Add blocking view #4

Nemandza82 opened this issue Jun 10, 2021 · 0 comments
Assignees

Comments

@Nemandza82
Copy link
Owner

Nemandza82 commented Jun 10, 2021

To support operations which take multiple consecutive elements of input collection and/or generate multiple consecutive elements of output collection, Symd bust have something like blocking view.

Examples of such operations are for instance color conversions. Here is example usage of such view:

    size_t width = 1920;
    size_t height = 1080;
    
    std::vector<float> YUV444(width * height * 3);
    std::vector<float> RGB24_mc(YUV444.size());

    symd::map(symd::views::block_view<3,1>(RGB24_mc), [](auto yuv)
          {
                return yuvToRgbKernel(yuv[1], yuv[0], v[2]);

          }, symd::views::block_view<3,1>(YUV444));

symd::views::block_view<3,1>(YUV444) creates block view of input collection where blocks are of 3x1 size.

Optimal implementation could be achieved by implementing block_view, and overriding all necessary view operations (getWidth, getHeight, getPitch, fetchData, fetchVecData, saveData, saveVecData and more).

Fetch and save methods should fetch and save all elements within block so they are accessible within the kernel.

For this we added failing test:

TEST_CASE("Mapping - blocking input YUV444 to RGB")

Which after correct implementation should pass.

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

No branches or pull requests

2 participants