Add CPU/GPU check
Questions remaining: here the import relation is really strange, so i use a new import here.