tvm
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
a
b
c
d
e
f
h
i
k
l
m
n
p
r
s
t
v
w
Typedefs
a
b
c
d
e
f
g
i
k
m
o
p
r
s
t
Enumerations
a
b
c
d
e
f
i
l
m
o
p
s
t
Enumerator
b
f
k
n
s
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Typedefs
b
c
d
e
f
i
k
l
m
o
p
r
s
t
v
w
Enumerations
Enumerator
Related Functions
:
a
b
c
d
e
g
i
l
m
n
o
p
r
s
t
v
w
Files
File List
File Members
All
_
d
e
f
g
i
k
l
m
n
p
r
s
t
u
v
Functions
_
m
p
s
t
Variables
Typedefs
Enumerations
Enumerator
k
t
Macros
d
e
i
l
n
p
r
s
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
tvm
runtime
crt
platform.h
Go to the documentation of this file.
1
/*
2
* Licensed to the Apache Software Foundation (ASF) under one
3
* or more contributor license agreements. See the NOTICE file
4
* distributed with this work for additional information
5
* regarding copyright ownership. The ASF licenses this file
6
* to you under the Apache License, Version 2.0 (the
7
* "License"); you may not use this file except in compliance
8
* with the License. You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing,
13
* software distributed under the License is distributed on an
14
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
* KIND, either express or implied. See the License for the
16
* specific language governing permissions and limitations
17
* under the License.
18
*/
19
25
#ifndef TVM_RUNTIME_CRT_PLATFORM_H_
26
#define TVM_RUNTIME_CRT_PLATFORM_H_
27
28
#include <stdarg.h>
29
#include <stddef.h>
30
#include <
tvm/runtime/c_runtime_api.h
>
31
#include <
tvm/runtime/crt/error_codes.h
>
32
33
#ifdef __cplusplus
34
extern
"C"
{
35
#endif
36
43
#if defined(_MSC_VER)
44
__declspec(noreturn)
void
TVMPlatformAbort
(
tvm_crt_error_t
code);
45
#else
46
void
__attribute__((noreturn))
TVMPlatformAbort
(
tvm_crt_error_t
code);
47
#endif
48
61
size_t
TVMPlatformFormatMessage
(
char
* out_buf,
size_t
out_buf_size_bytes,
const
char
* fmt,
62
va_list args);
63
75
tvm_crt_error_t
TVMPlatformMemoryAllocate
(
size_t
num_bytes, DLDevice dev,
void
** out_ptr);
76
84
tvm_crt_error_t
TVMPlatformMemoryFree
(
void
* ptr, DLDevice dev);
85
92
tvm_crt_error_t
TVMPlatformTimerStart
();
93
102
tvm_crt_error_t
TVMPlatformTimerStop
(
double
* elapsed_time_seconds);
103
112
tvm_crt_error_t
TVMPlatformBeforeMeasurement
();
113
121
tvm_crt_error_t
TVMPlatformAfterMeasurement
();
122
140
tvm_crt_error_t
TVMPlatformGenerateRandom
(uint8_t* buffer,
size_t
num_bytes);
141
149
tvm_crt_error_t
TVMPlatformInitialize
();
150
151
#ifdef __cplusplus
152
}
// extern "C"
153
#endif
154
155
#endif
// TVM_RUNTIME_CRT_PLATFORM_H_
c_runtime_api.h
error_codes.h
Defines integral error codes returned by the CRT.
tvm_crt_error_t
tvm_crt_error_t
Definition:
error_codes.h:50
TVMPlatformTimerStop
tvm_crt_error_t TVMPlatformTimerStop(double *elapsed_time_seconds)
Stop the running device timer and get the elapsed time (in microseconds).
TVMPlatformMemoryAllocate
tvm_crt_error_t TVMPlatformMemoryAllocate(size_t num_bytes, DLDevice dev, void **out_ptr)
Allocate memory for use by TVM.
TVMPlatformTimerStart
tvm_crt_error_t TVMPlatformTimerStart()
Start a device timer.
TVMPlatformAfterMeasurement
tvm_crt_error_t TVMPlatformAfterMeasurement()
Platform-specific after measurement call.
TVMPlatformAbort
void TVMPlatformAbort(tvm_crt_error_t code)
Called when an internal error occurs and execution cannot continue.
TVMPlatformFormatMessage
size_t TVMPlatformFormatMessage(char *out_buf, size_t out_buf_size_bytes, const char *fmt, va_list args)
Called by the microTVM RPC server to implement TVMLogf.
TVMPlatformInitialize
tvm_crt_error_t TVMPlatformInitialize()
Initialize TVM inference.
TVMPlatformMemoryFree
tvm_crt_error_t TVMPlatformMemoryFree(void *ptr, DLDevice dev)
Free memory used by TVM.
TVMPlatformGenerateRandom
tvm_crt_error_t TVMPlatformGenerateRandom(uint8_t *buffer, size_t num_bytes)
Fill a buffer with random data.
TVMPlatformBeforeMeasurement
tvm_crt_error_t TVMPlatformBeforeMeasurement()
Platform-specific before measurement call.
Generated by
1.9.1