Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_export_cpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gallas Gaye
aidge_export_cpp
Commits
fa9d9ded
Commit
fa9d9ded
authored
2 months ago
by
Gallas Gaye
Browse files
Options
Downloads
Patches
Plain Diff
fixed warning in pooling
parent
760ea454
No related branches found
No related tags found
No related merge requests found
Pipeline
#69606
failed
2 months ago
Stage: static_analysis
Stage: build
Stage: test
Stage: coverage
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aidge_export_cpp/kernels/pooling.hpp
+5
-5
5 additions, 5 deletions
aidge_export_cpp/kernels/pooling.hpp
with
5 additions
and
5 deletions
aidge_export_cpp/kernels/pooling.hpp
+
5
−
5
View file @
fa9d9ded
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include
<stdexcept>
#include
<stdexcept>
template
<
int
NB_CHANNELS
,
template
<
int
NB_CHANNELS
,
int
CHANNELS_HEIGHT
,
int
CHANNELS_WIDTH
,
int
CHANNELS_HEIGHT
,
int
CHANNELS_WIDTH
,
int
NB_OUTPUTS
,
int
NB_OUTPUTS
,
int
OUTPUTS_HEIGHT
,
int
OUTPUTS_WIDTH
,
int
OUTPUTS_HEIGHT
,
int
OUTPUTS_WIDTH
,
...
@@ -17,7 +17,7 @@ template<int NB_CHANNELS,
...
@@ -17,7 +17,7 @@ template<int NB_CHANNELS,
Pooling_T
POOLING_TYPE
,
Pooling_T
POOLING_TYPE
,
ActivationFunction_T
ACTIVATION
,
ActivationFunction_T
ACTIVATION
,
typename
Input_T
,
typename
Output_T
>
typename
Input_T
,
typename
Output_T
>
__attribute__
((
always_inline
))
inline
__attribute__
((
always_inline
))
inline
void
pooling_forward
(
void
pooling_forward
(
const
Input_T
*
__restrict
inputs
,
const
Input_T
*
__restrict
inputs
,
Output_T
*
__restrict
outputs
)
Output_T
*
__restrict
outputs
)
...
@@ -32,7 +32,7 @@ void pooling_forward(
...
@@ -32,7 +32,7 @@ void pooling_forward(
:
max
(
PADDING_Y
-
(
oy
*
STRIDE_Y
),
0
);
:
max
(
PADDING_Y
-
(
oy
*
STRIDE_Y
),
0
);
const
int
syMax
=
(
PADDING_Y
==
0
const
int
syMax
=
(
PADDING_Y
==
0
&&
OUTPUTS_HEIGHT
==
OUTPUTS_HEIGHT_NOPAD
)
?
POOL_HEIGHT
&&
OUTPUTS_HEIGHT
==
OUTPUTS_HEIGHT_NOPAD
)
?
POOL_HEIGHT
:
clamp
(
CHANNELS_HEIGHT
+
PADDING_Y
-
(
oy
*
STRIDE_Y
),
:
clamp
(
CHANNELS_HEIGHT
+
PADDING_Y
-
(
oy
*
STRIDE_Y
),
0
,
POOL_HEIGHT
);
0
,
POOL_HEIGHT
);
const
int
iy
=
(
oy
*
STRIDE_Y
)
-
PADDING_Y
;
const
int
iy
=
(
oy
*
STRIDE_Y
)
-
PADDING_Y
;
...
@@ -45,7 +45,7 @@ void pooling_forward(
...
@@ -45,7 +45,7 @@ void pooling_forward(
const
int
sxMax
=
(
PADDING_X
==
0
const
int
sxMax
=
(
PADDING_X
==
0
&&
OUTPUTS_WIDTH
==
OUTPUTS_WIDTH_NOPAD
)
&&
OUTPUTS_WIDTH
==
OUTPUTS_WIDTH_NOPAD
)
?
POOL_WIDTH
?
POOL_WIDTH
:
clamp
(
CHANNELS_WIDTH
+
PADDING_X
-
(
ox
*
STRIDE_X
),
:
clamp
(
CHANNELS_WIDTH
+
PADDING_X
-
(
ox
*
STRIDE_X
),
0
,
POOL_WIDTH
);
0
,
POOL_WIDTH
);
const
int
ix
=
(
ox
*
STRIDE_X
)
-
PADDING_X
;
const
int
ix
=
(
ox
*
STRIDE_X
)
-
PADDING_X
;
...
@@ -86,7 +86,7 @@ void pooling_forward(
...
@@ -86,7 +86,7 @@ void pooling_forward(
outputs
[
oOffset
+
output
]
=
maxVal
;
outputs
[
oOffset
+
output
]
=
maxVal
;
}
}
else
if
(
POOLING_TYPE
==
Average
)
{
else
if
(
POOLING_TYPE
==
Average
)
{
int32_t
sum
=
0
;
outputs
[
oOffset
+
output
]
=
0
;
for
(
int
sy
=
0
;
sy
<
POOL_HEIGHT
;
++
sy
)
{
for
(
int
sy
=
0
;
sy
<
POOL_HEIGHT
;
++
sy
)
{
if
((
PADDING_Y
!=
0
if
((
PADDING_Y
!=
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment