ArrayFire is a GPU library. To compare against the CPU, you would need to write your own C code (or otherwise find another sorting library for the CPU).
There is an OpenCL version of ArrayFire available (which will support both GPU and CPU execution), but currently the OpenCL version does not have sorting and we recommend using the CUDA version.
But, I checked myself and the error message wasn’t very helpful (indicated unsupported type #10). I fixed it to now show this:
src/gena/gi_arith.cpp:236: error: unsupported type (u32) in rand
But I also jumped in to add integer support. Since random integers aren’t really uniform or normal (every bit is simply random 0,1), I named it just ‘rand’ instead of ‘randu’ or ‘randn’. This will be out in the coming days in the nightly builds but definitely when we roll out ArrayFire 1.1 with CUDA 4.1 support next week.