I'm a newbie to CUDA and thrust, I downloaded a GPU BVH building code from google code. But the code is written under older version of CUDA and thrust. Now, I'm using the latest CUDA 5.5 with thrust 1.7. It seems that the derefrence function has been deprecated, so I wonder how can I rewrite the following code in the latest CUDA and thrust
typename std::iterator_traits<Output_iterator>::value_type value = def_value;
for (uint32 i = begin; i < end; ++i)
value = op( value, thrust::detail::backend::dereference( in_values + i ) );
thrust::detail::backend::dereference( out_values, leaf_id ) = value;
Thanks in advance!
You should be able to just dereference the iterators directly with a more recent version of Thrust:
typename std::iterator_traits<Output_iterator>::value_type value = def_value;
for (uint32 i = begin; i < end; ++i)
value = op( value, in_values[i] );
out_values[leaf_id] = value;