Skip to content

N-Body Simulation

Performs an N-body simulation calculating a gravity field and corresponding velocity and acceleration contributions accumulated by each body from every other body. Demonstrates computation distributed across all available devices — CPU only, GPU only, and a hybrid combination using separate threads for each simulator.

Example downloaded from the Apple OpenCL Developer website.

File Description
OpenCL_NBody_Simulation.xcodeproj Xcode project

Usage

Open N-BodySimulation/OpenCL_NBody_Simulation.xcodeproj in Xcode and build and run from there.

Requirements

  • OS X El Capitan (10.11) or later
  • Xcode 7.1 or later