Thrust compiling with lots of noise?

I’m not sure if this is new or not but I’ve been using Thrust and not gonna lie, it’s compiling with a lot of noise. Mostly about unused parameters. Has anyone else noticed this as well?

/usr/local/cuda/include/thrust/system/cuda/detail/cub/block/specializations/../../block/../util_type.cuh:127:35: warning: unused parameter ‘b’ [-Wunused-parameter]
     __host__ __device__ __forceinline__ bool operator ==(const NullType& b) { return true; }
                                   ^
/usr/local/cuda/include/thrust/system/cuda/detail/cub/block/specializations/../../block/../util_type.cuh:129:35: warning: unused parameter ‘b’ [-Wunused-parameter]
     __host__ __device__ __forceinline__ bool operator !=(const NullType& b) { return false; }
                                   ^
/usr/local/cuda/include/thrust/system/cuda/detail/cub/block/specializations/../../warp/specializations/../../util_debug.cuh:68:49: warning: unused parameter ‘filename’ [-Wunused-parameter]
 __host__ __device__ __forceinline__ cudaError_t Debug(
                                                 ^
/usr/local/cuda/include/thrust/system/cuda/detail/cub/block/specializations/../../warp/specializations/../../util_debug.cuh:68:49: warning: unused parameter ‘line’ [-Wunused-parameter]
/usr/local/cuda/include/thrust/system/cuda/detail/cub/util_allocator.cuh:259:1: warning: unused parameter ‘skip_cleanup’ [-Wunused-parameter]
     CachingDeviceAllocator(
 ^
/usr/local/cuda/include/thrust/detail/allocator/allocator_traits.inl: In instantiation of ‘typename thrust::detail::disable_if<thrust::detail::allocator_traits_detail::has_member_max_size<Alloc>::value, typename thrust::detail::allocator_traits<Alloc>::size_type>::type thrust::detail::allocator_traits_detail::max_size(const Alloc&) [with Alloc = std::allocator<float3>; typename thrust::detail::disable_if<thrust::detail::allocator_traits_detail::has_member_max_size<Alloc>::value, typename thrust::detail::allocator_traits<Alloc>::size_type>::type = long unsigned int]’:
/usr/local/cuda/include/thrust/detail/allocator/allocator_traits.inl:296:43:   required from ‘static thrust::detail::allocator_traits<Alloc>::size_type thrust::detail::allocator_traits<Alloc>::max_size(const allocator_type&) [with Alloc = std::allocator<float3>; thrust::detail::allocator_traits<Alloc>::size_type = long unsigned int; thrust::detail::allocator_traits<Alloc>::allocator_type = std::allocator<float3>]’
/usr/local/cuda/include/thrust/detail/contiguous_storage.inl:82:42:   required from ‘thrust::detail::contiguous_storage<T, Alloc>::size_type thrust::detail::contiguous_storage<T, Alloc>::max_size() const [with T = float3; Alloc = std::allocator<float3>; thrust::detail::contiguous_storage<T, Alloc>::size_type = long unsigned int]’
/usr/local/cuda/include/thrust/detail/vector_base.inl:272:31:   required from ‘thrust::detail::vector_base<T, Alloc>::size_type thrust::detail::vector_base<T, Alloc>::max_size() const [with T = float3; Alloc = std::allocator<float3>; thrust::detail::vector_base<T, Alloc>::size_type = long unsigned int]’
/usr/local/cuda/include/thrust/detail/vector_base.inl:1063:68:   required from ‘void thrust::detail::vector_base<T, Alloc>::allocate_and_copy(thrust::detail::vector_base<T, Alloc>::size_type, ForwardIterator, ForwardIterator, thrust::detail::vector_base<T, Alloc>::storage_type&) [with ForwardIterator = thrust::detail::normal_iterator<float3*>; T = float3; Alloc = std::allocator<float3>; thrust::detail::vector_base<T, Alloc>::size_type = long unsigned int; thrust::detail::vector_base<T, Alloc>::storage_type = thrust::detail::contiguous_storage<float3, std::allocator<float3> >]’
/usr/local/cuda/include/thrust/detail/vector_base.inl:281:59:   required from ‘void thrust::detail::vector_base<T, Alloc>::reserve(thrust::detail::vector_base<T, Alloc>::size_type) [with T = float3; Alloc = std::allocator<float3>; thrust::detail::vector_base<T, Alloc>::size_type = long unsigned int]’
/home/christian/cuda/regulus/tests/../include/domain.hpp:18:1:   required from ‘thrust::host_vector<typename point_type<T>::type, std::allocator<typename point_type<T>::type> > gen_cartesian_domain(int) [with T = float; typename point_type<T>::type = float3]’
/home/christian/cuda/regulus/tests/domain-tests.cu:30:94:   required from here
/usr/local/cuda/include/thrust/detail/allocator/allocator_traits.inl:181:1: warning: unused parameter ‘a’ [-Wunused-parameter]
     max_size(const Alloc &a)
 ^
/usr/local/cuda/include/thrust/detail/allocator/allocator_traits.inl: In instantiation of ‘typename thrust::detail::disable_if<thrust::detail::allocator_traits_detail::has_member_system<Alloc>::value, typename thrust::detail::allocator_system<Alloc>::type>::type thrust::detail::allocator_traits_detail::system(Alloc&) [with Alloc = std::allocator<float3>; typename thrust::detail::disable_if<thrust::detail::allocator_traits_detail::has_member_system<Alloc>::value, typename thrust::detail::allocator_system<Alloc>::type>::type = thrust::system::cpp::detail::tag]’:
/usr/local/cuda/include/thrust/detail/allocator/allocator_traits.inl:305:41:   required from ‘static thrust::detail::allocator_system<Alloc>::get_result_type thrust::detail::allocator_system<Alloc>::get(Alloc&) [with Alloc = std::allocator<float3>; thrust::detail::allocator_system<Alloc>::get_result_type = thrust::system::cpp::detail::tag]’
/usr/local/cuda/include/thrust/detail/allocator/copy_construct_range.inl:218:81:   required from ‘typename thrust::detail::disable_if<thrust::detail::allocator_traits_detail::needs_copy_construct_via_allocator<Allocator, typename thrust::detail::pointer_element<Pointer>::type>::value, Pointer>::type thrust::detail::allocator_traits_detail::copy_construct_range(thrust::execution_policy<Derived>&, Allocator&, InputIterator, InputIterator, Pointer) [with FromSystem = thrust::system::cpp::detail::tag; Allocator = std::allocator<float3>; InputIterator = thrust::detail::normal_iterator<float3*>; Pointer = float3*; typename thrust::detail::disable_if<thrust::detail::allocator_traits_detail::needs_copy_construct_via_allocator<Allocator, typename thrust::detail::pointer_element<Pointer>::type>::value, Pointer>::type = float3*]’
/usr/local/cuda/include/thrust/detail/allocator/copy_construct_range.inl:291:89:   required from ‘Pointer thrust::detail::copy_construct_range(thrust::execution_policy<Derived>&, Allocator&, InputIterator, InputIterator, Pointer) [with System = thrust::system::cpp::detail::tag; Allocator = std::allocator<float3>; InputIterator = thrust::detail::normal_iterator<float3*>; Pointer = float3*]’
/usr/local/cuda/include/thrust/detail/contiguous_storage.inl:225:95:   required from ‘thrust::detail::contiguous_storage<T, Alloc>::iterator thrust::detail::contiguous_storage<T, Alloc>::uninitialized_copy(InputIterator, InputIterator, thrust::detail::contiguous_storage<T, Alloc>::iterator) [with InputIterator = thrust::detail::normal_iterator<float3*>; T = float3; Alloc = std::allocator<float3>; thrust::detail::contiguous_storage<T, Alloc>::iterator = thrust::detail::normal_iterator<float3*>; typename thrust::detail::allocator_traits<Alloc>::pointer = float3*]’
/usr/local/cuda/include/thrust/detail/vector_base.inl:1075:1:   required from ‘void thrust::detail::vector_base<T, Alloc>::allocate_and_copy(thrust::detail::vector_base<T, Alloc>::size_type, ForwardIterator, ForwardIterator, thrust::detail::vector_base<T, Alloc>::storage_type&) [with ForwardIterator = thrust::detail::normal_iterator<float3*>; T = float3; Alloc = std::allocator<float3>; thrust::detail::vector_base<T, Alloc>::size_type = long unsigned int; thrust::detail::vector_base<T, Alloc>::storage_type = thrust::detail::contiguous_storage<float3, std::allocator<float3> >]’
/usr/local/cuda/include/thrust/detail/vector_base.inl:281:59:   required from ‘void thrust::detail::vector_base<T, Alloc>::reserve(thrust::detail::vector_base<T, Alloc>::size_type) [with T = float3; Alloc = std::allocator<float3>; thrust::detail::vector_base<T, Alloc>::size_type = long unsigned int]’
/home/christian/cuda/regulus/tests/../include/domain.hpp:18:1:   required from ‘thrust::host_vector<typename point_type<T>::type, std::allocator<typename point_type<T>::type> > gen_cartesian_domain(int) [with T = float; typename point_type<T>::type = float3]’
/home/christian/cuda/regulus/tests/domain-tests.cu:30:94:   required from here
/usr/local/cuda/include/thrust/detail/allocator/allocator_traits.inl:205:1: warning: unused parameter ‘a’ [-Wunused-parameter]
     system(Alloc &a)
 ^

please continue to keep in secret cuda/thrust version, your code, compilation command, OS… we need to train our new telepathists

Sorry, I wasn’t try to actually file a bug report. I was just curious of other people had similar encounters.

But I’m using CUDA 8, Ubuntu 16.04. I’m compiling with the -Wall and -Wextra flags.

And here’s a link to the source code;

Most of the compiler warnings reports I have seen with thrust are on windows platforms, although I don’t generally compile with -Wall on linux.

Here’s an example of a report on CUDA 7.5 on windows:

[url]https://github.com/thrust/thrust/issues/814[/url]

In that case, I think the warning (int vs. size_t) is something that should be legitimately investigated, and I think the thrust developers will probably investigate that at some point.

I’m not sure about an “unused parameter” warning. I think that may be an entirely legitimate design choice. But I have not taken a close look at it.

If you think it’s a problem, you’re welcome to file a thrust issue or nvidia bug.