alanmacd commented on code in PR #13807:
URL: https://github.com/apache/tvm/pull/13807#discussion_r1087328934
##########
src/runtime/crt/aot_executor/aot_executor.c:
##########
@@ -203,17 +203,6 @@ int TVMAotExecutor_Init(TVMAotExecutor* executor,
TVMModuleHandle module_handle,
TVMNDArray_IncrementReference(array);
}
- for (i = 0; i < md->num_workspace_pools; ++i) {
- LOG_DEBUG("pools allocate[%d]: %s\n", i, md->workspace_pools[i].name);
-
- status = TVMNDArray_Empty(md->workspace_pools[i].num_shape,
md->workspace_pools[i].shape,
- md->workspace_pools[i].dtype, executor->device,
- &executor->args[arg_idx++]);
- if (status != 0) {
- return status;
- }
- }
- CHECK_EQ(0, md->num_constant_pools, "Constant pools not supported");
Review Comment:
@d-smirnov running `pytest tests/python/unittest/test_crt.py -k
test_aot_executor_usmp_const_pool` and keeping the temporary files around, the
generated C code will contain the following lines in
`tests/python/unittest/micro-workspace-usmp/project/model/codegen/host/src/default_lib0.c`,
is that what you are asking about? Otherwise, I'm not quite sure I understand
the question, could you give more context as to what you think may be missing?
```
__attribute__((section(".rodata.tvm"), ))
static struct global_const_workspace {
uint8_t fused_add_constant_let[2] __attribute__((aligned(16))); // 2
bytes, aligned offset: 0
} global_const_workspace = {
.fused_add_constant_let = {
0x08, 0x09
},
};// of total size 2 bytes
TVM_DLL int32_t tvmgen_default___tvm_main__(TVMValue* args, int* type_code,
int num_args, TVMValue* out_value, int* out_type_code, void* resource_handle);
int32_t tvmgen_default_run(TVMValue* args, int* type_code, int num_args,
TVMValue* out_value, int* out_type_code, void* resource_handle) {
TVMValue tensors[4];
tensors[0] = ((TVMValue*)args)[0];
tensors[1] = ((TVMValue*)args)[1];
tensors[2] = ((TVMValue*)args)[2];
DLTensor global_const_workspace_dltensor = {
.data = &global_const_workspace
};
TVMValue global_const_workspace_tvm_value = {
.v_handle = &global_const_workspace_dltensor
};
tensors[3] = global_const_workspace_tvm_value;
return tvmgen_default___tvm_main__((void*)tensors, type_code, num_args,
out_value, out_type_code, resource_handle);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]