Add contextSize: hide OCL_TIDL_CACHE_ALIGN on host
authorYuan Zhao <yuanzhao@ti.com>
Tue, 30 Oct 2018 15:33:29 +0000 (10:33 -0500)
committerYuan Zhao <yuanzhao@ti.com>
Tue, 30 Oct 2018 15:35:05 +0000 (10:35 -0500)
- MCT-1059

tidl_api/src/execution_object.cpp

index 95c7aa25ea8034a78d64437977c82b382f351c78..08b5796fd368f52e47dcc0c7679e2c71ef8fc491 100644 (file)
@@ -470,11 +470,8 @@ void ExecutionObject::Impl::HostWriteNetInput(uint32_t context_idx)
     for (unsigned int i = 0; i < shared_initialize_params_m->numInBufs; i++)
     {
         OCL_TIDL_BufParams *inBuf = &shared_initialize_params_m->inBufs[i];
-        uint32_t context_size = inBuf->bufPlaneWidth * inBuf->bufPlaneHeight;
-                 context_size = (context_size + OCL_TIDL_CACHE_ALIGN - 1) &
-                                (~(OCL_TIDL_CACHE_ALIGN - 1));
         char *inBufAddr = tidl_extmem_heap_m.get() + inBuf->bufPlaneBufOffset
-                          + context_idx * context_size;
+                          + context_idx * inBuf->contextSize;
 
             readPtr += readDataS8(
                 readPtr,
@@ -506,11 +503,8 @@ void ExecutionObject::Impl::HostReadNetOutput(uint32_t context_idx)
     for (unsigned int i = 0; i < shared_initialize_params_m->numOutBufs; i++)
     {
         OCL_TIDL_BufParams *outBuf = &shared_initialize_params_m->outBufs[i];
-        uint32_t context_size = outBuf->bufPlaneWidth * outBuf->bufPlaneHeight;
-                 context_size = (context_size + OCL_TIDL_CACHE_ALIGN - 1) &
-                                (~(OCL_TIDL_CACHE_ALIGN - 1));
         char *outBufAddr = tidl_extmem_heap_m.get() + outBuf->bufPlaneBufOffset
-                           + context_idx * context_size;
+                           + context_idx * outBuf->contextSize;
         if (writePtr != nullptr)
         {
             writePtr += writeDataS8(