move part of device layer to separate module. cuda part is compiled