Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Incorrect example for permutation iterator. #1660

Closed
trivialfis opened this issue Apr 14, 2022 · 1 comment
Closed

Incorrect example for permutation iterator. #1660

trivialfis opened this issue Apr 14, 2022 · 1 comment
Assignees
Labels
only: docs Documentation changes only. Doesn't need code CI. P1: should have Necessary, but not critical.
Milestone

Comments

@trivialfis
Copy link

trivialfis commented Apr 14, 2022

https://nvidia.github.io/thrust/api/classes/classthrust_1_1permutation__iterator.html#class-thrustpermutation_iterator

#include <thrust/iterator/permutation_iterator.h>
#include <thrust/device_vector.h>
...
thrust::device_vector<float> values(4);
values[0] = 10.0f;
values[1] = 20.0f;
values[2] = 30.0f;
values[3] = 40.0f;
values[4] = 50.0f;
values[5] = 60.0f;
values[6] = 70.0f;
values[7] = 80.0f;

I think the correct size should be 8 instead of 4.

@alliepiper alliepiper self-assigned this Apr 15, 2022
@alliepiper alliepiper added only: docs Documentation changes only. Doesn't need code CI. P1: should have Necessary, but not critical. labels Apr 15, 2022
@alliepiper alliepiper added this to the 1.17.0 milestone Apr 15, 2022
@alliepiper
Copy link
Collaborator

You are correct, the vector size is definitely incorrect here. Will fix in a moment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
only: docs Documentation changes only. Doesn't need code CI. P1: should have Necessary, but not critical.
Projects
None yet
Development

No branches or pull requests

2 participants