Top Qs
Timeline
Chat
Perspective
RaftLib
From Wikipedia, the free encyclopedia
Remove ads
RaftLib[1] is a portable parallel processing system that aims to provide extreme performance while increasing programmer productivity. It enables a programmer to assemble a massively parallel program (both local and distributed) using simple iostream-like operators. RaftLib handles threading, memory allocation, memory placement, and auto-parallelization of compute kernels.[2] It enables applications to be constructed from chains of compute kernels forming a task and pipeline parallel compute graph. Programs are authored in C++ (although other language bindings are planned).
Remove ads
Example
Here is a Hello World example for demonstration purposes:[3]
import <raft>;
import <raftio>;
import std;
using String = std::string;
using RaftKernel = raft::kernel;
using RaftKernelStatus = raft::kstatus;
using RaftMap = raft::map;
using RaftPrint = raft::print;
class HelloWorld : public RaftKernel {
public:
HelloWorld() {
output.addPort<String>("0");
}
virtual RaftKernelStatus run() {
output["0"].push("Hello World\n");
return raft::stop;
}
};
int main(int argc, char* argv[]) {
// instantiate print kernel
RaftPrint<String> p;
// instantiate hello world kernel
HelloWorld hello;
// make a map object
RaftMap m;
// add kernels to map, both hello and p are executed concurrently
m += hello >> p;
// execute the map
m.exe();
return 0;
}
Remove ads
References
External links
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads
