Cuda Memory Allocator Implementation