Fix cuda.detect and global naming problem