Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void kernel(__global int* stack) {
- ... do stuff ...
- push(stack, value);
- ... do stuff ...
- return y;
- }
- void push(__global int* stack, int val) {
- int idx = atomic_inc(stack[0]); // first element is the stack length
- stack[idx] = val;
- }
- void push(__global int* stack, int val) {
- stack[get_global_id(0)] = val;
- }
- [0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 3, 0, 0, 0, 9, 0, 0, ...]
Add Comment
Please, Sign In to add comment