Skip to content

Commit e6eafee

Browse files
【CUDA Kernel No.20】affine_channel算子Kernel修复 -part (#75545)
1 parent 21e188f commit e6eafee

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2024 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+
#pragma once
16+
17+
#include <string>
18+
#include "paddle/phi/backends/gpu/gpu_context.h"
19+
#include "paddle/phi/core/dense_tensor.h"
20+
#include "paddle/phi/core/kernel_registry.h"
21+
22+
namespace phi {
23+
24+
// AffineChannel CUDA kernel wrapper
25+
template <typename T, typename Context>
26+
void AffineChannelCUDAKernel(const Context& dev_ctx,
27+
const DenseTensor& x_in,
28+
const DenseTensor& scale_in,
29+
const DenseTensor& bias_in,
30+
const std::string& data_layout,
31+
DenseTensor* out);
32+
33+
} // namespace phi

paddle/phi/kernels/cpu/affine_channel_kernel.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include "paddle/phi/kernels/affine_channel_kernel.h"
1516
#include <string>
1617
#include <unordered_map>
17-
1818
#include "paddle/phi/core/kernel_registry.h"
1919
#include "paddle/phi/kernels/funcs/eigen/common.h"
2020

paddle/phi/kernels/gpu/affine_channel_kernel.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
#include <hipcub/hipcub.hpp>
2121
namespace cub = hipcub;
2222
#endif
23-
2423
#include "paddle/phi/backends/gpu/gpu_context.h"
2524
#include "paddle/phi/backends/gpu/gpu_primitives.h"
2625
#include "paddle/phi/core/kernel_registry.h"
26+
#include "paddle/phi/kernels/affine_channel_kernel.h"
2727

2828
namespace phi {
2929

paddle/phi/kernels/xpu/affine_channel_kernel.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include "paddle/phi/kernels/affine_channel_kernel.h"
1516
#include <string>
1617
#include <unordered_map>
1718
#include <vector>
18-
1919
#include "paddle/phi/backends/xpu/enforce_xpu.h"
2020
#include "paddle/phi/core/kernel_registry.h"
2121
#include "paddle/phi/kernels/funcs/eigen/common.h"

0 commit comments

Comments
 (0)