Skip to content

Commit 88437bd

Browse files
author
ZhangYan
committed
fix comment
1 parent a9e8265 commit 88437bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/gc/ExecutionEngine/CPURuntime/Microkernel/BrgemmOnednn.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ __attribute__((weak)) void print_verbose_header() {}
4949

5050
static constexpr int PALETTE_SIZE = 64;
5151
static constexpr int DEFAULT_KERNEL_SIZE = 1024;
52+
static constexpr int MAX_KERNEL_SIZE = 2048;
5253

5354
using read_lock_guard_t = std::shared_lock<std::shared_mutex>;
5455
using write_lock_guard_t = std::unique_lock<std::shared_mutex>;
@@ -82,7 +83,8 @@ int64_t dnnl_brgemm_dispatch(int64_t M, int64_t N, int64_t K, int64_t LDA,
8283

8384
write_lock_guard_t g(g_brgemm_lock);
8485
g_kernel_id++;
85-
86+
assert(g_kernel_id < MAX_KERNEL_SIZE &&
87+
"Too many brgemm kernels are created");
8688
if (g_kernel_id >= DEFAULT_KERNEL_SIZE) {
8789
if (g_kernel_id >= (int64_t)g_cache.size()) {
8890
g_cache.resize(g_kernel_id + 1);

0 commit comments

Comments
 (0)