M
M
Mors Superberg2017-12-19 18:37:38
GPGPU
Mors Superberg, 2017-12-19 18:37:38

How to work with an image in OpenCl?

Ku! I have a question, how can I work with an image multithreaded using OpenCl? To optimize the project, we decided to transfer the calculations to gpu. I have an img.png file in my directory, for example: /home/program/, how can I get the color of the pixels using OpenCl in (r,g,b) and multi-thread add all the blue values? I will be glad if you help with a link to examples, preferably Russian-speaking, or code.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Skusnov, 2017-12-20
@AlexSku

MatLab has matrix addition (without video processor). But it is also possible on a video processor using CUDA.

M
mayton2019, 2020-05-06
@mayton2019

This example of reading png is a bad one.
The matter is that png decoding is not parallelized. It will be executed on 1 processor core. And it will take 80% of the time. I think so. And the already decorated RGB matrix - yes, you can process it on Opencl by breaking the picture into lines or frames. But the benefits of opencl will be lost. After all, we have already stood for the lion's share of the time waiting for decoding.

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question