add gpu selection code

Signed-off-by: ezheng <ezheng@cs.unc.edu>