which function can replace the deprecated function thrust::detail::backend::dereference In thrust 1.7

StackOverflow https://stackoverflow.com/questions/20277104

  •  06-08-2022
  •  | 
  •  

문제

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;

다른 팁

Probably the simplest solution is to download the version of Thrust you need from GitHub and compile directly.

Using Thrust's internal functions is not a good idea. The API shouldn't change without good reason, but the internals could change at any time.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top