[flang-commits] [flang] [flang][cuda] Allow to set the stack limit size (PR #124859)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Jan 28 15:59:38 PST 2025


================
@@ -143,6 +143,17 @@ void ExecutionEnvironment::Configure(int ac, const char *av[],
     }
   }
 
+  if (auto *x{std::getenv("CUDA_STACKLIMIT")}) {
+    char *end;
+    auto n{std::strtol(x, &end, 10)};
+    if (n >= 0 && n < std::numeric_limits<int>::max() && *end == '\0') {
----------------
klausler wrote:

cudaStackLimit is declared with `std::size_t` below; testing against the max signed int may be too restrictive.

https://github.com/llvm/llvm-project/pull/124859


More information about the flang-commits mailing list