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

OpenCL implementation of IsEqual() function #451

Closed
ihhub opened this issue May 13, 2019 · 5 comments · Fixed by #562
Closed

OpenCL implementation of IsEqual() function #451

ihhub opened this issue May 13, 2019 · 5 comments · Fixed by #562

Comments

@ihhub
Copy link
Owner

@ihhub ihhub commented May 13, 2019

We have CPU implementation of IsEqual() function in src/image_function.h and src/image_function.cpp files. We want to add OpenCL implementation of the same function. Please put new code in src/opencl/image_function_opencl.h and src/opencl/image_function_opencl.cpp files. Things which we need to do:

  1. Copy 2 function declarations from src/image_function.h to src/opencl/image_function_opencl.h
  2. Copy first function implementation from src/image_function.cpp to src/opencl/image_function_opencl.cpp
  3. Add OpenCL kernel called isEqualOpenCL into unnamed namespace at the top of src/opencl/image_function_opencl.cpp file
  4. Add second function implementation by following Invert() code logic
@ihhub ihhub added this to the Release milestone May 13, 2019
@ihhub ihhub added the gpu label May 16, 2019
@manekenpix

This comment has been minimized.

Copy link
Contributor

@manekenpix manekenpix commented Sep 28, 2019

I'll take this one if that's ok.

@ihhub ihhub added the Hacktoberfest label Sep 28, 2019
@ihhub

This comment has been minimized.

Copy link
Owner Author

@ihhub ihhub commented Sep 28, 2019

@manekenpix sure! Please do not hesitate to ask any questions if you have any.

@manekenpix

This comment has been minimized.

Copy link
Contributor

@manekenpix manekenpix commented Oct 9, 2019

@ihhub sorry for the late response, I got caught up with some stuff, but I'm now working on this issue.

I have a question about step 3:

This is my first time working with OpenCL. I read about it here and I think I understand how OpenCL kernels do parallel computing. I assume isEqual will use an OpenCL kernel to perform a parallel comparison between 2 images, and I was wondering about the standard way in OpenCL to return a value to the function calling the kernel since kernels return void and the parameters passed to them are usually information about the images themselves (StartXIn, Offset, Width, Height...).
I was thiking about passing a variable to the kernel that would store a specific value if the comparison fails and then return false in the caller, but I'm not sure if that can be done with kernels.

Any guidance would be very appreciated.

@ihhub

This comment has been minimized.

Copy link
Owner Author

@ihhub ihhub commented Oct 9, 2019

I think the answer for your questions lies here :)

@manekenpix

This comment has been minimized.

Copy link
Contributor

@manekenpix manekenpix commented Oct 10, 2019

Thank you! This is perfect.

@ihhub ihhub closed this in #562 Oct 19, 2019
ihhub added a commit that referenced this issue Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.