refactor: do some internal refactor.
This commit is contained in:
parent
04281bcd07
commit
f353636136
|
@ -37,8 +37,8 @@ extern float tsNumOfCores;
|
|||
extern int64_t tsTotalMemoryKB;
|
||||
extern char *tsProcPath;
|
||||
extern char tsSIMDEnable;
|
||||
extern char tsSSE42Enable;
|
||||
extern char tsAVXEnable;
|
||||
extern char tsSSE42Supported;
|
||||
extern char tsAVXSupported;
|
||||
extern char tsAVX2Supported;
|
||||
extern char tsFMASupported;
|
||||
extern char tsAVX512Supported;
|
||||
|
|
|
@ -594,8 +594,8 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) {
|
|||
if (cfgAddBool(pCfg, "enableCoreFile", 1, CFG_SCOPE_BOTH, CFG_DYN_CLIENT) != 0) return -1;
|
||||
if (cfgAddFloat(pCfg, "numOfCores", tsNumOfCores, 1, 100000, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
|
||||
if (cfgAddBool(pCfg, "ssd42", tsSSE42Enable, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "avx", tsAVXEnable, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "ssd42", tsSSE42Supported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "avx", tsAVXSupported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "avx2", tsAVX2Supported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "fma", tsFMASupported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "avx512", tsAVX512Supported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
|
|
|
@ -565,7 +565,7 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) {
|
|||
numOfElem = pInput->numOfRows;
|
||||
pAvgRes->count += pInput->numOfRows;
|
||||
|
||||
bool simdAvailable = tsAVXEnable && tsSIMDEnable && (numOfRows > THRESHOLD_SIZE);
|
||||
bool simdAvailable = tsAVXSupported && tsSIMDEnable && (numOfRows > THRESHOLD_SIZE);
|
||||
|
||||
switch(type) {
|
||||
case TSDB_DATA_TYPE_UTINYINT:
|
||||
|
|
|
@ -502,7 +502,7 @@ static void handleFloatCol(SColumnInfoData* pCol, int32_t start, int32_t numOfRo
|
|||
float* val = (float*)&pBuf->v;
|
||||
|
||||
// AVX version to speedup the loop
|
||||
if (tsAVXEnable && tsSIMDEnable) {
|
||||
if (tsAVXSupported && tsSIMDEnable) {
|
||||
*val = floatVectorCmpAVX(pData, numOfRows, isMinFunc);
|
||||
} else {
|
||||
if (!pBuf->assign) {
|
||||
|
@ -533,7 +533,7 @@ static void handleDoubleCol(SColumnInfoData* pCol, int32_t start, int32_t numOfR
|
|||
double* val = (double*)&pBuf->v;
|
||||
|
||||
// AVX version to speedup the loop
|
||||
if (tsAVXEnable && tsSIMDEnable) {
|
||||
if (tsAVXSupported && tsSIMDEnable) {
|
||||
*val = (double)doubleVectorCmpAVX(pData, numOfRows, isMinFunc);
|
||||
} else {
|
||||
if (!pBuf->assign) {
|
||||
|
|
|
@ -39,8 +39,8 @@ char *tsProcPath = NULL;
|
|||
|
||||
char tsSIMDEnable = 0;
|
||||
char tsAVX512Enable = 0;
|
||||
char tsSSE42Enable = 0;
|
||||
char tsAVXEnable = 0;
|
||||
char tsSSE42Supported = 0;
|
||||
char tsAVXSupported = 0;
|
||||
char tsAVX2Supported = 0;
|
||||
char tsFMASupported = 0;
|
||||
char tsAVX512Supported = 0;
|
||||
|
|
|
@ -250,7 +250,7 @@ void taosGetSystemInfo() {
|
|||
taosGetCpuCores(&tsNumOfCores, false);
|
||||
taosGetTotalMemory(&tsTotalMemoryKB);
|
||||
taosGetCpuUsage(NULL, NULL);
|
||||
taosGetCpuInstructions(&tsSSE42Enable, &tsAVXEnable, &tsAVX2Supported, &tsFMASupported, &tsAVX512Supported);
|
||||
taosGetCpuInstructions(&tsSSE42Supported, &tsAVXSupported, &tsAVX2Supported, &tsFMASupported, &tsAVX512Supported);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue