diff options
author | Tom Gall <tom.gall@linaro.org> | 2014-04-15 16:22:57 +0000 |
---|---|---|
committer | Tom Gall <tom.gall@linaro.org> | 2014-04-15 16:22:57 +0000 |
commit | 33feaf3b1a71f5f9185f06d467dd9fcf6de1c033 (patch) | |
tree | 20e050c34f4a5873089f4d0ff0e2149d0c7290e3 | |
parent | 5a9cf773c90ab4599a221102ada058e73460adf6 (diff) |
Add define for USE_CPU which will call clGetDeviceIDs with
CL_DEVICE_TYPE_CPU instead of GPU and thus use a CPU only
setup.
-rw-r--r-- | vm-opencl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vm-opencl.c b/vm-opencl.c index e2b1b2b..2a29fae 100644 --- a/vm-opencl.c +++ b/vm-opencl.c @@ -39,7 +39,11 @@ int opencl_init( opencl_sqlite_context *s, sqlite3 *db, } /* Access a device */ +#ifdef USE_CPU + err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 1, &device, NULL); +#else err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL); +#endif if(err < 0) { perror("ERROR: Couldn't find any devices."); exit(1); |