mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-11-04 10:38:10 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			286 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			286 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
## Build and Run 
 | 
						|
 | 
						|
Install MLX with Python:
 | 
						|
 | 
						|
```bash
 | 
						|
pip install mlx>=0.22
 | 
						|
```
 | 
						|
 | 
						|
Build the C++ example:
 | 
						|
 | 
						|
```bash
 | 
						|
cmake -B build -DCMAKE_BUILD_TYPE=Release
 | 
						|
cmake --build build
 | 
						|
```
 | 
						|
 | 
						|
Run the C++ example:
 | 
						|
 | 
						|
```
 | 
						|
./build/example
 | 
						|
```
 | 
						|
 | 
						|
which should output:
 | 
						|
 | 
						|
```
 | 
						|
array([2, 4, 6], dtype=int32)
 | 
						|
```
 |