fixed compilation without CUDA
fixed test
fixed work with first stack
added posibility to control memory pool usage