Skip to content

Commit

Permalink
Avoid warning on nodiscard
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Feb 4, 2025
1 parent 549936e commit 9fd8a2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thrust/examples/minimal_custom_backend.cu
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main()
my_system sys;

// To invoke our version of for_each, pass sys as the first parameter
thrust::for_each(sys, vec.begin(), vec.end(), ::cuda::std::identity{});
thrust::for_each(sys, vec.begin(), vec.end(), ::cuda::std::negate{});

// Other algorithms that Thrust implements with thrust::for_each will also
// cause our version of for_each to be invoked when we pass an instance of my_system as the first parameter.
Expand All @@ -53,7 +53,7 @@ int main()
thrust::transform(sys, vec.begin(), vec.end(), vec.begin(), ::cuda::std::identity{});

// Invocations without my_system are handled normally.
thrust::for_each(vec.begin(), vec.end(), ::cuda::std::identity{});
thrust::for_each(vec.begin(), vec.end(), ::cuda::std::negate{});

return 0;
}

0 comments on commit 9fd8a2e

Please sign in to comment.