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
0075d8ce
Unverified
Commit
0075d8ce
authored
Apr 17, 2020
by
Samuel
Committed by
GitHub
Apr 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CRT]Compilation warnings fixed for 32bit and 64bit compilation (#5349)
parent
baff99c8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
10 deletions
+11
-10
apps/bundle_deploy/demo_static.c
+3
-3
src/runtime/crt/crt_backend_api.c
+1
-1
src/runtime/crt/graph_runtime.c
+2
-2
src/runtime/crt/load_json.c
+1
-0
src/runtime/crt/ndarray.c
+4
-4
No files found.
apps/bundle_deploy/demo_static.c
View file @
0075d8ce
...
@@ -41,12 +41,12 @@ int main(int argc, char **argv) {
...
@@ -41,12 +41,12 @@ int main(int argc, char **argv) {
struct
timeval
t0
,
t1
,
t2
,
t3
,
t4
,
t5
;
struct
timeval
t0
,
t1
,
t2
,
t3
,
t4
,
t5
;
gettimeofday
(
&
t0
,
0
);
gettimeofday
(
&
t0
,
0
);
auto
*
handle
=
tvm_runtime_create
(
json_data
,
params_data
,
params_size
);
void
*
handle
=
tvm_runtime_create
(
json_data
,
params_data
,
params_size
);
gettimeofday
(
&
t1
,
0
);
gettimeofday
(
&
t1
,
0
);
float
input_storage
[
1
*
3
*
224
*
224
];
float
input_storage
[
1
*
3
*
224
*
224
];
FILE
*
fp
=
fopen
(
argv
[
1
],
"rb"
);
FILE
*
fp
=
fopen
(
argv
[
1
],
"rb"
);
fread
(
input_storage
,
3
*
224
*
224
,
4
,
fp
);
(
void
)
fread
(
input_storage
,
3
*
224
*
224
,
4
,
fp
);
fclose
(
fp
);
fclose
(
fp
);
DLTensor
input
;
DLTensor
input
;
...
@@ -85,7 +85,7 @@ int main(int argc, char **argv) {
...
@@ -85,7 +85,7 @@ int main(int argc, char **argv) {
float
max_iter
=
-
FLT_MAX
;
float
max_iter
=
-
FLT_MAX
;
int32_t
max_index
=
-
1
;
int32_t
max_index
=
-
1
;
for
(
auto
i
=
0
;
i
<
OUTPUT_LEN
;
++
i
)
{
for
(
int
i
=
0
;
i
<
OUTPUT_LEN
;
++
i
)
{
if
(
output_storage
[
i
]
>
max_iter
)
{
if
(
output_storage
[
i
]
>
max_iter
)
{
max_iter
=
output_storage
[
i
];
max_iter
=
output_storage
[
i
];
max_index
=
i
;
max_index
=
i
;
...
...
src/runtime/crt/crt_backend_api.c
View file @
0075d8ce
...
@@ -48,7 +48,7 @@ int TVMBackendParallelLaunch(FTVMParallelLambda flambda, void* cdata, int num_ta
...
@@ -48,7 +48,7 @@ int TVMBackendParallelLaunch(FTVMParallelLambda flambda, void* cdata, int num_ta
int
TVMBackendRegisterSystemLibSymbol
(
const
char
*
name
,
void
*
ptr
)
{
int
TVMBackendRegisterSystemLibSymbol
(
const
char
*
name
,
void
*
ptr
)
{
g_fexecs
=
vrealloc
(
g_fexecs
,
sizeof
(
TVMPackedFunc
)
*
(
g_fexecs_count
+
1
));
g_fexecs
=
vrealloc
(
g_fexecs
,
sizeof
(
TVMPackedFunc
)
*
(
g_fexecs_count
+
1
));
snprintf
(
g_fexecs
[
g_fexecs_count
].
name
,
sizeof
(
g_fexecs
[
g_fexecs_count
].
name
),
name
);
snprintf
(
g_fexecs
[
g_fexecs_count
].
name
,
sizeof
(
g_fexecs
[
g_fexecs_count
].
name
),
"%s"
,
name
);
g_fexecs
[
g_fexecs_count
].
fexec
=
ptr
;
g_fexecs
[
g_fexecs_count
].
fexec
=
ptr
;
g_fexecs_count
++
;
g_fexecs_count
++
;
return
0
;
return
0
;
...
...
src/runtime/crt/graph_runtime.c
View file @
0075d8ce
...
@@ -696,13 +696,13 @@ void TVMGraphRuntime_SetupStorage(TVMGraphRuntime * runtime) {
...
@@ -696,13 +696,13 @@ void TVMGraphRuntime_SetupStorage(TVMGraphRuntime * runtime) {
runtime
->
data_entry_count
=
runtime
->
node_row_ptr
[
runtime
->
node_row_ptr_count
-
1
];
runtime
->
data_entry_count
=
runtime
->
node_row_ptr
[
runtime
->
node_row_ptr_count
-
1
];
runtime
->
data_entry
=
vmalloc
(
sizeof
(
TVMNDArray
)
*
runtime
->
data_entry_count
);
runtime
->
data_entry
=
vmalloc
(
sizeof
(
TVMNDArray
)
*
runtime
->
data_entry_count
);
for
(
idx
=
0
;
idx
<
runtime
->
data_entry_count
;
++
idx
)
{
for
(
idx
=
0
;
idx
<
runtime
->
data_entry_count
;
++
idx
)
{
size
_t
storage_id
=
attrs
->
storage_id
[
idx
];
uint32
_t
storage_id
=
attrs
->
storage_id
[
idx
];
CHECK
(
storage_id
<
runtime
->
storage_pool_count
);
CHECK
(
storage_id
<
runtime
->
storage_pool_count
);
runtime
->
data_entry
[
idx
]
=
runtime
->
data_entry
[
idx
]
=
TVMNDArray_CreateView
(
&
(
runtime
->
storage_pool
[
storage_id
]),
TVMNDArray_CreateView
(
&
(
runtime
->
storage_pool
[
storage_id
]),
attrs
->
shape
+
idx
*
TVM_CRT_MAX_NDIM
,
attrs
->
ndim
[
idx
],
vtype
[
idx
]);
attrs
->
shape
+
idx
*
TVM_CRT_MAX_NDIM
,
attrs
->
ndim
[
idx
],
vtype
[
idx
]);
CHECK_NE
(
runtime
->
data_entry
[
idx
].
dl_tensor
.
data
,
0
,
CHECK_NE
(
runtime
->
data_entry
[
idx
].
dl_tensor
.
data
,
0
,
"fail to create for node with idx=%d, storage_id=%
l
u
\n
"
,
idx
,
storage_id
);
"fail to create for node with idx=%d, storage_id=%u
\n
"
,
idx
,
storage_id
);
}
}
// Release memory
// Release memory
...
...
src/runtime/crt/load_json.c
View file @
0075d8ce
...
@@ -182,6 +182,7 @@ int JSONReader_ReadString(JSONReader * reader, char * out_str) {
...
@@ -182,6 +182,7 @@ int JSONReader_ReadString(JSONReader * reader, char * out_str) {
}
}
if
(
ch
==
EOF
||
ch
==
'\r'
||
ch
==
'\n'
)
{
if
(
ch
==
EOF
||
ch
==
'\r'
||
ch
==
'\n'
)
{
fprintf
(
stderr
,
"Error at line X, Expect
\'\"\'
but reach end of line
\n
"
);
fprintf
(
stderr
,
"Error at line X, Expect
\'\"\'
but reach end of line
\n
"
);
status
=
-
1
;
}
}
}
}
snprintf
(
out_str
,
sizeof
(
output
),
"%s"
,
output
);
snprintf
(
out_str
,
sizeof
(
output
),
"%s"
,
output
);
...
...
src/runtime/crt/ndarray.c
View file @
0075d8ce
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
...
@@ -92,8 +92,8 @@ int TVMNDArray_Load(TVMNDArray * ret, const char ** strm) {
...
@@ -92,8 +92,8 @@ int TVMNDArray_Load(TVMNDArray * ret, const char ** strm) {
int64_t
data_byte_size
;
int64_t
data_byte_size
;
data_byte_size
=
((
int64_t
*
)
*
strm
)[
0
];
*
strm
+=
sizeof
(
data_byte_size
);
// NOLINT(*)
data_byte_size
=
((
int64_t
*
)
*
strm
)[
0
];
*
strm
+=
sizeof
(
data_byte_size
);
// NOLINT(*)
if
(
!
(
data_byte_size
==
num_elems
*
elem_bytes
))
{
if
(
!
(
data_byte_size
==
num_elems
*
elem_bytes
))
{
fprintf
(
stderr
,
"invalid DLTensor file format: data_byte_size=%
l
d, "
fprintf
(
stderr
,
"invalid DLTensor file format: data_byte_size=%
j
d, "
"while num_elems*elem_bytes=%
l
d
\n
"
,
"while num_elems*elem_bytes=%
j
d
\n
"
,
data_byte_size
,
(
num_elems
*
elem_bytes
));
data_byte_size
,
(
num_elems
*
elem_bytes
));
status
=
-
1
;
status
=
-
1
;
}
}
...
...
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