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

Compiler warning with counting_iterator in MSVC #1091

Closed
mfrancis95 opened this issue Apr 4, 2020 · 0 comments · Fixed by #1359
Closed

Compiler warning with counting_iterator in MSVC #1091

mfrancis95 opened this issue Apr 4, 2020 · 0 comments · Fixed by #1359
Assignees
Milestone

Comments

@mfrancis95
Copy link
Contributor

mfrancis95 commented Apr 4, 2020

My code:
thrust::counting_iterator<unsigned> countingIterator(0);

The warning:

note: see reference to class template instantiation 'thrust::counting_iterator<unsigned int,thrust::use_default,thrust::use_default,thrust::use_default>' being compiled

And here's a deeper trace of it:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include\thrust/iterator/iterator_adaptor.h(204): warning C4244: '+=': conversion from '__int64' to 'Base', possible loss of data
1>        with
1>        [
1>            Base=unsigned int
1>        ]
1>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include\thrust/iterator/iterator_adaptor.h(202): note: while compiling class template member function 'void thrust::iterator_adaptor<thrust::counting_iterator<unsigned int,thrust::use_default,thrust::use_default,thrust::use_default>,Incrementable,Incrementable,thrust::any_system_tag,thrust::random_access_traversal_tag,Incrementable,__int64>::advance(__int64)'
1>        with
1>        [
1>            Incrementable=unsigned int
1>        ]
1>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include\thrust/iterator/iterator_facade.h(171): note: see reference to function template instantiation 'void thrust::iterator_adaptor<thrust::counting_iterator<unsigned int,thrust::use_default,thrust::use_default,thrust::use_default>,Incrementable,Incrementable,thrust::any_system_tag,thrust::random_access_traversal_tag,Incrementable,__int64>::advance(__int64)' being compiled
1>        with
1>        [
1>            Incrementable=unsigned int
1>        ]
1>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include\thrust/iterator/counting_iterator.h(132): note: see reference to class template instantiation 'thrust::iterator_adaptor<thrust::counting_iterator<unsigned int,thrust::use_default,thrust::use_default,thrust::use_default>,Incrementable,Incrementable,thrust::any_system_tag,thrust::random_access_traversal_tag,Incrementable,__int64>' being compiled
1>        with
1>        [
1>            Incrementable=unsigned int
1>        ]
@mfrancis95 mfrancis95 changed the title Compiler warning with counting_iterator Compiler warning with counting_iterator in MSVC May 26, 2020
@alliepiper alliepiper added this to the 1.11.1 milestone Sep 21, 2020
@alliepiper alliepiper self-assigned this Jan 26, 2021
@alliepiper alliepiper linked a pull request Jan 26, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants