Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
fbb2a356
Commit
fbb2a356
authored
Nov 24, 2019
by
Tianqi Chen
Committed by
Yizhi Liu
Nov 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[RUNTIME] rename allocator.make -> allocator.make_object for term consistency (#4416)
parent
34c636d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
include/tvm/runtime/memory.h
+3
-2
src/runtime/vm/vm.cc
+1
-1
No files found.
include/tvm/runtime/memory.h
View file @
fbb2a356
...
...
@@ -58,12 +58,13 @@ template<typename Derived>
class
ObjAllocatorBase
{
public
:
/*!
* \brief Make a new object using the allocator.
* \tparam T The type to be allocated.
* \tparam Args The constructor signature.
* \param args The arguments.
*/
template
<
typename
T
,
typename
...
Args
>
inline
ObjectPtr
<
T
>
make
(
Args
&&
...
args
)
{
inline
ObjectPtr
<
T
>
make
_object
(
Args
&&
...
args
)
{
using
Handler
=
typename
Derived
::
template
Handler
<
T
>
;
static_assert
(
std
::
is_base_of
<
Object
,
T
>::
value
,
"make_node can only be used to create NodeBase"
);
...
...
@@ -126,7 +127,7 @@ class SimpleObjAllocator :
template
<
typename
T
,
typename
...
Args
>
inline
ObjectPtr
<
T
>
make_object
(
Args
&&
...
args
)
{
return
SimpleObjAllocator
().
make
<
T
>
(
std
::
forward
<
Args
>
(
args
)...);
return
SimpleObjAllocator
().
make
_object
<
T
>
(
std
::
forward
<
Args
>
(
args
)...);
}
}
// namespace runtime
...
...
src/runtime/vm/vm.cc
View file @
fbb2a356
...
...
@@ -47,7 +47,7 @@ namespace vm {
inline
Storage
make_storage
(
size_t
size
,
size_t
alignment
,
TVMType
dtype_hint
,
TVMContext
ctx
)
{
// We could put cache in here, from ctx to storage allocator.
auto
storage_obj
=
SimpleObjAllocator
().
make
<
StorageObj
>
();
auto
storage_obj
=
SimpleObjAllocator
().
make
_object
<
StorageObj
>
();
auto
alloc
=
MemoryManager
::
Global
()
->
GetAllocator
(
ctx
);
DCHECK
(
alloc
!=
nullptr
)
<<
"allocator must not null"
;
...
...
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