boostorg/compute
boostorg/compute has 1,668 GitHub stars and 340 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-07 03:23 UTC. Last push 2026-08-12.
A C++ GPU Computing Library for OpenCL
Measured star growth
- in 24h
- +1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalBoost.Compute
Boost.Compute is a GPU/parallel-computing library for C++ based on OpenCL.
The core library is a thin C++ wrapper over the OpenCL API and provides access to compute devices, contexts, command queues and memory buffers.
On top of the core library is a generic, STL-like interface providing common
algorithms (e.g. transform(), accumulate(), sort()) along with common
containers (e.g. vector<T>, flat_set<T>). It also features a number of
extensions including parallel-computing algorithms (e.g. exclusive_scan(),
scatter(), reduce()) and a number of fancy iterators (e.g.
transform_iterator<>, permutation_iterator<>, zip_iterator<>).
The full documentation is available at http://boostorg.github.io/compute/.
Example
The following example shows how to sort a vector of floats on the GPU:
#include <vector>
#include <algorithm>
#include <boost/compute.hpp>
namespace compute = boost::compute;
int main()
{
// get the default compute device
compute::device gpu = compute::system::default_device();
// create a compute context and command queue
compute::context ctx(gpu);
compute::command_queue queue(ctx, gpu);
// generate random numbers on the host
std::vector<float> host_vector(1000000);
std::generate(host_vector.begin(), host_vector.end(), rand);
// create vector on the device
compute::vector<float> device_vector(1000000, ctx);
// copy data to the device
compute::copy(
host_vector.begin(), host_vector.end(), device_vector.begin(), queue
);
// sort data on the device
compute::sort(
device_vector.begin(), device_vector.end(), queue
);
// copy data back to the host
compute::copy(
device_vector.begin(), device_vector.end(), host_vector.begin(), queue
);
return 0;
}
Boost.Compute is a header-only library, so no linking is required. The example above can be compiled with:
g++ -I/path/to/compute/include sort.cpp -lOpenCL
More examples can be found in the tutorial and under the examples directory.
Support
Questions about the library (both usage and development) can be posted to the mailing list.
Bugs and feature requests can be reported through the issue tracker.
Also feel free to send me an email with any problems, questions, or feedback.
Help Wanted
The Boost.Compute project is currently looking for additional developers with interest in parallel computing.
Please send an email to Kyle Lutz ([email protected]) for more information.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,781 starspublic-apis/public-apis
A collective list of free APIs
497,000 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
440,817 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,143 stars