mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-25 01:41:17 +08:00
Fix update gpu
This commit is contained in:
parent
90801467d8
commit
f4a5959055
@ -29,7 +29,10 @@ constexpr constant metal::thread_scope thread_scope_system =
|
|||||||
[[kernel]] void fence_update(
|
[[kernel]] void fence_update(
|
||||||
volatile coherent(system) device uint* timestamp [[buffer(0)]],
|
volatile coherent(system) device uint* timestamp [[buffer(0)]],
|
||||||
constant uint& value [[buffer(1)]]) {
|
constant uint& value [[buffer(1)]]) {
|
||||||
timestamp[0] = value;
|
uint tmp = timestamp[0];
|
||||||
|
if (tmp < value) {
|
||||||
|
timestamp[0] = value;
|
||||||
|
}
|
||||||
metal::atomic_thread_fence(
|
metal::atomic_thread_fence(
|
||||||
metal::mem_flags::mem_device,
|
metal::mem_flags::mem_device,
|
||||||
metal::memory_order_seq_cst,
|
metal::memory_order_seq_cst,
|
||||||
|
Loading…
Reference in New Issue
Block a user