From c333af2f60033114b459ec78508e116fe8d9677f Mon Sep 17 00:00:00 2001 From: Zhang Jun Date: Mon, 10 Oct 2022 16:40:06 +0800 Subject: [PATCH] [inference] CPU-> GPU async io copy for TensorRT using ShareExternalData API (#46636) --- paddle/fluid/operators/tensorrt/tensorrt_engine_op.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h b/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h index 5ad7980b8af..18ed1d9eaa9 100644 --- a/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h +++ b/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h @@ -501,8 +501,7 @@ class TensorRTEngineOp : public framework::OperatorBase { // check the input_tensor if (!platform::is_gpu_place(t.place())) { phi::DenseTensor out; - platform::CUDAPlace dst_place; - framework::TransDataDevice(t, dst_place, &out); + framework::TensorCopy(t, dev_place, dev_ctx, &out); t.ShareDataWith(out); } auto t_shape = phi::vectorize(t.dims()); -- GitLab