Why does thrust use is_pod
to implement has_trivial_destructor
?
#722
Labels
thrust
For all items related to Thrust.
is_pod
to implement has_trivial_destructor
?
#722
Hi all,
In https://github.com/thrust/thrust/blob/324243f6bb70687aeaeb2419193a335648c5869d/thrust/detail/type_traits.h#L177
The trait
has_trivial_destructor
is implemented asis_pod
. But in c++11 there's dedicated function for it calledstd::is_trivially_destructible
: https://en.cppreference.com/w/cpp/types/is_destructible . Being POD is a stricter requirement than being trivially destructible.In my case I expect
thrust::detail::destroy_range
as a no-op when input type is trivially destructible but with a user defined constructor. This way I can have a library (XGBoost) compiled with CUDA and usesthrust::device_vector
, but run on CPU without error as long as I don't call any cuda function in the code path. But with thrust shipped with CUDA 10.1 I got the following error indevice_vector
's destructor:It maybe worth mentioning that data size is 0.
The text was updated successfully, but these errors were encountered: