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

Remove device_ptr_cast.h #9910

Closed
wants to merge 3 commits into from
Closed
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: 2 additions & 2 deletions cmake/inference_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ copy(inference_lib DEPS paddle_fluid_shared paddle_fluid

set(module "platform")
copy(platform_lib DEPS profiler_py_proto
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/dynload/*.h ${src_dir}/${module}/details/*.h
DSTS ${dst_dir}/${module} ${dst_dir}/${module}/dynload ${dst_dir}/${module}/details
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/dynload/*.h
DSTS ${dst_dir}/${module} ${dst_dir}/${module}/dynload
)

set(module "string")
Expand Down
56 changes: 0 additions & 56 deletions paddle/fluid/platform/details/device_ptr_cast.h

This file was deleted.

23 changes: 13 additions & 10 deletions paddle/fluid/platform/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ limitations under the License. */

#pragma once

#include <algorithm>
#include <type_traits>

#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/hostdevice.h"
#include "paddle/fluid/platform/place.h"

#include <algorithm>
#include <type_traits>
#ifdef __NVCC__
#include <thrust/execution_policy.h>
#include <thrust/transform.h>
#include "paddle/fluid/platform/details/device_ptr_cast.h"
#include "thrust/device_ptr.h"
#include "thrust/execution_policy.h"
#include "thrust/transform.h"
#endif

namespace paddle {
Expand Down Expand Up @@ -70,8 +71,9 @@ struct Transform<platform::CUDADeviceContext> {
auto place = context.GetPlace();
PADDLE_ENFORCE(is_gpu_place(place), "It must use GPU place.");
thrust::transform(thrust::cuda::par.on(context.stream()),
details::DevPtrCast(first), details::DevPtrCast(last),
details::DevPtrCast(result), op);
thrust::device_pointer_cast(first),
thrust::device_pointer_cast(last),
thrust::device_pointer_cast(result), op);
}

template <typename InputIter1, typename InputIter2, typename OutputIter,
Expand All @@ -82,9 +84,10 @@ struct Transform<platform::CUDADeviceContext> {
auto place = context.GetPlace();
PADDLE_ENFORCE(is_gpu_place(place), "It must use GPU place.");
thrust::transform(thrust::cuda::par.on(context.stream()),
details::DevPtrCast(first1), details::DevPtrCast(last1),
details::DevPtrCast(first2), details::DevPtrCast(result),
op);
thrust::device_pointer_cast(first1),
thrust::device_pointer_cast(last1),
thrust::device_pointer_cast(first2),
thrust::device_pointer_cast(result), op);
}
};
#endif
Expand Down