Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <vexcl/vexcl.hpp>
- const vex::Context& ctx() {
- // This is a local static variable, so it will only be created and
- // initializaed once.
- // Moving it into a function makes sure it will only be created when needed
- // (at the first call to the function).
- static vex::Context ctx(vex::Filter::Env);
- return ctx;
- }
- int main() {
- vex::vector<int> x(ctx(), 16);
- x = 42;
- std::cout << x << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement