mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 09:21:16 +08:00
fix cpu compile (#1897)
This commit is contained in:
parent
a44dc4bdb0
commit
7face5d9fd
@ -18,13 +18,16 @@ if [ "$CLANG" = "TRUE" ]; then
|
||||
#include <complex>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#ifdef __ARM_FEATURE_FP16_SCALAR_ARITHMETIC
|
||||
#include <arm_fp16.h>
|
||||
#endif
|
||||
EOM
|
||||
CC_FLAGS="-arch ${ARCH}"
|
||||
CC_FLAGS="-arch ${ARCH} -nobuiltininc -nostdinc"
|
||||
else
|
||||
CC_FLAGS="-std=c++17"
|
||||
fi
|
||||
|
||||
CONTENT=$($GCC $CC_FLAGS -I "$SRCDIR" -E "$SRCDIR/mlx/backend/cpu/compiled_preamble.h" 2>/dev/null)
|
||||
CONTENT=$($GCC $CC_FLAGS -I "$SRCDIR" -E -P "$SRCDIR/mlx/backend/cpu/compiled_preamble.h" 2>/dev/null)
|
||||
|
||||
cat << EOF > "$OUTPUT_FILE"
|
||||
const char* get_kernel_preamble() {
|
||||
|
@ -953,6 +953,7 @@ class TestCompile(mlx_tests.MLXTestCase):
|
||||
self.assertEqual(out[1].shape, (2, 2, 5))
|
||||
|
||||
def test_leaks(self):
|
||||
gc.collect()
|
||||
if mx.metal.is_available():
|
||||
mem_pre = mx.metal.get_active_memory()
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user