|
|
@@ -87,7 +87,7 @@ Status SuperKernelFactory::FuseKernels(const std::vector<void *> &stub_func_list |
|
|
|
} |
|
|
|
GELOGI("SKT: superkernel start fuse, superkernel size %zu.", stub_func_list.size()); |
|
|
|
const size_t nav_table_len = 2 * stub_func_list.size(); |
|
|
|
std::unique_ptr<uint64_t[]> nav_table(new(std::nothrow) uint64_t[nav_table_len]); |
|
|
|
std::unique_ptr<uint64_t[]> nav_table(new (std::nothrow) uint64_t[nav_table_len]); |
|
|
|
GE_CHECK_NOTNULL(nav_table); |
|
|
|
uint64_t nav_table_size = 2 * stub_func_list.size() * sizeof(int64_t); |
|
|
|
|
|
|
@@ -106,16 +106,16 @@ Status SuperKernelFactory::FuseKernels(const std::vector<void *> &stub_func_list |
|
|
|
nav_table[i * 2 + 1] = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(args_addr_list[i])); |
|
|
|
GELOGD("SKT: fuseKernels args base address %lu", nav_table[i * 2 + 1]); |
|
|
|
} |
|
|
|
rt_ret = rtMalloc((void **)&hbm_nav_table_addr, nav_table_size, RT_MEMORY_HBM); |
|
|
|
rt_ret = rtMalloc(reinterpret_cast<void **>(&hbm_nav_table_addr), nav_table_size, RT_MEMORY_HBM); |
|
|
|
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, GELOGE(RT_FAILED, "rtMalloc failed. error: 0x%X", rt_ret); |
|
|
|
return RT_ERROR_TO_GE_STATUS(rt_ret);) |
|
|
|
rt_ret = |
|
|
|
rtMemcpy((void *)hbm_nav_table_addr, nav_table_size, (void *)nav_table.get(), nav_table_size, RT_MEMCPY_HOST_TO_DEVICE); |
|
|
|
rt_ret = rtMemcpy(reinterpret_cast<void *>(hbm_nav_table_addr), nav_table_size, |
|
|
|
reinterpret_cast<void *>(nav_table.get()), nav_table_size, RT_MEMCPY_HOST_TO_DEVICE); |
|
|
|
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, GELOGE(RT_FAILED, "rtMemcpy failed. error: 0x%X", rt_ret); |
|
|
|
GE_CHK_RT(rtFree(hbm_nav_table_addr)); return RT_ERROR_TO_GE_STATUS(rt_ret);) |
|
|
|
// Create the necessary metadata for the super kernel |
|
|
|
h = std::unique_ptr<skt::SuperKernel>( |
|
|
|
new SuperKernel(this->func_stub_, hbm_nav_table_addr, nav_table_size, block_dim)); |
|
|
|
h = |
|
|
|
std::unique_ptr<skt::SuperKernel>(new SuperKernel(this->func_stub_, hbm_nav_table_addr, nav_table_size, block_dim)); |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
} // namespace skt |
|
|
|