How bibek198/computeedge works
ComputeEdge is an instrumented C++ tensor engine for measuring CPU–GPU execution costs on Apple Silicon. A client creates tensors, invokes matrix multiplication, and can run it through the CPU implementations or the Metal backend; instrumentation records allocations and execution events. The benchmark harness and documented comparisons measure performance and environment details. The README also identifies storage-mode and dispatch/synchronization characterization as planned work, not a completed dispatch subsystem. Several benchmark and Metal implementation files were not sampled, so those relationships are included only where documented.
Main entry points: matmul.cpp CPU matmul entry · tensor.h Tensor API · benchmark.cpp Benchmark runner · tensor.cpp Tensor storage
Components 16
Tensor core
- Tensor API
include/computeedge/tensor.h - Tensor storage
src/core/tensor.cpp - Host allocator
src/core/allocator.cpp - Matmul validation
src/core/validate.cpp
CPU backend
- CPU matmul entry
src/cpu/matmul.cpp - Accelerate kernel
src/cpu/matmul_accelerate.cpp - Naive kernel
src/cpu/matmul_naive.cpp
Metal backend
- Metal API
include/computeedge/metal.h - Metal backend
src/metal/metal_backend.mm - Matmul shader
src/metal/kernels/matmul.metal
Measurement
- Event log
src/core/instrumentation.cpp - Benchmark runner
src/benchmark/benchmark.cpp - Benchmark statistics
src/benchmark/stats.cpp - Environment recorder
src/benchmark/env_recorder.mm - MPS and MLX
benchmarks
Other components
- Library client
Connections 16
- Library client → Tensor API: uses
README.md - Tensor API → CPU matmul entry: calls matmul
- Tensor API → Metal API: calls matmul
README.md - Tensor API → Tensor storage: creates storage
src/core/tensor.cpp - Tensor storage → Host allocator: allocates through
src/core/tensor.cpp - Host allocator → Event log: emits events
src/core/allocator.cpp - CPU matmul entry → Matmul validation: validates with
src/cpu/matmul.cpp - CPU matmul entry → Accelerate kernel: dispatches to
src/cpu/matmul.cpp - CPU matmul entry → Naive kernel: dispatches to
src/cpu/matmul.cpp - CPU matmul entry → Event log: emits events
src/cpu/matmul.cpp - Metal API → Metal backend: implemented by
README.md - Metal backend → Matmul shader: runs shader
- Library client → Benchmark runner: runs benchmark
README.md - Benchmark runner → Benchmark statistics: reports statistics
- Benchmark runner → Environment recorder: records environment
- Benchmark runner → MPS and MLX: compares against
README.md