Added support for cuda including the -optf option.