From 33feaf3b1a71f5f9185f06d467dd9fcf6de1c033 Mon Sep 17 00:00:00 2001 From: Tom Gall Date: Tue, 15 Apr 2014 16:22:57 +0000 Subject: Add define for USE_CPU which will call clGetDeviceIDs with CL_DEVICE_TYPE_CPU instead of GPU and thus use a CPU only setup. --- vm-opencl.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit v1.2.3