Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
bf022034
Commit
bf022034
authored
Sep 14, 2017
by
Bob Kimball
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated per review comments
parent
f828a116
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
22 deletions
+14
-22
element_type.hpp
src/ngraph/element_type.hpp
+1
-1
assign_tensors.cpp
src/ngraph/pass/assign_tensors.cpp
+1
-1
liveness.cpp
src/ngraph/pass/liveness.cpp
+1
-1
memory_layout.cpp
src/ngraph/pass/memory_layout.cpp
+11
-19
No files found.
src/ngraph/element_type.hpp
View file @
bf022034
...
...
@@ -53,7 +53,7 @@ namespace ngraph
size_t
m_bitwidth
;
bool
m_is_float
;
bool
m_is_signed
;
std
::
string
m_cname
;
const
std
::
string
m_cname
;
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
ngraph
::
element
::
Type
&
obj
);
...
...
src/ngraph/pass/assign_tensors.cpp
View file @
bf022034
...
...
@@ -57,6 +57,6 @@ void pass::AssignTensors::check_dependencies(
if
(
!
found_propagate_types
)
{
throw
runtime_error
(
"Depen
c
ency 'PropagateTypes' not found for pass 'AssignTensors'"
);
throw
runtime_error
(
"Depen
d
ency 'PropagateTypes' not found for pass 'AssignTensors'"
);
}
}
src/ngraph/pass/liveness.cpp
View file @
bf022034
...
...
@@ -136,7 +136,7 @@ void pass::Liveness::check_dependencies(
if
(
!
found_propagate_types
)
{
throw
runtime_error
(
"Depen
c
ency 'PropagateTypes' not found for pass 'AssignTensors'"
);
throw
runtime_error
(
"Depen
d
ency 'PropagateTypes' not found for pass 'AssignTensors'"
);
}
}
...
...
src/ngraph/pass/memory_layout.cpp
View file @
bf022034
...
...
@@ -46,7 +46,7 @@ void pass::MemoryLayout::check_dependencies(
if
(
!
found_propagate_types
)
{
throw
runtime_error
(
"Depen
c
ency 'PropagateTypes' not found for pass 'AssignTensors'"
);
throw
runtime_error
(
"Depen
d
ency 'PropagateTypes' not found for pass 'AssignTensors'"
);
}
}
...
...
@@ -68,16 +68,13 @@ pass::MemoryManager::MemoryManager(size_t alignment)
size_t
pass
::
MemoryManager
::
allocate
(
size_t
size
)
{
INFO
;
size_t
rc
;
switch
(
m_scheme
)
{
case
allocation_scheme
:
:
FIRST_FIT
:
INFO
;
rc
=
first_fit
(
size
);
break
;
case
allocation_scheme
:
:
BEST_FIT
:
INFO
;
rc
=
best_fit
(
size
);
break
;
}
...
...
@@ -88,7 +85,6 @@ size_t pass::MemoryManager::best_fit(size_t size)
{
size
=
align
(
size
,
m_alignment
);
size_t
offset
=
0
;
bool
found
=
false
;
size_t
min_delta
=
numeric_limits
<
size_t
>::
max
();
auto
best_fit
=
m_node_list
.
end
();
size_t
best_offset
=
offset
;
...
...
@@ -97,7 +93,6 @@ size_t pass::MemoryManager::best_fit(size_t size)
if
(
it
->
m_state
==
block_state
::
FREE
&&
it
->
m_size
>=
size
)
{
size_t
delta
=
it
->
m_size
-
size
;
INFO
<<
"delta "
<<
delta
<<
", min_delta "
<<
min_delta
;
if
(
delta
<
min_delta
)
{
min_delta
=
delta
;
...
...
@@ -107,22 +102,21 @@ size_t pass::MemoryManager::best_fit(size_t size)
}
offset
+=
it
->
m_size
;
}
if
(
best_fit
==
m_node_list
.
end
())
{
throw
bad_alloc
();
}
else
if
(
!
found
)
if
(
min_delta
==
0
)
{
if
(
min_delta
==
0
)
{
// exact fit
best_fit
->
m_state
=
block_state
::
ALLOCATED
;
}
else
{
m_node_list
.
insert
(
best_fit
,
node
{
size
,
block_state
::
ALLOCATED
});
best_fit
->
m_size
-=
size
;
}
// exact fit
best_fit
->
m_state
=
block_state
::
ALLOCATED
;
}
else
{
m_node_list
.
insert
(
best_fit
,
node
{
size
,
block_state
::
ALLOCATED
});
best_fit
->
m_size
-=
size
;
}
m_max_allocated
=
std
::
max
(
m_max_allocated
,
best_offset
+
size
);
...
...
@@ -224,12 +218,10 @@ size_t pass::MemoryManager::align(size_t size, size_t alignment)
else
{
auto
remainder
=
size
%
alignment
;
INFO
<<
"size "
<<
size
<<
", remainder "
<<
remainder
<<
", alignment "
<<
alignment
;
if
(
remainder
>
0
)
{
size
+=
(
alignment
-
remainder
);
}
INFO
<<
"final size "
<<
size
;
}
return
size
;
}
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