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

SCM Repository

[diderot] Annotation of /branches/pure-cfg/src/include/Diderot/cl-types.h
ViewVC logotype

Annotation of /branches/pure-cfg/src/include/Diderot/cl-types.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1271 - (view) (download) (as text)
Original Path: branches/pure-cfg/src/include/Diderot/opencl_types.h

1 : lamonts 1271 /*! \file opencl_types.h
2 :     *
3 :     * \author Lamont Samuels
4 :     */
5 :    
6 :     /*
7 :     * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
8 :     * All rights reserved.
9 :     */
10 :     #ifndef _DIDEROT_OPENCL_TYPES_H
11 :     #define _DIDEROT_OPENCL_TYPES_H
12 :    
13 :     typedef enum {
14 :     DIDEROT_ACTIVE = 0, //!< a currently running strand
15 :     DIDEROT_NEW = 1, //!< a newly created, but not yet active, strand
16 :     DIDEROT_DIE, //!< a dead strand
17 :     DIDEROT_STABILIZE, //!< a strand that will be stable at the end of
18 :     //!< the current step
19 :     DIDEROT_STABLE //!< a stable strand
20 :     } StrandStatus_t;
21 :    
22 :     typedef enum { DIDEROT_OK = 0, DIDEROT_FAIL = -1 } Status_t;
23 :    
24 :     /* OpenCL vector types */
25 :     typedef float2 vec2f_t;
26 :     typedef float4 vec4f_t;
27 :     typedef float8 vec8f_t;
28 :     typedef int2 vec2i_t;
29 :     typedef int4 vec4i_t;
30 :     typedef int8 vec8i_t;
31 :     typedef long2 vec2l_t;
32 :     typedef long4 vec4l_t;
33 :     typedef long8 vec8l_t;
34 :    
35 :     typedef char int8_t;
36 :     typedef uchar uint8_t;
37 :     typedef short int16_t;
38 :     typedef ushort uint16_t;
39 :     typedef uint uint32_t;
40 :     typedef int int32_t;
41 :     typedef long int64_t;
42 :     typedef ulong uint64_t;
43 :    
44 :     typedef union { float r[2]; vec2f_t v; } union2f_t;
45 :     typedef union { float r[4]; vec4f_t v; } union4f_t;
46 :     typedef union { float r[8]; vec8f_t v; } union8f_t;
47 :    
48 :     typedef union { int32_t i[2]; vec2i_t v; } union2i_t;
49 :     typedef union { int32_t i[4]; vec4i_t v; } union4i_t;
50 :     typedef union { int32_t i[8]; vec8i_t v; } union8i_t;
51 :    
52 :     typedef union { int64_t r[2]; vec2l_t v; } union2l_t;
53 :     typedef union { int64_t r[4]; vec4l_t v; } union4l_t;
54 :     typedef union { int64_t r[8]; vec8l_t v; } union8l_t;
55 :    
56 :     /* vector lengths must be power of 2, but vec3 is useful, so we pad to 4 */
57 :     typedef vec4f_t vec3f_t;
58 :     typedef union4f_t union3f_t;
59 :     typedef vec4i_t vec3i_t;
60 :     typedef union4i_t union3i_t;
61 :     typedef vec4l_t vec3l_t;
62 :     typedef union4l_t union3l_t;
63 :    
64 :    
65 :     typedef int32_t Diderot_int_t;
66 :     typedef float Diderot_real_t;
67 :     typedef vec2f_t Diderot_vec2_t;
68 :     typedef vec3f_t Diderot_vec3_t;
69 :     typedef vec4f_t Diderot_vec4_t;
70 :     typedef union2f_t Diderot_union2_t;
71 :     typedef union3f_t Diderot_union3_t;
72 :     typedef union4f_t Diderot_union4_t;
73 :     typedef union2f_t Diderot_Mat2x2_t[2]; // represented as row vectors
74 :     typedef union3f_t Diderot_Mat3x3_t[3]; // represented as row vectors
75 :     typedef union4f_t Diderot_Mat4x4_t[4]; // represented as row vectors
76 :    
77 :    
78 :     typedef struct { // wrapper for 1D image data
79 :     uint32_t dim; // dimension (== 1)
80 :     uint32_t size[1];
81 :     void *data;
82 :     Diderot_real_t s; // scaling from world-space to image-space
83 :     Diderot_real_t t; // translation from world-space to image-space
84 :     } Diderot_image1D_t;
85 :    
86 :     typedef struct { // wrapper for 2D image data
87 :     uint32_t dim; // dimension (== 2)
88 :     uint32_t size[2]; // sizes (fast to slow)
89 :     void *data;
90 :     Diderot_Mat2x2_t w2i; // affine tranform from world space to index space. This is the
91 :     // inverse of the index to world-space transform that is loaded from
92 :     // the Nrrd file.
93 :     Diderot_vec2_t tVec; // translation part of world to index transform
94 :     Diderot_Mat2x2_t w2iT; // transpose w3i
95 :     } Diderot_image2D_t;
96 :    
97 :     typedef struct { // wrapper for 3D image data
98 :     uint32_t dim; // dimension (== 3)
99 :     uint32_t size[3]; // sizes (fast to slow)
100 :     void *data;
101 :     Diderot_Mat3x3_t w2i; // affine tranform from world space to index space. This is the
102 :     // inverse of the index to world-space transform that is loaded from
103 :     // the Nrrd file.
104 :     Diderot_vec3_t tVec; // translation part of world to index transform
105 :     Diderot_Mat3x3_t w2iT; // transpose w3i
106 :     } Diderot_image3D_t;
107 :    
108 :    
109 :    
110 :     #endif /* !_DIDEROT_OPENCL_TYPES_H_ */
111 :    

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