mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-10-31 16:21:27 +08:00 
			
		
		
		
	Fix update gpu
This commit is contained in:
		| @@ -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)]]) { | ||||||
|  |   uint tmp = timestamp[0]; | ||||||
|  |   if (tmp < value) { | ||||||
|     timestamp[0] = 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, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Angelos Katharopoulos
					Angelos Katharopoulos