wsl/hsakmt: add sub-allocator

Reviewed-by: Shane Xiao <shane.xiao@amd.com>
Reviewed-by: lyndonli <Lyndon.Li@amd.com>
Signed-off-by: tiancyin <tianci.yin@amd.com>
This commit is contained in:
tiancyin
2024-10-22 15:02:36 +08:00
committed by Frank Min
parent b062a23dfa
commit b4df74f198
5 changed files with 190 additions and 18 deletions
+2
View File
@@ -80,6 +80,7 @@ static void child_fork_handler(void) {
* in the child process so it is not cleared
*/
static void clear_after_fork(void) {
reset_suballocator();
clear_allocation_map();
if (dxg_fd) {
close(dxg_fd);
@@ -194,6 +195,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtOpenKFD(void) {
result = HSAKMT_STATUS_KERNEL_ALREADY_OPENED;
}
reset_suballocator();
pthread_mutex_unlock(&hsakmt_mutex);
return result;
topology_sysfs_failed: