PACXX

Programming Accelerators with C++

Under Construction

This page is a placeholder. Once my research project is open-source all necessary information will be published here. In the meantime, have you ever wanted to write GPU code like this?

using namespace std;

int main(int argc, char* argv[]) {
    size_t n = 1 << 24;
    vector<int> a(n);
    vector<int> b(n);
    vector<int> c(n);

    auto vadd = [](const vector<int> &a, const vector<int> &b, vector<int> &c) {
       auto i = Thread::get().global.x;
       if (i >= a.size()) return;
       c[i] = a[i] + b[i];
    };

    size_t threads = 128;
    size_t blocks = (n + (threads * 2 - 1)) / (threads * 2);

    auto vadd_gpu = kernel(vadd, {{blocks}, {threads}});
    vadd_gpu(a, b, c);
    return 0;
}

Here is something to read:

Publications