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

THRUST_UNUSED undefined in thrust::tuple_for_each #970

Closed
codecircuit opened this issue Apr 3, 2019 · 0 comments
Closed

THRUST_UNUSED undefined in thrust::tuple_for_each #970

codecircuit opened this issue Apr 3, 2019 · 0 comments

Comments

@codecircuit
Copy link

#include <thrust/detail/tuple_algorithms.h>

#include <tuple>

int main() {
	std::tuple<int, float> t;
	thrust::tuple_for_each(t, [](auto& e){e = 0;});
}

will fail to compile, because THRUST_UNUSED is undefined. I think this macro should prevent compiler warnings about unused variables, but also prevent some unwanted compiler optimizations. You can also search for THRUST_UNUSED in this repository and I only found it once in tuple_for_each_impl. Maybe you meant THRUST_UNUSED_VAR defined in thrust/system/cuda/config.h?

bjude added a commit to bjude/thrust that referenced this issue Oct 21, 2019
brycelelbach pushed a commit that referenced this issue May 16, 2020
Fixes #970

Tuple Algorithms: Add tests for tuple_subset & tuple_for_each
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant