fixes cuda and cpu engines