diff --git a/paddle/fluid/operators/expand_as_op.cc b/paddle/fluid/operators/expand_as_op.cc index 25b83ed93f72969b4a12a6cbda1fd06c01e98c96..8850dc45d24c8d790f15972f0ec47dc35925e350 100644 --- a/paddle/fluid/operators/expand_as_op.cc +++ b/paddle/fluid/operators/expand_as_op.cc @@ -147,3 +147,17 @@ REGISTER_OP_CPU_KERNEL( ops::ExpandAsGradKernel, ops::ExpandAsGradKernel, ops::ExpandAsGradKernel); +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_ROCM) +REGISTER_OP_CUDA_KERNEL( + expand_as, ops::ExpandAsKernel, + ops::ExpandAsKernel, + ops::ExpandAsKernel, + ops::ExpandAsKernel, + ops::ExpandAsKernel); +REGISTER_OP_CUDA_KERNEL( + expand_as_grad, + ops::ExpandAsGradKernel, + ops::ExpandAsGradKernel, + ops::ExpandAsGradKernel, + ops::ExpandAsGradKernel); +#endif diff --git a/paddle/fluid/operators/expand_as_op.cu b/paddle/fluid/operators/expand_as_op.cu deleted file mode 100755 index dbb1fcf3ab32619b73363bf064cb1cc286efde6e..0000000000000000000000000000000000000000 --- a/paddle/fluid/operators/expand_as_op.cu +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ -#include "paddle/fluid/operators/expand_as_op.h" - -namespace ops = paddle::operators; -REGISTER_OP_CUDA_KERNEL( - expand_as, ops::ExpandAsKernel, - ops::ExpandAsKernel, - ops::ExpandAsKernel, - ops::ExpandAsKernel, - ops::ExpandAsKernel); -REGISTER_OP_CUDA_KERNEL( - expand_as_grad, - ops::ExpandAsGradKernel, - ops::ExpandAsGradKernel, - ops::ExpandAsGradKernel, - ops::ExpandAsGradKernel); diff --git a/paddle/fluid/operators/expand_as_v2_op.cc b/paddle/fluid/operators/expand_as_v2_op.cc index 70099afbd5994dc599fd50c80524494f6056b345..f0a6e6ec332421d7e8917bf9b7e44b72526c3b92 100644 --- a/paddle/fluid/operators/expand_as_v2_op.cc +++ b/paddle/fluid/operators/expand_as_v2_op.cc @@ -129,3 +129,18 @@ REGISTER_OP_CPU_KERNEL( ops::ExpandAsV2GradKernel, ops::ExpandAsV2GradKernel, ops::ExpandAsV2GradKernel); +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_ROCM) +REGISTER_OP_CUDA_KERNEL( + expand_as_v2, + ops::ExpandAsV2Kernel, + ops::ExpandAsV2Kernel, + ops::ExpandAsV2Kernel, + ops::ExpandAsV2Kernel, + ops::ExpandAsV2Kernel); +REGISTER_OP_CUDA_KERNEL( + expand_as_v2_grad, + ops::ExpandAsV2GradKernel, + ops::ExpandAsV2GradKernel, + ops::ExpandAsV2GradKernel, + ops::ExpandAsV2GradKernel); +#endif diff --git a/paddle/fluid/operators/expand_as_v2_op.cu b/paddle/fluid/operators/expand_as_v2_op.cu deleted file mode 100644 index e315144472dd9fd4095043e4800a3f276d9314c7..0000000000000000000000000000000000000000 --- a/paddle/fluid/operators/expand_as_v2_op.cu +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ -#include "paddle/fluid/operators/expand_as_v2_op.h" - -namespace ops = paddle::operators; -REGISTER_OP_CUDA_KERNEL( - expand_as_v2, - ops::ExpandAsV2Kernel, - ops::ExpandAsV2Kernel, - ops::ExpandAsV2Kernel, - ops::ExpandAsV2Kernel, - ops::ExpandAsV2Kernel); -REGISTER_OP_CUDA_KERNEL( - expand_as_v2_grad, - ops::ExpandAsV2GradKernel, - ops::ExpandAsV2GradKernel, - ops::ExpandAsV2GradKernel, - ops::ExpandAsV2GradKernel); diff --git a/paddle/fluid/operators/expand_op.cc b/paddle/fluid/operators/expand_op.cc index 83e205367a7af62c52825297d92571c306be2c42..6797639b94721107652dcf9c1201cac891241398 100644 --- a/paddle/fluid/operators/expand_op.cc +++ b/paddle/fluid/operators/expand_op.cc @@ -273,3 +273,21 @@ REGISTER_OP_CPU_KERNEL( ops::ExpandGradKernel, ops::ExpandGradKernel, ops::ExpandGradKernel); +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_ROCM) +REGISTER_OP_CUDA_KERNEL( + expand, ops::ExpandKernel, + ops::ExpandKernel, + ops::ExpandKernel, + ops::ExpandKernel, + ops::ExpandKernel, + ops::ExpandKernel); +REGISTER_OP_CUDA_KERNEL( + expand_grad, + ops::ExpandGradKernel, + ops::ExpandGradKernel, + ops::ExpandGradKernel, + ops::ExpandGradKernel, + ops::ExpandGradKernel); +#endif diff --git a/paddle/fluid/operators/expand_op.cu b/paddle/fluid/operators/expand_op.cu deleted file mode 100644 index f2f8e2f7414f38bb623ad312168b5958167557bc..0000000000000000000000000000000000000000 --- a/paddle/fluid/operators/expand_op.cu +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ -#include "paddle/fluid/operators/expand_op.h" - -namespace ops = paddle::operators; -namespace plat = paddle::platform; - -REGISTER_OP_CUDA_KERNEL( - expand, ops::ExpandKernel, - ops::ExpandKernel, - ops::ExpandKernel, - ops::ExpandKernel, - ops::ExpandKernel, - ops::ExpandKernel); -REGISTER_OP_CUDA_KERNEL( - expand_grad, - ops::ExpandGradKernel, - ops::ExpandGradKernel, - ops::ExpandGradKernel, - ops::ExpandGradKernel, - ops::ExpandGradKernel); diff --git a/paddle/fluid/operators/expand_v2_op.cc b/paddle/fluid/operators/expand_v2_op.cc index 05ab0f6c8dc8fc5d18b8eee7ee3294b91bc2d3e7..e65011bf7de63c3eb7467598ff284ae25fd22966 100644 --- a/paddle/fluid/operators/expand_v2_op.cc +++ b/paddle/fluid/operators/expand_v2_op.cc @@ -278,3 +278,21 @@ REGISTER_OP_CPU_KERNEL( ops::ExpandV2GradKernel, ops::ExpandV2GradKernel, ops::ExpandV2GradKernel); +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_ROCM) +REGISTER_OP_CUDA_KERNEL( + expand_v2, ops::ExpandV2Kernel, + ops::ExpandV2Kernel, + ops::ExpandV2Kernel, + ops::ExpandV2Kernel, + ops::ExpandV2Kernel, + ops::ExpandV2Kernel); +REGISTER_OP_CUDA_KERNEL( + expand_v2_grad, + ops::ExpandV2GradKernel, + ops::ExpandV2GradKernel, + ops::ExpandV2GradKernel, + ops::ExpandV2GradKernel, + ops::ExpandV2GradKernel); +#endif diff --git a/paddle/fluid/operators/expand_v2_op.cu b/paddle/fluid/operators/expand_v2_op.cu deleted file mode 100644 index e096dbc27f0c2ae8142da40b9db99074b2719387..0000000000000000000000000000000000000000 --- a/paddle/fluid/operators/expand_v2_op.cu +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ -#include "paddle/fluid/operators/expand_v2_op.h" - -namespace ops = paddle::operators; -namespace plat = paddle::platform; - -REGISTER_OP_CUDA_KERNEL( - expand_v2, ops::ExpandV2Kernel, - ops::ExpandV2Kernel, - ops::ExpandV2Kernel, - ops::ExpandV2Kernel, - ops::ExpandV2Kernel, - ops::ExpandV2Kernel); -REGISTER_OP_CUDA_KERNEL( - expand_v2_grad, - ops::ExpandV2GradKernel, - ops::ExpandV2GradKernel, - ops::ExpandV2GradKernel, - ops::ExpandV2GradKernel, - ops::ExpandV2GradKernel); diff --git a/paddle/fluid/operators/meshgrid_op.cc b/paddle/fluid/operators/meshgrid_op.cc index 33f71b4adc066fbb123fe69a47cea1e8b6913cc9..2ad3c9f923a313865134ea7bb8283def2b4cb54c 100644 --- a/paddle/fluid/operators/meshgrid_op.cc +++ b/paddle/fluid/operators/meshgrid_op.cc @@ -157,3 +157,17 @@ REGISTER_OP_CPU_KERNEL( ops::MeshgridGradKernel, ops::MeshgridGradKernel, ops::MeshgridGradKernel); +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_ROCM) +REGISTER_OP_CUDA_KERNEL( + meshgrid, ops::MeshgridKernel, + ops::MeshgridKernel, + ops::MeshgridKernel, + ops::MeshgridKernel, + ops::MeshgridKernel); +REGISTER_OP_CUDA_KERNEL( + meshgrid_grad, + ops::MeshgridGradKernel, + ops::MeshgridGradKernel, + ops::MeshgridGradKernel, + ops::MeshgridGradKernel); +#endif diff --git a/paddle/fluid/operators/meshgrid_op.cu b/paddle/fluid/operators/meshgrid_op.cu deleted file mode 100644 index dc813a07f8c8c17e6c9b967a4fad372513d61594..0000000000000000000000000000000000000000 --- a/paddle/fluid/operators/meshgrid_op.cu +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "paddle/fluid/operators/meshgrid_op.h" - -namespace ops = paddle::operators; -REGISTER_OP_CUDA_KERNEL( - meshgrid, ops::MeshgridKernel, - ops::MeshgridKernel, - ops::MeshgridKernel, - ops::MeshgridKernel, - ops::MeshgridKernel); -REGISTER_OP_CUDA_KERNEL( - meshgrid_grad, - ops::MeshgridGradKernel, - ops::MeshgridGradKernel, - ops::MeshgridGradKernel, - ops::MeshgridGradKernel); diff --git a/paddle/fluid/operators/tile_op.cc b/paddle/fluid/operators/tile_op.cc index 6527362bb969072b3a41cb8f74e433f030a31af0..a8b1c7235448b37007f5bea754ff6ae58e20fa9e 100644 --- a/paddle/fluid/operators/tile_op.cc +++ b/paddle/fluid/operators/tile_op.cc @@ -286,3 +286,20 @@ REGISTER_OP_CPU_KERNEL( ops::TileGradKernel, ops::TileGradKernel, ops::TileGradKernel); +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_ROCM) +REGISTER_OP_CUDA_KERNEL( + tile, ops::TileKernel, + ops::TileKernel, + ops::TileKernel, + ops::TileKernel, + ops::TileKernel, + ops::TileKernel); +REGISTER_OP_CUDA_KERNEL( + tile_grad, ops::TileGradKernel, + ops::TileGradKernel, + ops::TileGradKernel, + ops::TileGradKernel, + ops::TileGradKernel); +#endif diff --git a/paddle/fluid/operators/tile_op.cu b/paddle/fluid/operators/tile_op.cu deleted file mode 100644 index 5ca82cd6a1f43551cb4d461bc47e962abd097a9a..0000000000000000000000000000000000000000 --- a/paddle/fluid/operators/tile_op.cu +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ -#include "paddle/fluid/operators/tile_op.h" - -namespace ops = paddle::operators; -namespace plat = paddle::platform; - -REGISTER_OP_CUDA_KERNEL( - tile, ops::TileKernel, - ops::TileKernel, - ops::TileKernel, - ops::TileKernel, - ops::TileKernel, - ops::TileKernel); -REGISTER_OP_CUDA_KERNEL( - tile_grad, ops::TileGradKernel, - ops::TileGradKernel, - ops::TileGradKernel, - ops::TileGradKernel, - ops::TileGradKernel);