Skip to content

Commit 21533e3

Browse files
author
zhangyue
committed
fix(ascend): move aclrtMalloc out of assert() in WorkspacePool
The `aclrtMalloc` call was the sole expression inside `assert()`, so it was compiled away in release builds (NDEBUG). This left the workspace buffer null, causing `aclnnAddmm` to return ACLNN_ERR_PARAM_NULLPTR (161001) for any operation that requires workspace (e.g. alpha != 1.0).
1 parent 4833eb9 commit 21533e3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/ascend/workspace_pool_.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ class WorkspacePool {
2626
aclrtFree(arena.buf);
2727
}
2828
if (needed > 0) {
29-
assert(aclrtMalloc(&arena.buf, needed, ACL_MEM_MALLOC_NORMAL_ONLY) ==
30-
ACL_SUCCESS &&
31-
"`WorkspacePool`: `aclrtMalloc` failed");
29+
auto ret = aclrtMalloc(&arena.buf, needed, ACL_MEM_MALLOC_NORMAL_ONLY);
30+
assert(ret == ACL_SUCCESS && "`WorkspacePool`: `aclrtMalloc` failed");
3231
}
3332
arena.capacity = needed;
3433
return arena;

0 commit comments

Comments
 (0)