Copilot commented on code in PR #373:
URL: https://github.com/apache/doris-thirdparty/pull/373#discussion_r2684370978


##########
driver/others/dynamic.c:
##########
@@ -803,7 +803,27 @@ static gotoblas_t *get_coretype(void){
            openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
            return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
          }
-        }      
+        }
+       return NULL;
+      case 12:
+        // Emerald Rapids (e.g., Intel Xeon Platinum 8575C, model 207 = 
exmodel 12, model 15)
+        if (model == 15) {
+          if(support_amx_bf16())
+            return &gotoblas_SAPPHIRERAPIDS;
+          if(support_avx512_bf16())
+             return &gotoblas_COOPERLAKE;
+          if (support_avx512())
+           return &gotoblas_SKYLAKEX;
+         if(support_avx2())
+           return &gotoblas_HASWELL;
+         if(support_avx()) {
+           openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
+           return &gotoblas_SANDYBRIDGE;
+         } else {
+           openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
+           return &gotoblas_NEHALEM;
+         }
+        }

Review Comment:
   The case 12 implementation only handles model 15 (Emerald Rapids) but the 
corresponding cpuid_x86.c code also handles model 6 (Arrow Lake). The runtime 
detection should also include a check for model 6 to maintain consistency with 
the compile-time detection logic.



##########
driver/others/dynamic.c:
##########
@@ -803,7 +803,27 @@ static gotoblas_t *get_coretype(void){
            openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
            return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
          }
-        }      
+        }
+       return NULL;
+      case 12:
+        // Emerald Rapids (e.g., Intel Xeon Platinum 8575C, model 207 = 
exmodel 12, model 15)
+        if (model == 15) {
+          if(support_amx_bf16())
+            return &gotoblas_SAPPHIRERAPIDS;
+          if(support_avx512_bf16())
+             return &gotoblas_COOPERLAKE;
+          if (support_avx512())
+           return &gotoblas_SKYLAKEX;
+         if(support_avx2())
+           return &gotoblas_HASWELL;
+         if(support_avx()) {
+           openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
+           return &gotoblas_SANDYBRIDGE;
+         } else {
+           openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
+           return &gotoblas_NEHALEM;
+         }

Review Comment:
   This code block (lines 811-825) is duplicated from case 8, model 15 (lines 
734-747). The identical fallback logic appears in multiple places throughout 
this file. Consider extracting this common detection logic into a helper 
function to improve maintainability and reduce code duplication.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to