NVIDIA / cccl

CUDA Core Compute Libraries
https://nvidia.github.io/cccl/
Other
1.3k stars 164 forks source link

[DOC]: `thrust::stable_sort` docs are wrong #2747

Open gonidelis opened 2 weeks ago

gonidelis commented 2 weeks ago

Is this a duplicate?

Is this for new documentation, or an update to existing docs?

Update

Describe the incorrect/future/missing documentation

In the documentation page of overloads of thrust::stable_sort we are showing an example where thrust::sort is being used instead of thrust::stable_sort.

here:

https://github.com/NVIDIA/cccl/blob/deb90107357dd90ba10115dfd6cd8bf2831fce78/thrust/thrust/sort.h#L349 https://github.com/NVIDIA/cccl/blob/deb90107357dd90ba10115dfd6cd8bf2831fce78/thrust/thrust/sort.h#L398

While at it, I think I'll take the liberty to also change the examples as to showcase the stability too (e.g. sort pairs (0,'x), (2,'y'), (2,'z') so that elements are identifiable).

If this is a correction, please provide a link to the incorrect documentation. If this is a new documentation request, please link to where you have looked.

https://nvidia.github.io/cccl/thrust/api/function_group__sorting_1ga2e7ee14dd2878ad63ec1d6156a44e1a1.html https://nvidia.github.io/cccl/thrust/api/function_group__sorting_1ga77581e28069f26d1c21fc6c3f9d35b25.html

gonidelis commented 2 weeks ago

Also, do we plan on using literalincludes (CUB style) for our examples at some point? None of our thrust examples currently does.

bernhardmgruber commented 1 week ago

We definitely should test our documentation examples as part of the unit tests as well! Even though Thrust does not use Catch2 or C2H at the moment, we can already add API tests using Thrust's unit test framework. Feel free to go ahead and add the first one! :)

gonidelis commented 1 week ago

Just to make it clear, you suggest that we duplicate (not include) the code that is in the doxygen section as an example, within the thrust test files to see if it works?

bernhardmgruber commented 1 week ago

Sorry for the confusion: No, we should not duplicate the examples from the doxygen sections. Cut and paste them into new unit tests and literalinclude them.