thread_operators.hpp misses include of "../util_type.hpp"
Closed this issue · 8 comments
WIthout said include, KeyValuePair is not defined and PyTorch compilation crashes.
How do you include hipCUB headers? I hope not hipcub/rocprim/thread/thread_operators.hpp
?
The valid way is to include the main header only:
#include <hipcub/hipcub.hpp>
(I guess this should be added to README)
The reason is to support both CUB and rocPRIM, otherwise the user would need to deal with paths.
Please add this to README. Also where should one define the HIPCUB_ARCH=1. Is that auto detected by compiler?
Nowhere.
If you include the main header, this definition will be set:
https://github.com/ROCmSoftwarePlatform/hipCUB/blob/b45cc0ccac683208457b14b1776c929e33cfae64/hipcub/include/hipcub/cub/hipcub.hpp#L36
https://github.com/ROCmSoftwarePlatform/hipCUB/blob/b6ce7dbe9c376b869642203c42d17a0eed975971/hipcub/include/hipcub/rocprim/util_ptx.hpp#L39
This needs to be in the documentation.
Ah, I remember that the notice about the main header was somewhere.
It's here:
https://github.com/ROCmSoftwarePlatform/hipCUB/blob/master/doc/mainpage.dox#L16
I'll add this info to README.
However, a comment from the users:
PyTorch is including certain cub headers directly (device_scan, device_reduce, block_reduce, …) – we expect hipCUB to be compatible to that use case.
We can't do this, because hipCUB is supposed to support two backends.