mirror of
https://github.com/OpenMathLib/OpenBLAS
synced 2026-05-31 00:45:48 +08:00
Supported detecting new kernel(2.6.36) & new Loongson3A03 CPU.
This commit is contained in:
@@ -95,7 +95,8 @@ VERSION = 0.1
|
||||
# DEBUG = 1
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
COMMON_OPT += -g -DDEBUG
|
||||
COMMON_OPT += -g
|
||||
# -DDEBUG
|
||||
else
|
||||
COMMON_OPT += -O2
|
||||
endif
|
||||
|
||||
19
cpuid_mips.c
19
cpuid_mips.c
@@ -99,9 +99,22 @@ int detect(void){
|
||||
|
||||
fclose(infile);
|
||||
|
||||
if (strstr(p, "Loongson-3A")) return CPU_LOONGSON3A;
|
||||
else return CPU_SICORTEX;
|
||||
|
||||
if (strstr(p, "Loongson-3A")){
|
||||
return CPU_LOONGSON3A;
|
||||
}else if (strstr(p, "Loongson-3")){
|
||||
infile = fopen("/proc/cpuinfo", "r");
|
||||
while (fgets(buffer, sizeof(buffer), infile)){
|
||||
if (!strncmp("system type", buffer, 11)){
|
||||
p = strchr(buffer, ':') + 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(infile);
|
||||
if (strstr(p, "loongson3a"))
|
||||
return CPU_LOONGSON3A;
|
||||
}else{
|
||||
return CPU_SICORTEX;
|
||||
}
|
||||
#endif
|
||||
return CPU_UNKNOWN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user