Added CUDA memory management stuff for material classes