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

SCM Repository

[diderot] Annotation of /branches/pure-cfg/src/lib/cl-target/clinfo.h
ViewVC logotype

Annotation of /branches/pure-cfg/src/lib/cl-target/clinfo.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1377 - (view) (download) (as text)

1 : jhr 1267 /*! \file clinfo.h
2 :     *
3 :     * \author John Reppy
4 :     */
5 :    
6 :     /*
7 :     * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
8 :     * All rights reserved.
9 :     */
10 :    
11 :     #ifndef _CLINFO_H_
12 :     #define _CLINFO_H_
13 :    
14 : jhr 1269 #include "Diderot/diderot.h"
15 : jhr 1267 # ifdef HAVE_CL_CL_H
16 :     # include <CL/cl.h>
17 :     # elif defined(HAVE_OPENCL_CL_H)
18 :     # include <OpenCL/cl.h>
19 :     # else
20 :     # error no cl.h
21 :     # endif
22 :    
23 :     typedef struct {
24 :     char *name; //!< name of device
25 :     cl_device_id id; //!< the device ID
26 :     cl_device_type ty; //!< the type of the device
27 : jhr 1377 cl_uint addrBits; //!< number of address bits on device (32 or 64)
28 :     cl_bool littleEndian; //!< true if device is little endian
29 :     cl_uint numCUs; //!< number of compute units
30 :     cl_uint maxWIDims; //!< maximum number of work item dimensions
31 :     size_t maxWGSize; //!< maximum workgroup size
32 :     size_t *maxWISize; //!< maximum number of work items in each dimension
33 :     cl_ulong globalMemSzb; //!< the size of the device's global memory
34 :     cl_ulong localMemSzb; //!< the size of the device's local memory
35 :     cl_ulong maxAllocSzb; //!< maximum allocation size in bytes
36 :     size_t maxImg2D[2]; //!< maximum width and height of 2D images
37 :     size_t maxImg3D[3]; //!< maximim width, height, and depthe of 3D images
38 : jhr 1267 } DeviceInfo_t;
39 :    
40 :     typedef struct {
41 :     char *name; //!< name of platform
42 :     cl_platform_id id; //! the platform ID
43 :     int numDevices; //!< number of devices supported by platform
44 :     DeviceInfo_t *devices; //!< array of devices
45 :     } PlatformInfo_t;
46 :    
47 :     typedef struct {
48 :     int numPlatforms; //!< number of platforms supported by system
49 :     PlatformInfo_t *platforms; //!< array of supported platforms.
50 :     } CLInfo_t;
51 :    
52 :     /*! \brief return information about the OpenCL support of the system.
53 :     * \return pointer to a CLInfo_t structure or 0 if there is an error.
54 :     */
55 :     CLInfo_t *GetCLInfo ();
56 :    
57 :     #endif /* !_CLINFO_H_ */

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