wsl/hsakmt: Disable thunk sub-allocator by default
Signed-off-by: Shi.Leslie <Yuliang.Shi@amd.com> Reviewed-by: Longlong Yao Longlong.Yao@amd.com
这个提交包含在:
+3
-1
@@ -49,5 +49,7 @@ int vendor_packet_process;
|
||||
int enable_vendor_packet;
|
||||
/* check available system memory before allocation */
|
||||
bool check_avail_sysram = false;
|
||||
/* enable 128MB sub-allocator in libhsakmt, default: disable */
|
||||
int enable_thunk_sub_allocator = 0;
|
||||
|
||||
size_t max_single_alloc_size = 0;
|
||||
size_t max_single_alloc_size = 0;
|
||||
|
||||
+1
@@ -48,6 +48,7 @@ extern int vendor_packet_process;
|
||||
extern int enable_vendor_packet;
|
||||
extern bool check_avail_sysram;
|
||||
extern size_t max_single_alloc_size;
|
||||
extern int enable_thunk_sub_allocator;
|
||||
|
||||
#undef HSAKMTAPI
|
||||
#define HSAKMTAPI __attribute__((visibility ("default")))
|
||||
|
||||
+2
-1
@@ -278,7 +278,8 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtAllocMemoryAlign(HSAuint32 PreferredNode,
|
||||
void **MemoryAddress) {
|
||||
return hsaKmtAllocMemoryAlignInternal(PreferredNode, SizeInBytes,
|
||||
Alignment, MemFlags,
|
||||
MemoryAddress);
|
||||
MemoryAddress,
|
||||
!enable_thunk_sub_allocator);
|
||||
}
|
||||
|
||||
HSAKMT_STATUS hsaKmtFreeMemoryInternal(void *MemoryAddress,
|
||||
|
||||
@@ -132,6 +132,10 @@ static HSAKMT_STATUS init_vars_from_env(void) {
|
||||
if (envvar)
|
||||
check_avail_sysram = !strcmp(envvar, "1");
|
||||
|
||||
envvar = getenv("WSL_ENABLE_THUNK_SUB_ALLOCATOR");
|
||||
if (envvar)
|
||||
enable_thunk_sub_allocator = atoi(envvar);
|
||||
|
||||
return HSAKMT_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户