stack and queue implementation for cuda-enabled devices