libhsakmt: Query KFD version once after opening /dev/kfd

Query the KFD interface version once and store it in a global variable.
This makes it more efficient for KFD APIs to query the API version
later.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: I267f3465f754e78fb21a7c42c5877cd68eaa9d05


[ROCm/ROCR-Runtime commit: 43ce63b68b]
This commit is contained in:
Felix Kuehling
2020-07-11 23:37:32 -04:00
parent 3f3b280a4c
commit f267a5251c
3 changed files with 27 additions and 2 deletions
+5
View File
@@ -196,6 +196,10 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtOpenKFD(void)
init_page_size();
result = init_kfd_version();
if (result != HSAKMT_STATUS_SUCCESS)
goto kfd_version_failed;
result = topology_sysfs_get_system_props(&sys_props);
if (result != HSAKMT_STATUS_SUCCESS)
goto topology_sysfs_failed;
@@ -238,6 +242,7 @@ init_doorbell_failed:
fmm_destroy_process_apertures();
init_process_aperture_failed:
topology_sysfs_failed:
kfd_version_failed:
close(fd);
open_failed:
pthread_mutex_unlock(&hsakmt_mutex);