Hi guys
I’m currently developping code in the field of image processing.
Within my code i manipulate my images as float*, ie for a given MxN image, i store it in a 1D array of MxN floats.
What i would like to do is finding a clean way to perform operations such as elementwise addition for example.
To be more precise, let’s say we have 3 images A,B and C. For now , if i want to calculate the elementwise sum of those three images and store it in another image named ‘Result’, i call three times a function :
elementwiseAddition_kernel(Result, image2Add, M, N);
with image2Add in {A,B,C}.
Of course it works but for more complicated operations, it can be really ugly and long. Of course i could also code a function doing all that in one shot but again that wouldn’t be ‘optimal’. Eventually, it would be really nice to re-define the ‘+’ operator for objects of type float* like in C++ when defining a class and then write
Result = A + B + C;
Though according to what i saw on the net, it doesn’t seem possible here with device variables…
Has anyone managed to find a more elegant way to do so? or leading ideas on how to come closer to a approximated solution?
Thanks in advance and have a good day