Made the fd header work with both GPU and CPU code