Bfs width limit (#1568)

* width limit

* fix

* large limit

* put env vars in env namespace
This commit is contained in:
Awni Hannun
2024-11-08 15:00:46 -08:00
committed by GitHub
parent 8c34c9dac4
commit c1fe1ef081
4 changed files with 58 additions and 22 deletions

View File

@@ -1,9 +1,10 @@
// Copyright © 2023 Apple Inc.
#include <cstdlib>
#include <sstream>
#include <vector>
#include "utils.h"
#include "mlx/utils.h"
namespace mlx::core {
@@ -336,4 +337,16 @@ std::ostream& operator<<(std::ostream& os, const std::vector<int64_t>& v) {
return os;
}
namespace env {
int get_var(const char* name, int default_value) {
if (const char* buff_str = std::getenv(name)) {
return atoi(buff_str);
} else {
return default_value;
}
}
} // namespace env
} // namespace mlx::core