Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/pure-cfg/src/clinfo/main.c
ViewVC logotype

Annotation of /branches/pure-cfg/src/clinfo/main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1242 - (view) (download) (as text)
Original Path: branches/pure-cfg/src/clinfo/clinfo.c

1 : jhr 1242 /*! \file clinfo.c
2 :     *
3 :     * \author John Reppy
4 :     *
5 :     * \brief This program is used to determine properties of the host machine's
6 :     * OpenCL support.
7 :     *
8 :     * Usage:
9 :     * clinfo cmd [args]
10 :     *
11 :     * where cmd is one of
12 :     * platforms -- prints a list of OpenCL platforms supported by the
13 :     * host.
14 :     * version platform -- prints version of OpenCL supported by the platform
15 :     * devices -- prints a list of devices
16 :     * extensions device -- prints a list of extensions that are
17 :     * supported by the device
18 :     */
19 :    
20 :     /*
21 :     * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
22 :     * All rights reserved.
23 :     */
24 :    
25 :     #include "Diderot/config.h"
26 :     # ifdef HAVE_CL_CL_H
27 :     # include <CL/cl.h>
28 :     # elif defined(HAVE_OPENCL_CL_H)
29 :     # include <OpenCL/cl.h>
30 :     # else
31 :     # error no cl.h
32 :     # endif
33 :     #include <stdio.h>
34 :    
35 :     int main (int argc, const char **argv)
36 :     {
37 :     cl_platform_id platforms[MAX_PLATFORMS];
38 :     int numPlatforms;
39 :    
40 :     // get number of OpenCL platforms
41 :     if (clGetPlatformIDs (MAX_PLATFORMS, platforms, &numPlatforms) != CL_SUCCESS) {
42 :     fprintf(stderr, "unable to get platform IDs\n");
43 :     return 1;
44 :     }
45 :    
46 :    
47 :     #if defined(CL_VERSION_1_1)
48 :     #elif define(CL_VERSION_1_0)
49 :     #else
50 :     # error unable to determine minimum OpenCL version
51 :     #endif
52 :    
53 :     }

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0