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
84588344
Commit
84588344
authored
6 years ago
by
Eric Wait
Browse files
Options
Downloads
Patches
Plain Diff
Added buffer conversion when copying to and from the device
parent
f7e96ab9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/c/Cuda/BufferConversions.h
+55
-0
55 additions, 0 deletions
src/c/Cuda/BufferConversions.h
src/c/CudaImageProcessor.vcxproj
+1
-0
1 addition, 0 deletions
src/c/CudaImageProcessor.vcxproj
src/c/CudaImageProcessor.vcxproj.filters
+3
-0
3 additions, 0 deletions
src/c/CudaImageProcessor.vcxproj.filters
with
59 additions
and
0 deletions
src/c/Cuda/BufferConversions.h
0 → 100644
+
55
−
0
View file @
84588344
#pragma once
template
<
typename
T
>
void
toDevice
(
T
**
dst
,
T
*
src
,
size_t
length
)
{
*
dst
=
src
;
}
template
<
typename
T
,
typename
U
>
void
toDevice
(
T
**
dst
,
U
*
src
,
size_t
length
)
{
T
*
temp
=
new
T
[
length
];
for
(
size_t
i
=
0
;
i
<
length
;
++
i
)
temp
[
i
]
=
(
T
)(
src
[
i
]);
*
dst
=
temp
;
}
template
<
typename
T
>
void
fromDevice
(
T
**
dst
,
T
**
src
,
size_t
length
)
{
*
dst
=
*
src
;
}
template
<
typename
T
,
typename
U
>
void
fromDevice
(
T
**
dst
,
U
*
src
,
size_t
length
)
{
*
dst
=
new
T
[
length
];
}
template
<
typename
T
>
void
copyBuffer
(
T
**
dst
,
T
**
src
,
size_t
length
)
{
*
dst
=
*
src
;
}
template
<
typename
T
,
typename
U
>
void
copyBuffer
(
T
**
dst
,
U
**
src
,
size_t
length
)
{
for
(
size_t
i
=
0
;
i
<
length
;
++
i
)
(
*
dst
)[
i
]
=
(
T
)((
*
src
)[
i
]);
U
*
toDelete
=
*
src
;
delete
[]
toDelete
;
}
template
<
typename
T
>
void
cleanBuffer
(
T
**
buff
,
T
*
src
)
{}
template
<
typename
T
,
typename
U
>
void
cleanBuffer
(
T
**
buff
,
U
*
src
)
{
T
*
toDelete
=
*
buff
;
delete
[]
toDelete
;
}
This diff is collapsed.
Click to expand it.
src/c/CudaImageProcessor.vcxproj
+
1
−
0
View file @
84588344
...
...
@@ -122,6 +122,7 @@
<ClCompile
Include=
"Cuda\GaussianKernel.cpp"
/>
<ClCompile
Include=
"Cuda\ImageChunk.cpp"
/>
<ClCompile
Include=
"Cuda\LoGKernel.cpp"
/>
<ClInclude
Include=
"Cuda\BufferConversions.h"
/>
<ClInclude
Include=
"Cuda\CudaClosure.cuh"
/>
<ClInclude
Include=
"Cuda\CudaLoG.cuh"
/>
<ClInclude
Include=
"Cuda\CudaMeanFilter.cuh"
/>
...
...
This diff is collapsed.
Click to expand it.
src/c/CudaImageProcessor.vcxproj.filters
+
3
−
0
View file @
84588344
...
...
@@ -120,6 +120,9 @@
<ClInclude
Include=
"Cuda\CudaElementWiseDifference.cuh"
>
<Filter>
Header Files
</Filter>
</ClInclude>
<ClInclude
Include=
"Cuda\BufferConversions.h"
>
<Filter>
Header Files
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None
Include=
"Cuda\ImageDimensions.cuh"
>
...
...
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