The code you posted only shows query for the device ids. How was the OpenCL device created ? Are there any valid CPU device on the system ?
You may check OpenCL samples in AMD APP SDK. The samples can be run on cpu or gpu depending on command line argument "--device cpu/gpu" [please type "-h" or "--help" for more details].