feat: Moore Threads GPU add support to query number of cores (#1259)

Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
This commit is contained in:
R0CKSTAR
2024-09-12 19:30:02 +08:00
committed by GitHub
parent 119de2e91a
commit 0c4edf7d0e
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -5,6 +5,7 @@
struct FFMtmlData
{
FF_LIBRARY_SYMBOL(mtmlDeviceCountGpuCores)
FF_LIBRARY_SYMBOL(mtmlDeviceGetBrand)
FF_LIBRARY_SYMBOL(mtmlDeviceGetIndex)
FF_LIBRARY_SYMBOL(mtmlDeviceGetName)
@@ -43,6 +44,7 @@ const char *ffDetectMthreadsGpuInfo(const FFGpuDriverCondition *cond, FFGpuDrive
mtmlData.inited = true;
FF_LIBRARY_LOAD(libmtml, "dlopen mtml failed", soName, 1);
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libmtml, mtmlLibraryInit)
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libmtml, mtmlData, mtmlDeviceCountGpuCores)
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libmtml, mtmlData, mtmlDeviceGetBrand)
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libmtml, mtmlData, mtmlDeviceGetIndex)
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libmtml, mtmlData, mtmlDeviceGetName)
@@ -158,6 +160,9 @@ const char *ffDetectMthreadsGpuInfo(const FFGpuDriverCondition *cond, FFGpuDrive
}
}
if (result.coreCount)
mtmlData.ffmtmlDeviceCountGpuCores(device, result.coreCount);
if (result.frequency)
{
MtmlGpu *gpu = NULL;