ManifoldScript Docs
Documentation
ManifoldScript Documentation
Comprehensive guides for installing, configuring, and optimizing ManifoldScript across different GPU platforms and operating systems.
GPU Platform Guides
Operating System Guides
Compiler Architecture
ManifoldScript Compiler Pipeline
graph TD
A[Source Code] --> B[Frontend]
B --> C[Parser]
C --> D[AST Generation]
D --> E[Middle-end]
E --> F[Optimization Passes]
F --> G[Backend]
G --> H[NVIDIA CUDA CodeGen]
G --> I[Apple Metal CodeGen]
G --> J[AMD ROCm CodeGen]
H --> K[Runtime System]
I --> K
J --> K
K --> L[GPU Execution]
classDef frontend fill:#e1f5fe
classDef middleend fill:#f3e5f5
classDef backend fill:#e8f5e9
classDef runtime fill:#fff3e0
class B,C,D frontend
class E,F middleend
class G,H,I,J backend
class K,L runtime
Data Flow Architecture
ManifoldScript Execution Flow
sequenceDiagram
participant User
participant Compiler
participant GPU_Driver
participant GPU
User->>Compiler: manifoldscript compile file.ms
Compiler->>Compiler: Parse & Generate AST
Compiler->>Compiler: Optimize Tensor Operations
Compiler->>GPU_Driver: Generate GPU-specific code
GPU_Driver->>GPU: Load & Execute Kernels
GPU->>GPU_Driver: Execution Results
GPU_Driver->>Compiler: Return Results
Compiler->>User: Output & Performance Metrics
Memory Management
GPU Memory Management Architecture
graph TB
subgraph "Host Memory"
A[CPU Buffer] --> B[Memory Manager]
C[Tensor Metadata] --> B
end
subgraph "GPU Memory"
D[GPU Global Memory] --> E[GPU Allocator]
F[Shared Memory] --> E
G[Constant Memory] --> E
end
B -->|Transfer| E
E -->|Zero-Copy| D
E -->|Optimized| F
E -->|Read-Only| G
H[Multi-GPU Coordinator] --> E
H -->|Cross-GPU| I[PCIe/NVLink]
classDef host fill:#e3f2fd
classDef gpu fill:#ffebee
classDef transfer fill:#f3e5f5
class A,B,C host
class D,E,F,G gpu
class H,I transfer
Quick Start
1. Install
# For NVIDIA CUDA
curl -fsSL https://get.manifoldscript.dev/cuda | bash
# For Apple Metal
curl -fsSL https://get.manifoldscript.dev/metal | bash
# For AMD ROCm
curl -fsSL https://get.manifoldscript.dev/rocm | bash
2. Verify
manifoldscript --version
manifoldscript --check-gpu
3. Compile
manifoldscript compile example.ms
./example