mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-29 01:58:12 +08:00
Shared events for synchronization + async eval (#998)
* more async eval * fix rebase * try correct async eval * fix async * more tests for async eval * use shared events for synchronization * comment + cleanup * with autorelease pool * fix no metal build * fix compile * fix patch * don't eval if asyn evale'd * don't use is_evaled * comments * more multi stream tests * try and cleanup use of is_evaled * use a status flag
This commit is contained in:
@@ -495,12 +495,14 @@ TEST_CASE("test metal memory info") {
|
||||
|
||||
// Query active and peak memory
|
||||
{
|
||||
auto a = zeros({4096});
|
||||
// Do these tests on the CPU since deallocation is synchronized
|
||||
// with the main thread.
|
||||
auto a = zeros({4096}, Device::cpu);
|
||||
eval(a);
|
||||
auto active_mem = metal::get_active_memory();
|
||||
CHECK(active_mem >= 4096 * 4);
|
||||
{
|
||||
auto b = zeros({4096});
|
||||
auto b = zeros({4096}, Device::cpu);
|
||||
eval(b);
|
||||
}
|
||||
auto new_active_mem = metal::get_active_memory();
|
||||
|
Reference in New Issue
Block a user