Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions paddle/phi/kernels/fused_bias_act_kernel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) 2024 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.

#pragma once

#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/kernel_registry.h"

namespace phi {
namespace fusion {

template <typename T, typename Context>
void FusedBiasActKernel(const Context& dev_ctx,
const DenseTensor& x,
const paddle::optional<DenseTensor>& bias,
const paddle::optional<DenseTensor>& dequant_scales,
const paddle::optional<DenseTensor>& shift,
const paddle::optional<DenseTensor>& smooth,
const std::string& act_method,
const std::string& compute_dtype,
float quant_scale,
int quant_round_type,
float quant_max_bound,
float quant_min_bound,
DenseTensor* out);

} // namespace fusion
} // namespace phi
1 change: 1 addition & 0 deletions paddle/phi/kernels/fusion/gpu/fused_bias_act_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle/phi/kernels/fused_bias_act_kernel.h"
#include "glog/logging.h"
#include "paddle/common/flags.h"
#include "paddle/phi/kernels/fusion/gpu/fused_bias_act_utils.h"
Expand Down
1 change: 1 addition & 0 deletions paddle/phi/kernels/fusion/xpu/fused_bias_act_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle/phi/kernels/fused_bias_act_kernel.h"
#include "paddle/phi/backends/xpu/enforce_xpu.h"
#include "paddle/phi/backends/xpu/xpu_context.h"
#include "paddle/phi/core/dense_tensor.h"
Expand Down
Loading