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
86abbbf0
Commit
86abbbf0
authored
7 years ago
by
Eric Wait
Browse files
Options
Downloads
Patches
Plain Diff
Image Chunk now uses CudaDevices
parent
37ba1d8f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/c/Cuda/ImageChunk.cpp
+3
-3
3 additions, 3 deletions
src/c/Cuda/ImageChunk.cpp
src/c/Cuda/ImageChunk.h
+2
-1
2 additions, 1 deletion
src/c/Cuda/ImageChunk.h
with
5 additions
and
4 deletions
src/c/Cuda/ImageChunk.cpp
+
3
−
3
View file @
86abbbf0
...
...
@@ -122,9 +122,9 @@ std::vector<ImageChunk> calculateChunking(ImageDimensions imageDims, ImageDimens
return
localChunks
;
}
std
::
vector
<
ImageChunk
>
calculateBuffers
(
ImageDimensions
imageDims
,
int
numBuffersNeeded
,
size_t
memAvailable
,
size_t
bytesPerVal
,
size_t
maxThreads
,
Vec
<
size_t
>
kernelDims
/*= Vec<size_t>(0, 0, 0)*/
)
std
::
vector
<
ImageChunk
>
calculateBuffers
(
ImageDimensions
imageDims
,
int
numBuffersNeeded
,
CudaDevices
cudaDevs
,
size_t
bytesPerVal
,
Vec
<
size_t
>
kernelDims
/*= Vec<size_t>(0, 0, 0)*/
)
{
size_t
numVoxels
=
(
size_t
)(
memAvailable
/
(
bytesPerVal
*
numBuffersNeeded
));
size_t
numVoxels
=
(
size_t
)(
cudaDevs
.
getMinAvailMem
()
/
(
bytesPerVal
*
numBuffersNeeded
));
Vec
<
size_t
>
dims
=
imageDims
.
dims
;
Vec
<
size_t
>
overlapVolume
;
...
...
@@ -261,5 +261,5 @@ std::vector<ImageChunk> calculateBuffers(ImageDimensions imageDims, int numBuffe
deviceImageDims
.
chan
=
MAX
(
1
,
numVoxels
/
numVoxelsPerDevice
);
deviceImageDims
.
frame
=
MAX
(
1
,
numVoxels
/
(
deviceImageDims
.
chan
*
numVoxelsPerDevice
));
return
calculateChunking
(
imageDims
,
deviceImageDims
,
maxThreads
,
kernelDims
);
return
calculateChunking
(
imageDims
,
deviceImageDims
,
cudaDevs
.
getMaxThreadsPerBlock
()
,
kernelDims
);
}
This diff is collapsed.
Click to expand it.
src/c/Cuda/ImageChunk.h
+
2
−
1
View file @
86abbbf0
...
...
@@ -2,6 +2,7 @@
#include
"Vec.h"
#include
"CudaImageContainer.cuh"
#include
"ImageDimensions.cuh"
#include
"CudaDeviceInfo.h"
#include
<cuda_runtime.h>
#include
<vector>
...
...
@@ -200,4 +201,4 @@ void setMaxDeviceDims(std::vector<ImageChunk> &chunks, ImageDimensions &maxDevic
std
::
vector
<
ImageChunk
>
calculateChunking
(
ImageDimensions
imageDims
,
ImageDimensions
deviceDims
,
size_t
maxThreads
,
Vec
<
size_t
>
kernalDims
=
Vec
<
size_t
>
(
0
,
0
,
0
));
std
::
vector
<
ImageChunk
>
calculateBuffers
(
ImageDimensions
imageDims
,
int
numBuffersNeeded
,
size_t
memAvailable
,
size_t
bytesPerVal
,
size_t
maxThreads
,
Vec
<
size_t
>
kernelDims
=
Vec
<
size_t
>
(
0
,
0
,
0
));
std
::
vector
<
ImageChunk
>
calculateBuffers
(
ImageDimensions
imageDims
,
int
numBuffersNeeded
,
CudaDevices
cudaDevs
,
size_t
bytesPerVal
,
Vec
<
size_t
>
kernelDims
=
Vec
<
size_t
>
(
0
,
0
,
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