SCM Repository
View of /branches/vis12/src/include/Diderot/types.h
Parent Directory
|
Revision Log
Revision 2361 -
(download)
(as text)
(annotate)
Sun Apr 7 16:33:14 2013 UTC (7 years, 10 months ago) by jhr
File size: 6651 byte(s)
Sun Apr 7 16:33:14 2013 UTC (7 years, 10 months ago) by jhr
File size: 6651 byte(s)
changes from trunk (e.g., 32-bit support)
/*! \file types.h * * \author John Reppy */ /* * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu) * All rights reserved. */ #ifndef _DIDEROT_TYPES_H_ #define _DIDEROT_TYPES_H_ /* library-call status */ typedef enum { DIDEROT_OK = 0, DIDEROT_FAIL = -1 } Status_t; /*! \brief The strand status type is used to both track the current status * of a strand in the runtime system and as the return type for the update * method. */ typedef enum { DIDEROT_ACTIVE = 0, //!< a currently running strand DIDEROT_NEW = 1, //!< a newly created, but not yet active, strand DIDEROT_DIE, //!< a dead strand DIDEROT_STABILIZE, //!< a strand that will be stable at the end of //!< the current step DIDEROT_STABLE //!< a stable strand } StrandStatus_t; /* strand descriptor */ typedef struct struct_strand Strand_t; /* SSE vector types */ typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); #ifdef VEC2_OK typedef float vec2f_t __attribute__ ((vector_size (8))); #else typedef float vec2f_t __attribute__ ((vector_size (16))); // pad so that gcc aligns correctly #endif typedef float vec4f_t __attribute__ ((vector_size (16))); typedef float vec8f_t __attribute__ ((vector_size (32))); #ifdef VEC2_OK typedef int32_t vec2i_t __attribute__ ((vector_size (8))); #else typedef int32_t vec2i_t __attribute__ ((vector_size (16))); // pad so that gcc aligns correctly #endif typedef int32_t vec4i_t __attribute__ ((vector_size (16))); typedef int32_t vec8i_t __attribute__ ((vector_size (32))); typedef double vec2d_t __attribute__ ((vector_size (16))); typedef double vec4d_t __attribute__ ((vector_size (32))); typedef double vec8d_t __attribute__ ((vector_size (64))); typedef int64_t vec2l_t __attribute__ ((vector_size (16))); typedef int64_t vec4l_t __attribute__ ((vector_size (32))); typedef int64_t vec8l_t __attribute__ ((vector_size (64))); typedef union { float r[2]; vec2f_t v; } union2f_t; typedef union { float r[4]; vec4f_t v; } union4f_t; typedef union { float r[8]; vec8f_t v; } union8f_t; typedef union { int32_t i[2]; vec2i_t v; } union2i_t; typedef union { int32_t i[4]; vec4i_t v; } union4i_t; typedef union { int32_t i[8]; vec8i_t v; } union8i_t; typedef union { double r[2]; vec2d_t v; } union2d_t; typedef union { double r[4]; vec4d_t v; } union4d_t; typedef union { double r[8]; vec8d_t v; } union8d_t; typedef union { int64_t r[2]; vec2l_t v; } union2l_t; typedef union { int64_t r[4]; vec4l_t v; } union4l_t; typedef union { int64_t r[8]; vec8l_t v; } union8l_t; /* vector lengths must be power of 2, but vec3 and vec6 are useful, so we pad to 4 and 8 (resp.) */ typedef vec4f_t vec3f_t; typedef union4f_t union3f_t; typedef vec4d_t vec3d_t; typedef union4d_t union3d_t; typedef vec4i_t vec3i_t; typedef union4i_t union3i_t; typedef vec4l_t vec3l_t; typedef union4l_t union3l_t; typedef vec8f_t vec6f_t; typedef union8f_t union6f_t; typedef vec8d_t vec6d_t; typedef union8d_t union6d_t; /* typedefs for Diderot types */ #if defined(DIDEROT_SINGLE_PRECISION) typedef float Diderot_real_t; typedef vec2f_t Diderot_vec2_t; typedef vec3f_t Diderot_vec3_t; typedef vec4f_t Diderot_vec4_t; typedef vec6f_t Diderot_vec6_t; typedef union2f_t Diderot_union2_t; typedef union3f_t Diderot_union3_t; typedef union4f_t Diderot_union4_t; typedef union6f_t Diderot_union6_t; typedef union2f_t Diderot_Mat2x2_t[2]; // represented as row vectors typedef union3f_t Diderot_Mat3x3_t[3]; // represented as row vectors typedef union4f_t Diderot_Mat4x4_t[4]; // represented as row vectors typedef union2f_t Diderot_Ten2x2x2_t[2][2]; typedef union3f_t Diderot_Ten3x3x3_t[3][3]; typedef union4f_t Diderot_Ten4x4x4_t[4][4]; #elif defined(DIDEROT_DOUBLE_PRECISION) typedef double Diderot_real_t; typedef vec2d_t Diderot_vec2_t; typedef vec3d_t Diderot_vec3_t; typedef vec4d_t Diderot_vec4_t; typedef vec6d_t Diderot_vec6_t; typedef union2d_t Diderot_union2_t; typedef union3d_t Diderot_union3_t; typedef union4d_t Diderot_union4_t; typedef union6d_t Diderot_union6_t; typedef union2d_t Diderot_Mat2x2_t[2]; // represented as row vectors typedef union3d_t Diderot_Mat3x3_t[3]; // represented as row vectors typedef union4d_t Diderot_Mat4x4_t[4]; // represented as row vectors typedef union2d_t Diderot_Ten2x2x2_t[2][2]; typedef union3d_t Diderot_Ten3x3x3_t[3][3]; typedef union4d_t Diderot_Ten4x4x4_t[4][4]; #else # error floating-point precision unknown #endif #if defined(DIDEROT_INT) typedef int32_t Diderot_int_t; typedef uint32_t Diderot_uint_t; typedef vec2i_t Diderot_ivec2_t; typedef vec3i_t Diderot_ivec3_t; typedef vec4i_t Diderot_ivec4_t; typedef union2i_t Diderot_iunion2_t; typedef union3i_t Diderot_iunion3_t; typedef union4i_t Diderot_iunion4_t; #elif defined(DIDEROT_LONGINT) typedef int64_t Diderot_int_t; typedef uint64_t Diderot_uint_t; typedef vec2l_t Diderot_ivec2_t; typedef vec3l_t Diderot_ivec3_t; typedef vec4l_t Diderot_ivec4_t; typedef union2l_t Diderot_iunion2_t; typedef union3l_t Diderot_iunion3_t; typedef union4l_t Diderot_iunion4_t; #else # error integer precision unknown #endif typedef char *Diderot_string_t; typedef struct { // wrapper for 1D image data uint32_t dim; //!< dimension (== 1) uint32_t size[1]; size_t dataSzb; //!< size of data in bytes void *data; Diderot_real_t s; //!< scaling from world-space to image-space Diderot_real_t t; //!< translation from world-space to image-space } Diderot_image1D_t; typedef struct { // wrapper for 2D image data uint32_t dim; //!< dimension (== 2) uint32_t size[2]; //!< sizes (fast to slow) size_t dataSzb; //!< size of data in bytes void *data; Diderot_Mat2x2_t w2i; //!< affine tranform from world space to index space. This is the //! inverse of the index to world-space transform that is loaded from //! the Nrrd file. Diderot_vec2_t tVec; //!< translation part of world to index transform Diderot_Mat2x2_t w2iT; //!< transpose w3i } Diderot_image2D_t; typedef struct { // wrapper for 3D image data uint32_t dim; //!< dimension (== 3) uint32_t size[3]; //!< sizes (fast to slow) size_t dataSzb; //!< size of data in bytes void *data; Diderot_Mat3x3_t w2i; //!< affine tranform from world space to index space. This is the //! inverse of the index to world-space transform that is loaded from //! the Nrrd file. Diderot_vec3_t tVec; //!< translation part of world to index transform Diderot_Mat3x3_t w2iT; //!< transpose w3i } Diderot_image3D_t; #endif /* !_DIDEROT_TYPES_H_ */
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |