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
4865f958
Commit
4865f958
authored
Oct 08, 2017
by
Tianqi Chen
Committed by
GitHub
Oct 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUILD] Windows support of DLL exports (#522)
parent
99119fa2
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
83 additions
and
81 deletions
+83
-81
CMakeLists.txt
+2
-0
HalideIR
+1
-1
include/tvm/buffer.h
+17
-17
include/tvm/expr.h
+8
-8
include/tvm/ir.h
+7
-7
include/tvm/ir_mutator.h
+1
-1
include/tvm/ir_operator.h
+3
-3
include/tvm/ir_visitor.h
+1
-1
include/tvm/operation.h
+17
-17
include/tvm/runtime/device_api.h
+3
-3
include/tvm/runtime/module.h
+7
-7
include/tvm/runtime/packed_func.h
+2
-2
include/tvm/runtime/registry.h
+5
-5
include/tvm/target_info.h
+1
-1
include/tvm/tensor.h
+7
-7
python/setup.py
+1
-1
No files found.
CMakeLists.txt
View file @
4865f958
...
@@ -44,6 +44,8 @@ if(MSVC)
...
@@ -44,6 +44,8 @@ if(MSVC)
add_definitions
(
-D_CRT_SECURE_NO_WARNINGS
)
add_definitions
(
-D_CRT_SECURE_NO_WARNINGS
)
add_definitions
(
-D_SCL_SECURE_NO_WARNINGS
)
add_definitions
(
-D_SCL_SECURE_NO_WARNINGS
)
add_definitions
(
-DTVM_EXPORTS
)
add_definitions
(
-DTVM_EXPORTS
)
add_definitions
(
-DHalide_SHARED
)
add_definitions
(
-DHalide_EXPORTS
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/EHsc"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/EHsc"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/MP"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/MP"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
/bigobj"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
/bigobj"
)
...
...
HalideIR
@
dbf043a8
Subproject commit
cb3c025d5b91ab994b063a85bc935fc364d8f491
Subproject commit
dbf043a8d8bf379b05c56d8aa9025db55f589d6d
include/tvm/buffer.h
View file @
4865f958
...
@@ -37,7 +37,7 @@ class Buffer : public NodeRef {
...
@@ -37,7 +37,7 @@ class Buffer : public NodeRef {
* but always add stride field.
* but always add stride field.
* \return The strided version of the buffer.
* \return The strided version of the buffer.
*/
*/
Buffer
MakeStrideView
()
const
;
TVM_DLL
Buffer
MakeStrideView
()
const
;
/*!
/*!
* \brief Make a new symbolic buffer representing a slice of the buffer.
* \brief Make a new symbolic buffer representing a slice of the buffer.
* \param begins The beginning position of each dimension.
* \param begins The beginning position of each dimension.
...
@@ -46,25 +46,25 @@ class Buffer : public NodeRef {
...
@@ -46,25 +46,25 @@ class Buffer : public NodeRef {
* If stride is not needed in the slice, it won't be presented
* If stride is not needed in the slice, it won't be presented
* \return the result buffer.
* \return the result buffer.
*/
*/
Buffer
MakeSlice
(
Array
<
Expr
>
begins
,
Array
<
Expr
>
extents
)
const
;
TVM_DLL
Buffer
MakeSlice
(
Array
<
Expr
>
begins
,
Array
<
Expr
>
extents
)
const
;
/*!
/*!
* \brief Get access ptr to the entire buffer.
* \brief Get access ptr to the entire buffer.
* \param access_mask The access mask
* \param access_mask The access mask
* \param ptr_type The type of the pointer.
* \param ptr_type The type of the pointer.
*/
*/
Expr
access_ptr
(
int
access_mask
,
Type
ptr_type
=
Handle
())
const
;
TVM_DLL
Expr
access_ptr
(
int
access_mask
,
Type
ptr_type
=
Handle
())
const
;
/*!
/*!
* \brief Create an Expr that does a vector load at begin index.
* \brief Create an Expr that does a vector load at begin index.
* \param begin The beginning index
* \param begin The beginning index
* \param dtype The data type to be loaded.
* \param dtype The data type to be loaded.
*/
*/
Expr
vload
(
Array
<
Expr
>
begin
,
Type
dtype
)
const
;
TVM_DLL
Expr
vload
(
Array
<
Expr
>
begin
,
Type
dtype
)
const
;
/*!
/*!
* \brief Create a Stmt that does a vector store at begin index.
* \brief Create a Stmt that does a vector store at begin index.
* \param begin The beginning index
* \param begin The beginning index
* \param value The value to be stored.
* \param value The value to be stored.
*/
*/
Stmt
vstore
(
Array
<
Expr
>
begin
,
Expr
value
)
const
;
TVM_DLL
Stmt
vstore
(
Array
<
Expr
>
begin
,
Expr
value
)
const
;
/*!
/*!
* \brief access the internal node container
* \brief access the internal node container
* \return the pointer to the internal node container
* \return the pointer to the internal node container
...
@@ -124,15 +124,15 @@ class BufferNode : public Node {
...
@@ -124,15 +124,15 @@ class BufferNode : public Node {
// User can specify data_alignment and offset_factor to be 0
// User can specify data_alignment and offset_factor to be 0
// A default value will be picked.
// A default value will be picked.
static
Buffer
make
(
Var
ptr
,
TVM_DLL
static
Buffer
make
(
Var
ptr
,
Type
dtype
,
Type
dtype
,
Array
<
Expr
>
shape
,
Array
<
Expr
>
shape
,
Array
<
Expr
>
strides
,
Array
<
Expr
>
strides
,
Expr
byte_offset
,
Expr
byte_offset
,
std
::
string
name
,
std
::
string
name
,
std
::
string
scope
,
std
::
string
scope
,
int
data_alignment
,
int
data_alignment
,
int
offset_factor
);
int
offset_factor
);
static
constexpr
const
char
*
_type_key
=
"Buffer"
;
static
constexpr
const
char
*
_type_key
=
"Buffer"
;
TVM_DECLARE_NODE_TYPE_INFO
(
BufferNode
,
Node
);
TVM_DECLARE_NODE_TYPE_INFO
(
BufferNode
,
Node
);
...
@@ -150,8 +150,8 @@ inline const BufferNode* Buffer::operator->() const {
...
@@ -150,8 +150,8 @@ inline const BufferNode* Buffer::operator->() const {
* \return The created buffer.
* \return The created buffer.
* \sa BufferNode::make for complete constructor.
* \sa BufferNode::make for complete constructor.
*/
*/
Buffer
decl_buffer
(
Array
<
Expr
>
shape
,
TVM_DLL
Buffer
decl_buffer
(
Array
<
Expr
>
shape
,
Type
dtype
=
Float
(
32
),
Type
dtype
=
Float
(
32
),
std
::
string
name
=
"buffer"
);
std
::
string
name
=
"buffer"
);
}
// namespace tvm
}
// namespace tvm
#endif // TVM_BUFFER_H_
#endif // TVM_BUFFER_H_
include/tvm/expr.h
View file @
4865f958
...
@@ -112,9 +112,9 @@ class Range : public Halide::IR::Range {
...
@@ -112,9 +112,9 @@ class Range : public Halide::IR::Range {
* \param begin The begin of the range.
* \param begin The begin of the range.
* \param end The end of the range.
* \param end The end of the range.
*/
*/
Range
(
Expr
begin
,
Expr
end
);
TVM_DLL
Range
(
Expr
begin
,
Expr
end
);
static
Range
make_by_min_extent
(
Expr
min
,
Expr
extent
);
TVM_DLL
static
Range
make_by_min_extent
(
Expr
min
,
Expr
extent
);
};
};
/*!
/*!
...
@@ -216,7 +216,7 @@ class IterVar : public NodeRef {
...
@@ -216,7 +216,7 @@ class IterVar : public NodeRef {
* \param dom Optional, domain of the thread axis.
* \param dom Optional, domain of the thread axis.
* \param tag The thread tag of the axis.
* \param tag The thread tag of the axis.
*/
*/
IterVar
thread_axis
(
Range
dom
,
std
::
string
tag
);
TVM_DLL
IterVar
thread_axis
(
Range
dom
,
std
::
string
tag
);
/*!
/*!
* \brief Create a new IterVar for reduction operations.
* \brief Create a new IterVar for reduction operations.
...
@@ -224,12 +224,12 @@ IterVar thread_axis(Range dom, std::string tag);
...
@@ -224,12 +224,12 @@ IterVar thread_axis(Range dom, std::string tag);
* \param dom The domain of the reduction axis.
* \param dom The domain of the reduction axis.
* \param name The name of the reduction axis.
* \param name The name of the reduction axis.
*/
*/
IterVar
reduce_axis
(
Range
dom
,
std
::
string
name
=
"rv"
);
TVM_DLL
IterVar
reduce_axis
(
Range
dom
,
std
::
string
name
=
"rv"
);
using
Domain
=
Array
<
Range
>
;
using
Domain
=
Array
<
Range
>
;
// print functions for expr
// print functions for expr
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
NodeRef
&
n
);
// NOLINT(*)
TVM_DLL
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
NodeRef
&
n
);
// NOLINT(*)
// definition of Node.
// definition of Node.
/*!
/*!
* \brief An iteration variable representing an iteration
* \brief An iteration variable representing an iteration
...
@@ -259,9 +259,9 @@ class IterVarNode : public Node {
...
@@ -259,9 +259,9 @@ class IterVarNode : public Node {
v
->
Visit
(
"thread_tag"
,
&
thread_tag
);
v
->
Visit
(
"thread_tag"
,
&
thread_tag
);
}
}
static
IterVar
make
(
Range
dom
,
Var
var
,
TVM_DLL
static
IterVar
make
(
Range
dom
,
Var
var
,
IterVarType
iter_type
,
IterVarType
iter_type
,
std
::
string
thread_tag
=
""
);
std
::
string
thread_tag
=
""
);
static
constexpr
const
char
*
_type_key
=
"IterVar"
;
static
constexpr
const
char
*
_type_key
=
"IterVar"
;
TVM_DECLARE_NODE_TYPE_INFO
(
IterVarNode
,
Node
);
TVM_DECLARE_NODE_TYPE_INFO
(
IterVarNode
,
Node
);
...
...
include/tvm/ir.h
View file @
4865f958
...
@@ -62,8 +62,8 @@ struct CommReducerNode : public Node {
...
@@ -62,8 +62,8 @@ struct CommReducerNode : public Node {
/*! \brief Function call operator to combine a and b */
/*! \brief Function call operator to combine a and b */
Array
<
Expr
>
operator
()(
Array
<
Expr
>
a
,
Array
<
Expr
>
b
)
const
;
Array
<
Expr
>
operator
()(
Array
<
Expr
>
a
,
Array
<
Expr
>
b
)
const
;
/*! \brief construct CommReducer from args, result and identity_element */
/*! \brief construct CommReducer from args, result and identity_element */
static
CommReducer
make
(
Array
<
Var
>
lhs
,
Array
<
Var
>
rhs
,
TVM_DLL
static
CommReducer
make
(
Array
<
Var
>
lhs
,
Array
<
Var
>
rhs
,
Array
<
Expr
>
result
,
Array
<
Expr
>
identity_element
);
Array
<
Expr
>
result
,
Array
<
Expr
>
identity_element
);
void
VisitAttrs
(
AttrVisitor
*
v
)
final
{
void
VisitAttrs
(
AttrVisitor
*
v
)
final
{
v
->
Visit
(
"lhs"
,
&
lhs
);
v
->
Visit
(
"lhs"
,
&
lhs
);
...
@@ -100,11 +100,11 @@ struct Reduce : public ExprNode<Reduce> {
...
@@ -100,11 +100,11 @@ struct Reduce : public ExprNode<Reduce> {
int
value_index
;
int
value_index
;
/*! \brief construct expr from op and rdom */
/*! \brief construct expr from op and rdom */
static
Expr
make
(
CommReducer
combiner
,
TVM_DLL
static
Expr
make
(
CommReducer
combiner
,
Array
<
Expr
>
src
,
Array
<
Expr
>
src
,
Array
<
IterVar
>
rdom
,
Array
<
IterVar
>
rdom
,
Expr
condition
,
Expr
condition
,
int
value_index
);
int
value_index
);
void
VisitAttrs
(
AttrVisitor
*
v
)
final
{
void
VisitAttrs
(
AttrVisitor
*
v
)
final
{
v
->
Visit
(
"dtype"
,
&
type
);
v
->
Visit
(
"dtype"
,
&
type
);
...
...
include/tvm/ir_mutator.h
View file @
4865f958
...
@@ -25,7 +25,7 @@ namespace ir {
...
@@ -25,7 +25,7 @@ namespace ir {
* Simply following the same pattern as IRMutator and create a seperate class.
* Simply following the same pattern as IRMutator and create a seperate class.
* \sa IRFunctor
* \sa IRFunctor
*/
*/
class
IRMutator
{
class
TVM_DLL
IRMutator
{
public
:
public
:
/*!
/*!
* \brief mutate expression
* \brief mutate expression
...
...
include/tvm/ir_operator.h
View file @
4865f958
...
@@ -26,21 +26,21 @@ using Halide::select;
...
@@ -26,21 +26,21 @@ using Halide::select;
* \param source The source expression.
* \param source The source expression.
* \param axis List of iteration variables that will be used for reduction.
* \param axis List of iteration variables that will be used for reduction.
*/
*/
Expr
sum
(
Expr
source
,
Array
<
IterVar
>
axis
);
TVM_DLL
Expr
sum
(
Expr
source
,
Array
<
IterVar
>
axis
);
/*!
/*!
* \brief max of of source expression over axis
* \brief max of of source expression over axis
* \param source The source expression.
* \param source The source expression.
* \param axis List of iteration variables that will be used for reduction.
* \param axis List of iteration variables that will be used for reduction.
*/
*/
Expr
max
(
Expr
source
,
Array
<
IterVar
>
axis
);
TVM_DLL
Expr
max
(
Expr
source
,
Array
<
IterVar
>
axis
);
/*!
/*!
* \brief max of of source expression over axis
* \brief max of of source expression over axis
* \param source The source expression.
* \param source The source expression.
* \param axis List of iteration variables that will be used for reduction.
* \param axis List of iteration variables that will be used for reduction.
*/
*/
Expr
min
(
Expr
source
,
Array
<
IterVar
>
axis
);
TVM_DLL
Expr
min
(
Expr
source
,
Array
<
IterVar
>
axis
);
// Unary intrinsic operators
// Unary intrinsic operators
#define TVM_DECLARE_INTRIN_UNARY(OpName) \
#define TVM_DECLARE_INTRIN_UNARY(OpName) \
...
...
include/tvm/ir_visitor.h
View file @
4865f958
...
@@ -64,7 +64,7 @@ namespace ir {
...
@@ -64,7 +64,7 @@ namespace ir {
*
*
* \endcode
* \endcode
*/
*/
class
IRVisitor
{
class
TVM_DLL
IRVisitor
{
public
:
public
:
/*!
/*!
* \brief recursively visit an IR node
* \brief recursively visit an IR node
...
...
include/tvm/operation.h
View file @
4865f958
...
@@ -376,9 +376,9 @@ using FBatchCompute = std::function<Array<Expr> (const Array<Var>& i)>;
...
@@ -376,9 +376,9 @@ using FBatchCompute = std::function<Array<Expr> (const Array<Var>& i)>;
* \param dtype the data type of the tensor.
* \param dtype the data type of the tensor.
* \param name The name of the Tensor.
* \param name The name of the Tensor.
*/
*/
Tensor
placeholder
(
Array
<
Expr
>
shape
,
T
VM_DLL
T
ensor
placeholder
(
Array
<
Expr
>
shape
,
Type
dtype
=
Float
(
32
),
Type
dtype
=
Float
(
32
),
std
::
string
name
=
"placeholder"
);
std
::
string
name
=
"placeholder"
);
/*!
/*!
* \brief Construct a new tensor by computing over shape,
* \brief Construct a new tensor by computing over shape,
...
@@ -388,10 +388,10 @@ Tensor placeholder(Array<Expr> shape,
...
@@ -388,10 +388,10 @@ Tensor placeholder(Array<Expr> shape,
* \param name The optional name of the tensor.
* \param name The optional name of the tensor.
* \param tag The optional tag of the tensor.
* \param tag The optional tag of the tensor.
*/
*/
Tensor
compute
(
Array
<
Expr
>
shape
,
T
VM_DLL
T
ensor
compute
(
Array
<
Expr
>
shape
,
FCompute
fcompute
,
FCompute
fcompute
,
std
::
string
name
=
"tensor"
,
std
::
string
name
=
"tensor"
,
std
::
string
tag
=
""
);
std
::
string
tag
=
""
);
/*!
/*!
* \brief Construct a new tensor by computing over shape,
* \brief Construct a new tensor by computing over shape,
...
@@ -401,10 +401,10 @@ Tensor compute(Array<Expr> shape,
...
@@ -401,10 +401,10 @@ Tensor compute(Array<Expr> shape,
* \param name The optional name of the tensor.
* \param name The optional name of the tensor.
* \param tag The optional tag of the tensor.
* \param tag The optional tag of the tensor.
*/
*/
Array
<
Tensor
>
compute
(
Array
<
Expr
>
shape
,
TVM_DLL
Array
<
Tensor
>
compute
(
Array
<
Expr
>
shape
,
FBatchCompute
fcompute
,
FBatchCompute
fcompute
,
std
::
string
name
=
"tensor"
,
std
::
string
name
=
"tensor"
,
std
::
string
tag
=
""
);
std
::
string
tag
=
""
);
/*!
/*!
* \brief Construct new tensors by scan.
* \brief Construct new tensors by scan.
...
@@ -417,12 +417,12 @@ Array<Tensor> compute(Array<Expr> shape,
...
@@ -417,12 +417,12 @@ Array<Tensor> compute(Array<Expr> shape,
* \param name The optional name of the tensor.
* \param name The optional name of the tensor.
* \param tag The optional tag of the tensor.
* \param tag The optional tag of the tensor.
*/
*/
Array
<
Tensor
>
scan
(
Array
<
Tensor
>
init
,
TVM_DLL
Array
<
Tensor
>
scan
(
Array
<
Tensor
>
init
,
Array
<
Tensor
>
update
,
Array
<
Tensor
>
update
,
Array
<
Tensor
>
state_placeholder
,
Array
<
Tensor
>
state_placeholder
,
Array
<
Tensor
>
inputs
=
Array
<
Tensor
>
(),
Array
<
Tensor
>
inputs
=
Array
<
Tensor
>
(),
std
::
string
name
=
"scan"
,
std
::
string
name
=
"scan"
,
std
::
string
tag
=
""
);
std
::
string
tag
=
""
);
// same as compute, specialized for different fcompute function
// same as compute, specialized for different fcompute function
inline
Tensor
compute
(
Array
<
Expr
>
shape
,
inline
Tensor
compute
(
Array
<
Expr
>
shape
,
...
...
include/tvm/runtime/device_api.h
View file @
4865f958
...
@@ -111,21 +111,21 @@ class DeviceAPI {
...
@@ -111,21 +111,21 @@ class DeviceAPI {
* \param ctx The context of allocation.
* \param ctx The context of allocation.
* \param size The size to be allocated.
* \param size The size to be allocated.
*/
*/
virtual
void
*
AllocWorkspace
(
TVMContext
ctx
,
size_t
size
);
TVM_DLL
virtual
void
*
AllocWorkspace
(
TVMContext
ctx
,
size_t
size
);
/*!
/*!
* \brief Free temporal workspace in backend execution.
* \brief Free temporal workspace in backend execution.
*
*
* \param ctx The context of allocation.
* \param ctx The context of allocation.
* \param ptr The pointer to be freed.
* \param ptr The pointer to be freed.
*/
*/
virtual
void
FreeWorkspace
(
TVMContext
ctx
,
void
*
ptr
);
TVM_DLL
virtual
void
FreeWorkspace
(
TVMContext
ctx
,
void
*
ptr
);
/*!
/*!
* \brief Get device API base don context.
* \brief Get device API base don context.
* \param ctx The context
* \param ctx The context
* \param allow_missing Whether allow missing
* \param allow_missing Whether allow missing
* \return The corresponding device API.
* \return The corresponding device API.
*/
*/
static
DeviceAPI
*
Get
(
TVMContext
ctx
,
bool
allow_missing
=
false
);
TVM_DLL
static
DeviceAPI
*
Get
(
TVMContext
ctx
,
bool
allow_missing
=
false
);
};
};
/*! \brief The device type bigger than this is RPC device */
/*! \brief The device type bigger than this is RPC device */
...
...
include/tvm/runtime/module.h
View file @
4865f958
...
@@ -39,7 +39,7 @@ class Module {
...
@@ -39,7 +39,7 @@ class Module {
* \return The result function.
* \return The result function.
* This function will return PackedFunc(nullptr) if function do not exist.
* This function will return PackedFunc(nullptr) if function do not exist.
*/
*/
PackedFunc
GetFunction
(
const
std
::
string
&
name
,
bool
query_imports
=
false
);
TVM_DLL
PackedFunc
GetFunction
(
const
std
::
string
&
name
,
bool
query_imports
=
false
);
/*!
/*!
* \brief Import another module into this module.
* \brief Import another module into this module.
* \param other The module to be imported.
* \param other The module to be imported.
...
@@ -47,7 +47,7 @@ class Module {
...
@@ -47,7 +47,7 @@ class Module {
* \note Cyclic dependency is not allowed among modules,
* \note Cyclic dependency is not allowed among modules,
* An error will be thrown when cyclic dependency is detected.
* An error will be thrown when cyclic dependency is detected.
*/
*/
void
Import
(
Module
other
);
TVM_DLL
void
Import
(
Module
other
);
/*!
/*!
* \brief Load a module from file.
* \brief Load a module from file.
* \param file_name The name of the host function module.
* \param file_name The name of the host function module.
...
@@ -55,8 +55,8 @@ class Module {
...
@@ -55,8 +55,8 @@ class Module {
* \note This function won't load the import relationship.
* \note This function won't load the import relationship.
* Re-create import relationship by calling Import.
* Re-create import relationship by calling Import.
*/
*/
static
Module
LoadFromFile
(
const
std
::
string
&
file_name
,
TVM_DLL
static
Module
LoadFromFile
(
const
std
::
string
&
file_name
,
const
std
::
string
&
format
=
""
);
const
std
::
string
&
format
=
""
);
/*! \return internal container */
/*! \return internal container */
inline
ModuleNode
*
operator
->
();
inline
ModuleNode
*
operator
->
();
/*! \return internal container */
/*! \return internal container */
...
@@ -110,13 +110,13 @@ class ModuleNode {
...
@@ -110,13 +110,13 @@ class ModuleNode {
* but not necessarily host modules.
* but not necessarily host modules.
* We can use this to do AOT loading of bundled device functions.
* We can use this to do AOT loading of bundled device functions.
*/
*/
virtual
void
SaveToBinary
(
dmlc
::
Stream
*
stream
);
TVM_DLL
virtual
void
SaveToBinary
(
dmlc
::
Stream
*
stream
);
/*!
/*!
* \brief Get the source code of module, when available.
* \brief Get the source code of module, when available.
* \param format Format of the source code, can be empty by default.
* \param format Format of the source code, can be empty by default.
* \return Possible source code when available.
* \return Possible source code when available.
*/
*/
virtual
std
::
string
GetSource
(
const
std
::
string
&
format
=
""
);
TVM_DLL
virtual
std
::
string
GetSource
(
const
std
::
string
&
format
=
""
);
/*!
/*!
* \brief Get a function from current environment
* \brief Get a function from current environment
* The environment includes all the imports as well as Global functions.
* The environment includes all the imports as well as Global functions.
...
@@ -124,7 +124,7 @@ class ModuleNode {
...
@@ -124,7 +124,7 @@ class ModuleNode {
* \param name name of the function.
* \param name name of the function.
* \return The corresponding function.
* \return The corresponding function.
*/
*/
const
PackedFunc
*
GetFuncFromEnv
(
const
std
::
string
&
name
);
TVM_DLL
const
PackedFunc
*
GetFuncFromEnv
(
const
std
::
string
&
name
);
/*! \return The module it imports from */
/*! \return The module it imports from */
const
std
::
vector
<
Module
>&
imports
()
const
{
const
std
::
vector
<
Module
>&
imports
()
const
{
return
imports_
;
return
imports_
;
...
...
include/tvm/runtime/packed_func.h
View file @
4865f958
...
@@ -203,11 +203,11 @@ class ExtTypeVTable {
...
@@ -203,11 +203,11 @@ class ExtTypeVTable {
* \param type_code The type code
* \param type_code The type code
* \return The registered vtable.
* \return The registered vtable.
*/
*/
static
ExtTypeVTable
*
Get
(
int
type_code
);
TVM_DLL
static
ExtTypeVTable
*
Get
(
int
type_code
);
private
:
private
:
// Internal registration function.
// Internal registration function.
static
ExtTypeVTable
*
RegisterInternal
(
int
type_code
,
const
ExtTypeVTable
&
vt
);
TVM_DLL
static
ExtTypeVTable
*
RegisterInternal
(
int
type_code
,
const
ExtTypeVTable
&
vt
);
};
};
/*!
/*!
...
...
include/tvm/runtime/registry.h
View file @
4865f958
...
@@ -39,7 +39,7 @@ class Registry {
...
@@ -39,7 +39,7 @@ class Registry {
* \brief set the body of the function to be f
* \brief set the body of the function to be f
* \param f The body of the function.
* \param f The body of the function.
*/
*/
Registry
&
set_body
(
PackedFunc
f
);
// NOLINT(*)
TVM_DLL
Registry
&
set_body
(
PackedFunc
f
);
// NOLINT(*)
/*!
/*!
* \brief set the body of the function to be f
* \brief set the body of the function to be f
* \param f The body of the function.
* \param f The body of the function.
...
@@ -53,25 +53,25 @@ class Registry {
...
@@ -53,25 +53,25 @@ class Registry {
* \param override Whether allow oveeride existing function.
* \param override Whether allow oveeride existing function.
* \return Reference to theregistry.
* \return Reference to theregistry.
*/
*/
static
Registry
&
Register
(
const
std
::
string
&
name
,
bool
override
=
false
);
// NOLINT(*)
TVM_DLL
static
Registry
&
Register
(
const
std
::
string
&
name
,
bool
override
=
false
);
// NOLINT(*)
/*!
/*!
* \brief Erase global function from registry, if exist.
* \brief Erase global function from registry, if exist.
* \param name The name of the function.
* \param name The name of the function.
* \return Whether function exist.
* \return Whether function exist.
*/
*/
static
bool
Remove
(
const
std
::
string
&
name
);
TVM_DLL
static
bool
Remove
(
const
std
::
string
&
name
);
/*!
/*!
* \brief Get the global function by name.
* \brief Get the global function by name.
* \param name The name of the function.
* \param name The name of the function.
* \return pointer to the registered function,
* \return pointer to the registered function,
* nullptr if it does not exist.
* nullptr if it does not exist.
*/
*/
static
const
PackedFunc
*
Get
(
const
std
::
string
&
name
);
// NOLINT(*)
TVM_DLL
static
const
PackedFunc
*
Get
(
const
std
::
string
&
name
);
// NOLINT(*)
/*!
/*!
* \brief Get the names of currently registered global function.
* \brief Get the names of currently registered global function.
* \return The names
* \return The names
*/
*/
static
std
::
vector
<
std
::
string
>
ListNames
();
TVM_DLL
static
std
::
vector
<
std
::
string
>
ListNames
();
// Internal class.
// Internal class.
struct
Manager
;
struct
Manager
;
...
...
include/tvm/target_info.h
View file @
4865f958
...
@@ -48,7 +48,7 @@ TVM_DEFINE_NODE_REF(MemoryInfo, MemoryInfoNode);
...
@@ -48,7 +48,7 @@ TVM_DEFINE_NODE_REF(MemoryInfo, MemoryInfoNode);
* \param scope The scope name.
* \param scope The scope name.
* \return info The memory info.
* \return info The memory info.
*/
*/
MemoryInfo
GetMemoryInfo
(
const
std
::
string
&
scope
);
TVM_DLL
MemoryInfo
GetMemoryInfo
(
const
std
::
string
&
scope
);
}
// namespace tvm
}
// namespace tvm
#endif // TVM_TARGET_INFO_H_
#endif // TVM_TARGET_INFO_H_
include/tvm/tensor.h
View file @
4865f958
...
@@ -62,13 +62,13 @@ class Tensor : public NodeRef {
...
@@ -62,13 +62,13 @@ class Tensor : public NodeRef {
* \param indices the indices.
* \param indices the indices.
* \return the result expression representing tensor read.
* \return the result expression representing tensor read.
*/
*/
Expr
operator
()(
Array
<
Expr
>
indices
)
const
;
TVM_DLL
Expr
operator
()(
Array
<
Expr
>
indices
)
const
;
/*!
/*!
* \brief Take elements from the tensor
* \brief Take elements from the tensor
* \param indices the indices.
* \param indices the indices.
* \return the result expression representing tensor read.
* \return the result expression representing tensor read.
*/
*/
Expr
operator
()(
Array
<
Var
>
indices
)
const
;
TVM_DLL
Expr
operator
()(
Array
<
Var
>
indices
)
const
;
/*!
/*!
* \brief data structure to represent a slice that fixes first k coordinates.
* \brief data structure to represent a slice that fixes first k coordinates.
* This is used to enable syntax sugar of Tensor[x][y][z] to get the element.
* This is used to enable syntax sugar of Tensor[x][y][z] to get the element.
...
@@ -129,7 +129,7 @@ class Operation : public FunctionRef {
...
@@ -129,7 +129,7 @@ class Operation : public FunctionRef {
* \param i the output index.
* \param i the output index.
* \return The i-th output.
* \return The i-th output.
*/
*/
Tensor
output
(
size_t
i
)
const
;
T
VM_DLL
T
ensor
output
(
size_t
i
)
const
;
/*! \brief specify container node */
/*! \brief specify container node */
using
ContainerType
=
OperationNode
;
using
ContainerType
=
OperationNode
;
};
};
...
@@ -154,10 +154,10 @@ class TensorNode : public Node {
...
@@ -154,10 +154,10 @@ class TensorNode : public Node {
v
->
Visit
(
"op"
,
&
op
);
v
->
Visit
(
"op"
,
&
op
);
v
->
Visit
(
"value_index"
,
&
value_index
);
v
->
Visit
(
"value_index"
,
&
value_index
);
}
}
static
Tensor
make
(
Array
<
Expr
>
shape
,
TVM_DLL
static
Tensor
make
(
Array
<
Expr
>
shape
,
Type
dtype
,
Type
dtype
,
Operation
op
,
Operation
op
,
int
value_index
);
int
value_index
);
static
constexpr
const
char
*
_type_key
=
"Tensor"
;
static
constexpr
const
char
*
_type_key
=
"Tensor"
;
TVM_DECLARE_NODE_TYPE_INFO
(
TensorNode
,
Node
);
TVM_DECLARE_NODE_TYPE_INFO
(
TensorNode
,
Node
);
...
...
python/setup.py
View file @
4865f958
...
@@ -18,7 +18,7 @@ else:
...
@@ -18,7 +18,7 @@ else:
from
setuptools
import
setup
from
setuptools
import
setup
from
setuptools.extension
import
Extension
from
setuptools.extension
import
Extension
# We can not import `
mxnet.info.py` in setup.py directly since mxnet/
__init__.py
# We can not import `
libinfo.py` in setup.py directly since
__init__.py
# Will be invoked which introduces dependences
# Will be invoked which introduces dependences
CURRENT_DIR
=
os
.
path
.
dirname
(
__file__
)
CURRENT_DIR
=
os
.
path
.
dirname
(
__file__
)
libinfo_py
=
os
.
path
.
join
(
CURRENT_DIR
,
'./tvm/_ffi/libinfo.py'
)
libinfo_py
=
os
.
path
.
join
(
CURRENT_DIR
,
'./tvm/_ffi/libinfo.py'
)
...
...
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