Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hydra-image-processor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
hydra-image-processor
Commits
a23ed5c8
Commit
a23ed5c8
authored
10 years ago
by
Eric Wait
Browse files
Options
Downloads
Patches
Plain Diff
Removed shared memory from reduction where not necessary
parent
e7ea36ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/c/Common/CudaImageReduction.cuh
+7
-6
7 additions, 6 deletions
src/c/Common/CudaImageReduction.cuh
with
7 additions
and
6 deletions
src/c/Common/CudaImageReduction.cuh
+
7
−
6
View file @
a23ed5c8
...
...
@@ -51,7 +51,8 @@ template <class PixelType>
__global__
void
cudaMedianImageReduction
(
CudaImageContainer
<
PixelType
>
imageIn
,
CudaImageContainer
<
PixelType
>
imageOut
,
Vec
<
size_t
>
hostReductions
)
{
extern
__shared__
double
vals
[];
extern
__shared__
unsigned
char
sharedMem
[];
PixelType
*
vals
=
(
PixelType
*
)
sharedMem
;
DeviceVec
<
size_t
>
reductions
=
hostReductions
;
DeviceVec
<
size_t
>
coordinateOut
;
coordinateOut
.
x
=
threadIdx
.
x
+
blockIdx
.
x
*
blockDim
.
x
;
...
...
@@ -234,23 +235,23 @@ PixelType* reduceImage(const PixelType* imageIn, Vec<size_t> dims, Vec<size_t> r
blocks
.
y
=
(
unsigned
int
)
ceil
((
double
)
reducedIt
->
getFullChunkSize
().
y
/
threads
.
y
);
blocks
.
z
=
(
unsigned
int
)
ceil
((
double
)
reducedIt
->
getFullChunkSize
().
z
/
threads
.
z
);
}
size_t
sharedMemorysize
=
reductions
.
product
()
*
sizeof
(
PixelType
)
*
threads
.
x
*
threads
.
y
*
threads
.
z
;
size_t
sharedMemorysize
=
0
;
switch
(
method
)
{
case
REDUC_MEAN
:
cudaMeanImageReduction
<<<
blocks
,
threads
,
sharedMemorysize
>>>
(
*
deviceImageIn
,
*
deviceImageOut
,
reductions
);
cudaMeanImageReduction
<<<
blocks
,
threads
>>>
(
*
deviceImageIn
,
*
deviceImageOut
,
reductions
);
break
;
case
REDUC_MEDIAN
:
sharedMemorysize
=
reductions
.
product
()
*
sizeof
(
PixelType
)
*
threads
.
x
*
threads
.
y
*
threads
.
z
;
cudaMedianImageReduction
<<<
blocks
,
threads
,
sharedMemorysize
>>>
(
*
deviceImageIn
,
*
deviceImageOut
,
reductions
);
break
;
case
REDUC_MIN
:
cudaMinImageReduction
<<<
blocks
,
threads
,
sharedMemorysize
>>>
(
*
deviceImageIn
,
*
deviceImageOut
,
reductions
,
cudaMinImageReduction
<<<
blocks
,
threads
>>>
(
*
deviceImageIn
,
*
deviceImageOut
,
reductions
,
std
::
numeric_limits
<
PixelType
>::
max
());
break
;
case
REDUC_MAX
:
cudaMaxImageReduction
<<<
blocks
,
threads
,
sharedMemorysize
>>>
(
*
deviceImageIn
,
*
deviceImageOut
,
reductions
,
cudaMaxImageReduction
<<<
blocks
,
threads
>>>
(
*
deviceImageIn
,
*
deviceImageOut
,
reductions
,
std
::
numeric_limits
<
PixelType
>::
lowest
());
break
;
default:
...
...
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