mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 17:31:16 +08:00
Fix format / build (#489)
This commit is contained in:
parent
a749a91c75
commit
3d99a8d31d
@ -19,4 +19,10 @@ std::function<void()> make_task(
|
|||||||
"[metal::make_task] Cannot make GPU task without metal backend");
|
"[metal::make_task] Cannot make GPU task without metal backend");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No cache for CPU only
|
||||||
|
bool cache_enabled(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
void set_cache_enabled(bool) {}
|
||||||
|
|
||||||
} // namespace mlx::core::metal
|
} // namespace mlx::core::metal
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include "doctest/doctest.h"
|
#include "doctest/doctest.h"
|
||||||
|
|
||||||
|
#include "mlx/backend/metal/allocator.h"
|
||||||
#include "mlx/backend/metal/device.h"
|
#include "mlx/backend/metal/device.h"
|
||||||
#include "mlx/backend/metal/metal.h"
|
#include "mlx/backend/metal/metal.h"
|
||||||
#include "mlx/backend/metal/allocator.h"
|
|
||||||
#include "mlx/mlx.h"
|
#include "mlx/mlx.h"
|
||||||
|
|
||||||
using namespace mlx::core;
|
using namespace mlx::core;
|
||||||
@ -505,7 +505,8 @@ TEST_CASE("test metal enable/disable cache") {
|
|||||||
// Release a
|
// Release a
|
||||||
a.free(buf);
|
a.free(buf);
|
||||||
|
|
||||||
// If release successfully, the first byte should be different from the first byte before release
|
// If release successfully, the first byte should be different from the
|
||||||
|
// first byte before release
|
||||||
unsigned char new_first_byte = *reinterpret_cast<unsigned char*>(buf_ptr);
|
unsigned char new_first_byte = *reinterpret_cast<unsigned char*>(buf_ptr);
|
||||||
printf("new first byte: %d\n", new_first_byte);
|
printf("new first byte: %d\n", new_first_byte);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user