-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add reduce_merge files for reduce op #32697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7d58b91
Merge pull request #1 from PaddlePaddle/develop
AnnaTrainingG 1021e08
Merge pull request #2 from PaddlePaddle/develop
AnnaTrainingG 43f53fe
Merge pull request #3 from PaddlePaddle/develop
AnnaTrainingG fa99901
add reduce_op.h and functor.h in reduce_merge for reduce
AnnaTrainingG d25ab26
Merge pull request #4 from PaddlePaddle/develop
AnnaTrainingG 20a588b
add reduce_op.h and functor.h in reduce_merge for reduce
AnnaTrainingG 90315e1
Merge branch 'reduce_merge' of https://github.com/niuliling123/Paddle…
AnnaTrainingG 1fee28e
delete notline and renamed reduce_op.h
AnnaTrainingG c650a6d
change the style of reduce_op.cuh and reduce_functor_op.h
AnnaTrainingG bdbffb8
add Test
AnnaTrainingG b33500e
modified reduce_op.cuh -> Array
AnnaTrainingG 6f3d7e4
modified reduce_op
AnnaTrainingG f83712c
modified the Copyright of reduce_functor_op.h and fix a bug in y_d…
AnnaTrainingG 10c0310
modified reduce_op.cuh
AnnaTrainingG 98a8789
modified reduce_op.cuh
AnnaTrainingG 3bb124d
modified reduce_op.cuh
AnnaTrainingG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /* Copyright (c) 2021 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 <string> | ||
| #include <vector> | ||
|
|
||
| #include "paddle/fluid/framework/eigen.h" | ||
| #include "paddle/fluid/framework/tensor.h" | ||
| #include "paddle/fluid/operators/amp/fp16_type_traits.h" | ||
| #include "paddle/fluid/platform/device_context.h" | ||
| #include "paddle/fluid/platform/hostdevice.h" | ||
| #include "paddle/fluid/platform/macros.h" | ||
|
|
||
| namespace paddle { | ||
| namespace operators { | ||
|
|
||
| template <typename T> | ||
| struct CustomMin { | ||
| __device__ __forceinline__ T operator()(const T &a, const T &b) const { | ||
| return (b < a) ? b : a; | ||
| } | ||
| }; | ||
|
|
||
| template <typename T> | ||
| struct CustomMax { | ||
| __device__ __forceinline__ T operator()(const T &a, const T &b) const { | ||
| return (b > a) ? b : a; | ||
| } | ||
| }; | ||
|
|
||
| template <typename T> | ||
| struct CustomSum { | ||
| __device__ __forceinline__ T operator()(const T &a, const T &b) const { | ||
| return b + a; | ||
| } | ||
| }; | ||
|
|
||
| template <typename T> | ||
| struct CustomMul { | ||
| __device__ __forceinline__ T operator()(const T &a, const T &b) const { | ||
| return b * a; | ||
| } | ||
| }; | ||
|
|
||
| } // namespace operators | ||
| } // namespace paddle | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
极小化include的头文件,看起来以上头文件都没有实际依赖。