1 # Check if OpenCL is available and that it supports a CPU device.
2 # The check for a CPU device is the same check that is performed
3 # by opencl_create_device in ocl_utilities.c
4 AC_DEFUN([AX_CHECK_OPENCL], [
7 AC_CHECK_HEADER([CL/opencl.h], [
8 AC_CHECK_LIB([OpenCL], [clGetPlatformIDs], [
11 AC_MSG_CHECKING([for OpenCL CPU device])
12 AC_RUN_IFELSE([AC_LANG_PROGRAM(
13 [[#include <CL/opencl.h>]], [[
14 cl_platform_id platform;
17 if (clGetPlatformIDs(1, &platform, NULL) < 0)
19 if (clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 1, &dev, NULL) < 0)
21 ]])], [HAVE_OPENCL=yes])
22 AC_MSG_RESULT($HAVE_OPENCL)