Skip to content

Commit 56419ca

Browse files
committed
Add .cu
1 parent 3bcb67f commit 56419ca

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

paddle/fluid/operators/random_crop_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ namespace ops = paddle::operators;
7474
namespace f = paddle::framework;
7575
REGISTER_OPERATOR(random_crop, ops::RandomCropOp, ops::RandomCropOpMaker,
7676
ops::RandomCropOpInferShape, f::EmptyGradOpMaker);
77+
7778
template <typename T>
7879
using Kernel = ops::RandomCropKernel<paddle::platform::CPUDeviceContext, T>;
79-
8080
REGISTER_OP_CPU_KERNEL(random_crop, Kernel<float>, Kernel<int>, Kernel<double>,
8181
Kernel<uint8_t>, Kernel<int16_t>);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#include "paddle/fluid/operators/random_crop_op.h"
16+
17+
template <typename T>
18+
using Kernel = ops::RandomCropKernel<paddle::platform::CUDADeviceContext, T>;
19+
REGISTER_OP_CUDA_KERNEL(random_crop, Kernel<float>, Kernel<int>, Kernel<double>,
20+
Kernel<uint8_t>, Kernel<int16_t>);

0 commit comments

Comments
 (0)