Hey guys,

So I can't help but to bring up this topic :) Is there any reason why we're
using the OpenCL C API instead of the C++ one?
It seems like we could save several thousands of lines of code (and gain a
lot of clarity) by using the C++ API directly. Of course, we would keep the
ocl::device/context/whatever. I see a couple of reasons why we would want
to do that:
-> For now, we have to use VIENNACL_ERR_CHECK(err) after each internal call
to the C API. Since it's cumbersome, i've noticed that there are a lot of
places in the code where we would just ignore some error checking for the
sake of clarity. If we used the C++ API, then we could use the C++
exceptions internally and wouldn't have to bother with all these error
checking.
-> It seems like the list of the ViennaCL exception is not up-to-date. If
we forget to handle a case, then we get ocl::unknown_error, while the error
is properly handled by the OpenCL C++ API.
-> We could save literally thousands of lines of code. I'm ready to bet
that it could relieve the compiler and reduce the compilation times
-> It would be easier to maintain. There is a whole community bugfixing the
cl.hpp file, and we are more likely to have bugs in our C calls rather than
our C++ calls
-> It doesn't add any external dependency.
-> I think that when we need to deal with more complicated things such as
multiple devices, we'll gain in productivity and robustness by using the
C++ API.

On the other hand, I cannot see any functionnality in the C API which isn't
wrapped in the C++ one. It sure would take quite a bit of work, but I'm
ready to handle it myself if there is no objection.

Philippe
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to