You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/05/13 03:36:55 UTC

[GitHub] [tvm] manupa-arm commented on a change in pull request #8019: [uTVM][AOT] Adding workspace byte alignment

manupa-arm commented on a change in pull request #8019:
URL: https://github.com/apache/tvm/pull/8019#discussion_r631539748



##########
File path: src/tir/analysis/calculate_workspace.cc
##########
@@ -46,6 +48,10 @@ size_t WorkspaceCalculator::operator()(const PrimFunc& func) {
   return this->max_size;
 }
 
+size_t WorkspaceCalculator::GetByteAlignedSize(size_t non_aligned_size) {
+  return ((non_aligned_size + byte_alignment - 1) / byte_alignment) * byte_alignment;

Review comment:
       That is expected to be aligned by user in the application.  E.g.,
   
   `  __attribute__((section("SRAM1"), aligned(16))) static uint8_t workspace_buffer [WORKSPACE_SIZE];
      extern tvm_model_t network;
      tvm_workspace_t app_workspace;
          int main(...) {
              ...
              StackMemoryManager_Init(&app_workspace, workspace_buffer, WORKSPACE_SIZE);
              tvm_runtime_run(&network, inputs, outputs);
          }`




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org