Rewrote CUDA matrix operations in core module with New Device Layer