fzi-peccia commented on code in PR #18182:
URL: https://github.com/apache/tvm/pull/18182#discussion_r2281646176


##########
src/target/parsers/cpu.cc:
##########
@@ -60,6 +60,29 @@ TargetJSON ParseTarget(TargetJSON target) {
   return target;
 }
 
+int extractVLENFromString(const std::string& input) {
+  for (size_t i = 0; i + 4 <= input.size(); ++i) {
+    // Look for the starting sequence "zvl"
+    if (input[i] == 'z' && input[i + 1] == 'v' && input[i + 2] == 'l') {
+      size_t j = i + 3;
+      std::string number;
+
+      // Collect digits
+      while (j < input.size() && std::isdigit(input[j])) {
+        number += input[j];
+        ++j;
+      }
+
+      // Check if followed by 'b' after digits
+      if (!number.empty() && j < input.size() && input[j] == 'b') {
+        return std::stoi(number);  // Convert the number to int
+      }
+    }
+  }
+
+  throw std::runtime_error("No valid pattern found");
+}
+

Review Comment:
   Fixed in 918d22e6b5b031758edea180e76f1d0a23573f04



-- 
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]

Reply via email to