Added platform detection 

now it is possible to select the platform with the given device type (cpu/gpu).

This has already been tested by Rodrigo (@neumannrf)