Skip to content
Snippets Groups Projects
Commit 410a3660 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Use readInputBatch not copyInputBatch

parent 360f6793
No related merge requests found
......@@ -118,10 +118,11 @@ int main(){
{% endfor %}
RootIn* args = static_cast<RootIn*>(malloc(sizeof(RootIn)));
void* {{input_name}} = create4DTensor(0, nchw, batch_size, {{input_shape|join(', ')}});
{% for n in root_inputs %}
{% if n != input_name %}
args->{{n}} = {{n}};
args->{{n}}_bytes = 0;
{% endif %}
{% endfor %}
int ret = 0;
......@@ -135,7 +136,9 @@ int main(){
auto* fp = open_fifo("{{fifo_path_w}}", "wb");
for (int i = 0; i < batch_count; i++){
int start = i * batch_size, end = start + batch_size;
copyInputBatch(input_pth, start, end, {{input_shape|join(', ')}}, {{input_name}});
void *{{input_name}} = readInputBatch(input_pth, 0, start, end, {{input_shape|join(', ')}});
args->input = {{input_name}};
args->input_bytes = 0;
void* dfg = __hpvm__launch(0, root, (void*) args);
__hpvm__wait(dfg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment