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
0221c5a4
Commit
0221c5a4
authored
11 years ago
by
Eric Wait
Browse files
Options
Downloads
Patches
Plain Diff
Kernel spelling fix
parent
a7928634
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/c/Common/CudaImageBuffer.cuh
+19
-17
19 additions, 17 deletions
src/c/Common/CudaImageBuffer.cuh
src/c/Common/CudaKernels.cuh
+116
-118
116 additions, 118 deletions
src/c/Common/CudaKernels.cuh
with
135 additions
and
135 deletions
src/c/Common/CudaImageBuffer.cuh
+
19
−
17
View file @
0221c5a4
...
...
@@ -4,10 +4,10 @@
#define DEVICE_VEC
#include
"Vec.h"
#undef DEVICE_VEC
#include
"CudaKern
a
ls.cuh"
#include
"CudaKern
e
ls.cuh"
#include
"CudaUtilities.cuh"
#include
"CHelpers.h"
#include
"assert.h"
#include
<limits>
template
<
typename
ImagePixelType
>
class
CudaImageBuffer
...
...
@@ -350,31 +350,32 @@ public:
*/
void
gaussianFilter
(
Vec
<
float
>
sigmas
)
{
if
(
constKern
a
lDims
==
UNSET
||
sigmas
!=
gausKern
a
lSigmas
)
if
(
constKern
e
lDims
==
UNSET
||
sigmas
!=
gausKern
e
lSigmas
)
{
gausKernalSigmas
=
sigmas
;
constKernalDims
=
createGaussianKernal
(
sigmas
,
hostKernal
,
gaussIterations
);
HANDLE_ERROR
(
cudaMemcpyToSymbol
(
cudaConstKernal
,
hostKernal
,
sizeof
(
float
)
*
(
constKernalDims
.
x
+
constKernalDims
.
y
+
constKernalDims
.
z
)));
constKernelZeros
();
gausKernelSigmas
=
sigmas
;
constKernelDims
=
createGaussianKernel
(
gausKernelSigmas
,
hostKernel
,
gaussIterations
);
HANDLE_ERROR
(
cudaMemcpyToSymbol
(
cudaConstKernel
,
hostKernel
,
sizeof
(
float
)
*
(
constKernelDims
.
x
+
constKernelDims
.
y
+
constKernelDims
.
z
)));
}
for
(
int
x
=
0
;
x
<
gaussIterations
.
x
;
++
x
)
{
cudaMultAddFilter
<<<
blocks
,
threads
>>>
(
getCurrentBuffer
(),
getNextBuffer
(),
imageDims
,
Vec
<
unsigned
int
>
(
constKern
a
lDims
.
x
,
1
,
1
),
cudaMultAddFilter
<<<
blocks
,
threads
>>>
(
getCurrentBuffer
(),
getNextBuffer
(),
imageDims
,
Vec
<
unsigned
int
>
(
constKern
e
lDims
.
x
,
1
,
1
),
isColumnMajor
);
incrementBufferNumber
();
}
for
(
int
y
=
0
;
y
<
gaussIterations
.
y
;
++
y
)
{
cudaMultAddFilter
<<<
blocks
,
threads
>>>
(
getCurrentBuffer
(),
getNextBuffer
(),
imageDims
,
Vec
<
unsigned
int
>
(
1
,
constKern
a
lDims
.
y
,
1
),
constKern
a
lDims
.
x
,
isColumnMajor
);
cudaMultAddFilter
<<<
blocks
,
threads
>>>
(
getCurrentBuffer
(),
getNextBuffer
(),
imageDims
,
Vec
<
unsigned
int
>
(
1
,
constKern
e
lDims
.
y
,
1
),
constKern
e
lDims
.
x
,
isColumnMajor
);
incrementBufferNumber
();
}
for
(
int
z
=
0
;
z
<
gaussIterations
.
z
;
++
z
)
{
cudaMultAddFilter
<<<
blocks
,
threads
>>>
(
getCurrentBuffer
(),
getNextBuffer
(),
imageDims
,
Vec
<
unsigned
int
>
(
1
,
1
,
constKern
a
lDims
.
z
),
constKern
a
lDims
.
x
+
constKern
a
lDims
.
y
,
isColumnMajor
);
cudaMultAddFilter
<<<
blocks
,
threads
>>>
(
getCurrentBuffer
(),
getNextBuffer
(),
imageDims
,
Vec
<
unsigned
int
>
(
1
,
1
,
constKern
e
lDims
.
z
),
constKern
e
lDims
.
x
+
constKern
e
lDims
.
y
,
isColumnMajor
);
incrementBufferNumber
();
}
}
...
...
@@ -760,8 +761,8 @@ private:
{
imageDims
=
UNSET
;
reducedDims
=
UNSET
;
constKern
a
lDims
=
UNSET
;
gausKern
a
lSigmas
=
Vec
<
float
>
(
0.0
f
,
0.0
f
,
0.0
f
);
constKern
e
lDims
=
UNSET
;
gausKern
e
lSigmas
=
Vec
<
float
>
(
0.0
f
,
0.0
f
,
0.0
f
);
device
=
-
1
;
currentBuffer
=
-
1
;
for
(
int
i
=
0
;
i
<
NUM_BUFFERS
;
++
i
)
...
...
@@ -823,7 +824,7 @@ private:
if
(
minValuesDevice
!=
NULL
)
HANDLE_ERROR
(
cudaFree
(
minValuesDevice
));
memset
(
hostKern
a
l
,
0
,
sizeof
(
float
)
*
MAX_KERN
A
L_DIM
*
MAX_KERN
A
L_DIM
*
MAX_KERN
A
L_DIM
);
memset
(
hostKern
e
l
,
0
,
sizeof
(
float
)
*
MAX_KERN
E
L_DIM
*
MAX_KERN
E
L_DIM
*
MAX_KERN
E
L_DIM
);
defaults
();
}
...
...
@@ -905,14 +906,15 @@ private:
unsigned
int
*
histogramDevice
;
double
*
normalizedHistogramHost
;
double
*
normalizedHistogramDevice
;
bool
isCurrentHistogramHost
,
isCurrentHistogramDevice
,
isCurrentNormHistogramHost
,
isCurrentNormHistogramDevice
;
dim3
sumBlocks
,
sumThreads
;
double
*
deviceSum
;
double
*
hostSum
;
int
sizeSum
;
Vec
<
unsigned
int
>
constKern
a
lDims
;
Vec
<
unsigned
int
>
constKern
e
lDims
;
Vec
<
int
>
gaussIterations
;
Vec
<
float
>
gausKern
a
lSigmas
;
float
hostKern
a
l
[
MAX_KERN
A
L_DIM
*
MAX_KERN
A
L_DIM
*
MAX_KERN
A
L_DIM
];
Vec
<
float
>
gausKern
e
lSigmas
;
float
hostKern
e
l
[
MAX_KERN
E
L_DIM
*
MAX_KERN
E
L_DIM
*
MAX_KERN
E
L_DIM
];
int
reservedBuffer
;
Vec
<
unsigned
int
>
UNSET
;
bool
isColumnMajor
;
...
...
This diff is collapsed.
Click to expand it.
src/c/Common/CudaKern
a
ls.cuh
→
src/c/Common/CudaKern
e
ls.cuh
+
116
−
118
View file @
0221c5a4
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