/* StarPU --- Runtime system for heterogeneous multicore architectures. * * Copyright (C) 2010,2011 University of Bordeaux * * StarPU is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or (at * your option) any later version. * * StarPU is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU Lesser General Public License in COPYING.LGPL for more details. */ #include #include #include static inline void checkErr(cl_int err, const char * name) { if (err != CL_SUCCESS) { fprintf(stderr, "ERROR: %s (%d)\n", name, err); exit(1); } } int main(void) { cl_int err; cl_uint num_platforms; // Plaform info err = clGetPlatformIDs(0, NULL, &num_platforms); if (num_platforms == 0) { printf("No OpenCL platform found.\n"); exit(77); } checkErr(err, "Unable to get platform count"); cl_platform_id platforms[num_platforms]; err = clGetPlatformIDs(num_platforms, platforms, NULL); checkErr(err, "Unable to get platform list"); // Iteratate over platforms printf("Number of platforms:\t\t\t\t %d\n", num_platforms); { unsigned int i; for (i=0; i