Build error: no template named 'texture_cache_iterator'
Closed this issue · 2 comments
When I build a cuda program using cub and PRIM, I have the problem:
In file included from ../src/acc/hip/hip_utils_cub.hpp:32:
In file included from /opt/rocm/rocPRIM/include/hipcub/hipcub.hpp:34:
In file included from /opt/rocm/rocPRIM/include/hipcub/rocprim/../rocprim/hipcub.hpp:33:
/opt/rocm/rocPRIM/include/hipcub/rocprim/iterator/tex_obj_input_iterator.hpp:32:40: error: no template named 'texture_cache_iterator'
in namespace 'rocprim'
using TexObjInputIterator = ::rocprim::texture_cache_iterator<T, OffsetT>;
~~~~~~~~~~~^
and the included file [ hip_utils_cub.hpp ]is as fllows :(add line number)
22 #include <rocprim/rocprim.hpp>
23 #include <rocprim/rocprim_hip.hpp>
24
25 #include <rocprim/device/device_radix_sort_hip.hpp>
26 #include <rocprim/device/device_reduce_hip.hpp>
27 #include <rocprim/device/device_scan_hip.hpp>
28 #include <rocprim/device/device_select_hip.hpp>
29
30
31 #include <hipcub/rocprim/util_type.hpp>
32 #include <hipcub/hipcub.hpp> // error line
I think I know hat is happening here:
22 includes rocprim/rocprim.hpp
which detects the current rocPRIM API, HC or HIP, and HC is default unless ROCPRIM_HIP_API
is set: https://github.com/ROCmSoftwarePlatform/rocPRIM/blob/master/rocprim/include/rocprim/config.hpp#L30
(This actually contradicts https://github.com/ROCmSoftwarePlatform/rocPRIM#using-rocprims-hc-and-hip-apis , I need to fix either docs or config.hpp)
Then you for some reason include rocprim/rocprim_hip.hpp
which is supposed to set API to HIP if it is not defined (but as we know it is defined by rocprim/rocprim.hpp
).
So, in your case remove all includes except #include <hipcub/hipcub.hpp>
.
It will detect HIP platform: NVCC or HCC, on HCC it will include rocprim/rocprim_hip.hpp
.
I will fix either docs or config.hpp.
Yes, it solve my problem. Thank you very much.