-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
[QST] Plan on interoperability with thrust and libcu++. #259
Comments
@ZhenshengLee - Remember the scope of this repository is to simply wrap the CUDA (runtime and other) APIs - not to provide other functionality or higher-level abstractions.
Personally I am underwhelmed by thrust's choice of abstractions. It's somewhat anti-modular and non-cooperative with other libraries. (Caveat: Haven't given it a thorough look in a couple of years.)
Well, it's not trivial to use thrust with the CUDA Runtime API (and other APIs like the driver API etc.), and for the same reason it is somewhat difficult to use it with my API wrappers... but no more difficult. That is, whatever you were doing with thrust + CUDA APIs, you can now do at least as easily with my wrappers. I would also advise you to consider carefully whether you are not paying a significant performance price by using thrust. In some case, you are likely to be. ... with all that being said, however - if there is a concrete suggestion which you believe would help use these wrappers with thrust, I will definitely consider it. |
Thanks for your quick reply. Is there any performance decreasement report with thrust comparing to cuda runtime api? I have googled it but could not find any info. I think the performance price you mentioned is just like using STL in c++, which could be benificial for building large and complicated software in a safer/easier way. I will have a try to intergrate this wrapper into a larger cuda project. Edit: I think this is a objectively comment on thrust, see stackover flow on thrust |
The two can't be compared... thrust offers a lot of concrete functionality. Some of it is just fine and (probably) optimal, some of it has overheads. My API wrappers don't offer any concrete functionality - just a different way of using CUDA's APIs. So it's the difference between writing your own kernels with your own data structures vs. using thrust.
Not quite. For example, with the STL, you don't have to use
Depends on which part of the STL. The type traits, utility classes etc. - sure. But if you use Not to mention how taking some of the STL prevents you from taking the rest: Its data structures are not friendly with std::optional and std::expected, since they were designed much earlier. |
Also, you might be interested in taking a look at my cuda-kat repository, which offers some tools for kernel authors that you can pick-and-choose from, and aren't opinionated about how you write your kernels. Anyway, for now, closing the issue. |
May be you are right, and I am facing thrust issues of merge sort function. See this issue if interested neka-nat/cupoch#62 Thanks. |
First I'd like to say that's a great job.
This repo is a api wrapper with modern cpp style. And modern cpp is about not only classes, namespaces, but also containers and STL algorithms, even with OS resource management.
Thrust by NVIDIA has provided abstractions of resource management and some stl algorithms in modern cpp way, so how can we developers make the best use of both of this repo and thrust, in an maintained repo, for example, like cupoch.
Thanks.
The text was updated successfully, but these errors were encountered: