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 1272 - (view) (download) (as text)

1 : jhr 1272 /*! \file cl-types.h
2 : lamonts 1271 *
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 : jhr 1272
11 :     #ifndef _DIDEROT_CL_TYPES_H_
12 :     #define _DIDEROT_CL_TYPES_H_
13 : lamonts 1271
14 :     typedef enum {
15 :     DIDEROT_ACTIVE = 0, //!< a currently running strand
16 :     DIDEROT_NEW = 1, //!< a newly created, but not yet active, strand
17 :     DIDEROT_DIE, //!< a dead strand
18 :     DIDEROT_STABILIZE, //!< a strand that will be stable at the end of
19 : jhr 1272 //!< the current step
20 : lamonts 1271 DIDEROT_STABLE //!< a stable strand
21 :     } StrandStatus_t;
22 :    
23 : jhr 1272 /* OpenCL version 1.00 does not support 3-element vectors */
24 :     #if __OPENCL_VERSION__ < 110
25 :     typedef int4 int3;
26 :     typedef float4 float3;
27 :     #endif
28 : lamonts 1271
29 : jhr 1272 #if defined(DIDEROT_SINGLE_PRECISION)
30 :     typedef int Diderot_int_t;
31 :     typedef float Diderot_real_t;
32 :     typedef float2 Diderot_vec2_t;
33 :     typedef float3 Diderot_vec3_t;
34 :     typedef float4 Diderot_vec4_t;
35 :     #else
36 :     # error double precision not yet supported
37 :     #endif
38 : lamonts 1271
39 : jhr 1272 typedef Diderot_vec2_t Diderot_Mat2x2_t[2]; // represented as row vectors
40 :     typedef Diderot_vec3_t Diderot_Mat3x3_t[3]; // represented as row vectors
41 :     typedef Diderot_vec4_t Diderot_Mat4x4_t[4]; // represented as row vectors
42 : lamonts 1271
43 :    
44 :     typedef struct { // wrapper for 1D image data
45 : jhr 1272 uint dim; // dimension (== 1)
46 :     uint size[1];
47 : lamonts 1271 void *data;
48 :     Diderot_real_t s; // scaling from world-space to image-space
49 :     Diderot_real_t t; // translation from world-space to image-space
50 :     } Diderot_image1D_t;
51 :    
52 :     typedef struct { // wrapper for 2D image data
53 : jhr 1272 uint dim; // dimension (== 2)
54 :     uint size[2]; // sizes (fast to slow)
55 : lamonts 1271 void *data;
56 :     Diderot_Mat2x2_t w2i; // affine tranform from world space to index space. This is the
57 :     // inverse of the index to world-space transform that is loaded from
58 :     // the Nrrd file.
59 :     Diderot_vec2_t tVec; // translation part of world to index transform
60 :     Diderot_Mat2x2_t w2iT; // transpose w3i
61 :     } Diderot_image2D_t;
62 :    
63 :     typedef struct { // wrapper for 3D image data
64 : jhr 1272 uint dim; // dimension (== 3)
65 :     uint size[3]; // sizes (fast to slow)
66 : lamonts 1271 void *data;
67 :     Diderot_Mat3x3_t w2i; // affine tranform from world space to index space. This is the
68 :     // inverse of the index to world-space transform that is loaded from
69 :     // the Nrrd file.
70 :     Diderot_vec3_t tVec; // translation part of world to index transform
71 :     Diderot_Mat3x3_t w2iT; // transpose w3i
72 :     } Diderot_image3D_t;
73 :    
74 : jhr 1272 #endif /* !_DIDEROT_CL_TYPES_H_ */
75 : lamonts 1271

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