mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-10-31 16:21:27 +08:00 
			
		
		
		
	Stop the fence in the destructor
This commit is contained in:
		| @@ -34,6 +34,12 @@ Fence::Fence(const Stream& stream) : stream_(stream) { | ||||
|   } | ||||
| } | ||||
|  | ||||
| Fence::~Fence() { | ||||
|   if (use_fast_) { | ||||
|     cpu_value()[0] = INT_MAX; | ||||
|   } | ||||
| } | ||||
|  | ||||
| void Fence::wait_gpu(array& x) { | ||||
|   gpu_count_++; | ||||
|   auto& d = metal::device(stream_.device); | ||||
|   | ||||
| @@ -21,6 +21,7 @@ namespace mlx::core { | ||||
| class Fence { | ||||
|  public: | ||||
|   Fence(const Stream& stream); | ||||
|   ~Fence(); | ||||
|  | ||||
|   void update_gpu(const array& x); | ||||
|   void wait_gpu(array& x); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Angelos Katharopoulos
					Angelos Katharopoulos