mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
dcu adapter ernie45t (#2756)
Co-authored-by: lifu <lifu@sugon.com> Co-authored-by: yongqiangma <xing.wo@163.com>
This commit is contained in:
@@ -37,10 +37,18 @@ std::vector<paddle::Tensor> ShareExternalData(paddle::Tensor& input,
|
||||
}
|
||||
shm = (volatile shmStruct *)info.addr;
|
||||
void *ptr = nullptr;
|
||||
#ifdef PADDLE_WITH_HIP
|
||||
checkCudaErrors(
|
||||
hipIpcOpenMemHandle(&ptr,
|
||||
*(hipIpcMemHandle_t *)&shm->memHandle, // NOLINT
|
||||
hipIpcMemLazyEnablePeerAccess));
|
||||
#else
|
||||
checkCudaErrors(
|
||||
cudaIpcOpenMemHandle(&ptr,
|
||||
*(cudaIpcMemHandle_t *)&shm->memHandle, // NOLINT
|
||||
cudaIpcMemLazyEnablePeerAccess));
|
||||
#endif
|
||||
|
||||
paddle::Tensor tmp_tensor = paddle::from_blob(
|
||||
ptr,
|
||||
shape,
|
||||
|
||||
Reference in New Issue
Block a user