mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 17:31: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 <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#ifdef __ARM_FEATURE_FP16_SCALAR_ARITHMETIC
|
||||||
|
#include <arm_fp16.h>
|
||||||
|
#endif
|
||||||
EOM
|
EOM
|
||||||
CC_FLAGS="-arch ${ARCH}"
|
CC_FLAGS="-arch ${ARCH} -nobuiltininc -nostdinc"
|
||||||
else
|
else
|
||||||
CC_FLAGS="-std=c++17"
|
CC_FLAGS="-std=c++17"
|
||||||
fi
|
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"
|
cat << EOF > "$OUTPUT_FILE"
|
||||||
const char* get_kernel_preamble() {
|
const char* get_kernel_preamble() {
|
||||||
|
@ -953,6 +953,7 @@ class TestCompile(mlx_tests.MLXTestCase):
|
|||||||
self.assertEqual(out[1].shape, (2, 2, 5))
|
self.assertEqual(out[1].shape, (2, 2, 5))
|
||||||
|
|
||||||
def test_leaks(self):
|
def test_leaks(self):
|
||||||
|
gc.collect()
|
||||||
if mx.metal.is_available():
|
if mx.metal.is_available():
|
||||||
mem_pre = mx.metal.get_active_memory()
|
mem_pre = mx.metal.get_active_memory()
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user