Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Cresson Remi
LSGRM
Commits
d1d34cb0
Commit
d1d34cb0
authored
Sep 06, 2016
by
remicres
Browse files
ADD: Function dedicated to availaible memory in controller
parent
77ed5ba2
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/lsgrmController.h
View file @
d1d34cb0
...
...
@@ -89,6 +89,7 @@ private:
void
GetAutomaticConfiguration
();
void
ComputeMaximumStabilityMargin
(
unsigned
int
width
,
unsigned
int
height
,
unsigned
int
&
iter
,
unsigned
int
&
margin
);
void
CheckMemorySize
();
unsigned
int
GetNodeMemory
();
long
unsigned
int
GetMaximumNumberOfNodesInMemory
();
...
...
include/lsgrmController.txx
View file @
d1d34cb0
...
...
@@ -39,6 +39,8 @@ void Controller<TSegmenter>::RunSegmentation()
{
itkDebugMacro(<< "Entering RunSegmentation()");
CheckMemorySize();
if (m_TilingMode == LSGRM_TILING_AUTO || m_TilingMode == LSGRM_TILING_USER)
{
if(m_TilingMode == LSGRM_TILING_AUTO)
...
...
@@ -252,23 +254,25 @@ unsigned int Controller<TSegmenter>::GetNodeMemory()
return memory;
}
/*
* Compute the maximum number of nodes which can fit in the system memory
*/
template<class TSegmenter>
long unsigned int
Controller<TSegmenter>::
GetMaximumNumberOfNodesIn
Memory()
void
Controller<TSegmenter>::
Check
Memory
Size
()
{
itkDebugMacro(<< "Computing maximum number of nodes in memory");
if (m_Memory == 0)
{
m_Memory = getMemorySize();
assert(m_Memory > 0);
}
m_Memory /= 2; // For safety and can prevent out of memory troubles
}
/*
* Compute the maximum number of nodes which can fit in the memory
*/
template<class TSegmenter>
long unsigned int Controller<TSegmenter>::GetMaximumNumberOfNodesInMemory()
{
itkDebugMacro(<< "Computing maximum number of nodes in memory");
return std::ceil(((float) m_Memory) / ((float) GetNodeMemory()));
}
template<class TSegmenter>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment