Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Thrust includes. #1011

Merged
merged 2 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion benchmarks/device_uvector/device_uvector_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

#include "../synchronization/synchronization.hpp"
#include "thrust/detail/raw_pointer_cast.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, this must have been ICYM trying to be helpful. Anytime a non-local include is added in quotes, I blame automation. :)


#include <rmm/cuda_stream.hpp>
#include <rmm/detail/error.hpp>
Expand All @@ -30,6 +29,9 @@

#include <cuda_runtime_api.h>

#include <thrust/device_vector.h>
#include <thrust/memory.h>
Copy link
Contributor Author

@bdice bdice Mar 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't quite tell which header is supposed to contain the public API of thrust::raw_pointer_cast. It doesn't seem to be a detail function. I settled on <thrust/memory.h> but am open to alternative suggestions.


#include <cstdio>
#include <type_traits>

Expand Down
3 changes: 2 additions & 1 deletion include/rmm/mr/device/thrust_allocator_adaptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
#include <rmm/mr/device/device_memory_resource.hpp>
#include <rmm/mr/device/per_device_resource.hpp>

#include <thrust/detail/type_traits/pointer_traits.h>
#include <thrust/device_malloc_allocator.h>
#include <thrust/device_ptr.h>
#include <thrust/memory.h>

namespace rmm::mr {
/**
Expand Down
2 changes: 2 additions & 0 deletions tests/mr/device/thrust_allocator_tests.cu
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#include <gtest/gtest.h>

#include <thrust/reduce.h>

// explicit instantiation for test coverage purposes
template class rmm::mr::thrust_allocator<int>;

Expand Down