NVIDIA / NVIDIA/cccl

generalize get_iterator_value() to respect execution policy

Open
#701 8 comments 0 reactions 1 assignee Claimed by @brycelelbach View on GitHub
thrust
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

Unless it is a raw pointers, get_value_iterator [1] will not respect execution policy when dereferenced via `*it`. A naïve replacement of `*it` with

```
typename thrust::iterator_traits::value_type value;
thrust::copy(exec, it,it+1, &value);
return value;
```

makes the reproducer in https://github.com/thrust/thrust/issues/780 to die with

```
terminate called after throwing an instance of 'thrust::system::system_error'
what(): an illegal memory access was encountered
Aborted (core dumped)
```

[1] https://github.com/thrust/thrust/blob/master/thrust/detail/get_iterator_value.h#L29

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.