Hi everybody. I’m writing some kind of library to help people who don’t know CUDA programming to use its features. Particularly, I’m translating STL most common algorithms in a parallel version. I’d like to hide completely .cu files so a user can write parallel code with no knowledge of implementation details. Now I’m facing an apparently insuperable obstacle: functors. I’d like to give the user the opportunity to write a brand new functor in his .cpp code and pass it to a parallelized STL algorithm (for instance, a for_each_parallel or a generate_parallel) that should invoke some kernels using a “deviced” version of the user-defined functor. Translation of algorithms without any functor is simple, but I really don’t know how to translate .cpp code (with restrictions, of course) in .cu code using only libraries. Any idea? Thank you to everybody.
Biagio