18 #include <boost/preprocessor.hpp> 29 #define ISAAC_COMPONENTS_SEQ_3 (x)(y)(z)(w) 30 #define ISAAC_COMPONENTS_SEQ_2 (x)(y)(z) 31 #define ISAAC_COMPONENTS_SEQ_1 (x)(y) 32 #define ISAAC_COMPONENTS_SEQ_0 (x) 36 #define ISAAC_FLOAT_DEF(Z, I, unused) \ 37 struct BOOST_PP_CAT(isaac_float, BOOST_PP_INC(I) ) \ 39 isaac_float BOOST_PP_SEQ_ENUM( BOOST_PP_CAT( ISAAC_COMPONENTS_SEQ_ , I ) ); \ 42 #undef ISAAC_FLOAT_DEF 44 #define ISAAC_UINT_DEF(Z, I, unused) \ 45 struct BOOST_PP_CAT(isaac_uint, BOOST_PP_INC(I) ) \ 47 isaac_uint BOOST_PP_SEQ_ENUM( BOOST_PP_CAT( ISAAC_COMPONENTS_SEQ_ , I ) ); \ 52 #define ISAAC_INT_DEF(Z, I, unused) \ 53 struct BOOST_PP_CAT(isaac_int, BOOST_PP_INC(I) ) \ 55 isaac_int BOOST_PP_SEQ_ENUM( BOOST_PP_CAT( ISAAC_COMPONENTS_SEQ_ , I ) ); \ 61 #define ISAAC_CUDA_DEF(Z, I, unused) \ 62 typedef BOOST_PP_CAT(float, BOOST_PP_INC(I) ) BOOST_PP_CAT(isaac_float, BOOST_PP_INC(I) ); \ 63 typedef BOOST_PP_CAT(uint, BOOST_PP_INC(I) ) BOOST_PP_CAT(isaac_uint, BOOST_PP_INC(I) ); \ 64 typedef BOOST_PP_CAT(int, BOOST_PP_INC(I) ) BOOST_PP_CAT(isaac_int, BOOST_PP_INC(I) ); 65 BOOST_PP_REPEAT(4, ISAAC_CUDA_DEF, ~)
70 #define ISAAC_SIZE_DEF(Z, I, unused) \ 71 struct BOOST_PP_CAT(isaac_size, BOOST_PP_INC(I) ) \ 73 size_t BOOST_PP_SEQ_ENUM( BOOST_PP_CAT( ISAAC_COMPONENTS_SEQ_ , I ) ); \ 80 #define ISAAC_OVERLOAD_OPERATOR_SUBDEF(Z, I, OP ) \ 81 result. BOOST_PP_ARRAY_ELEM( I, BOOST_PP_SEQ_TO_ARRAY( ISAAC_COMPONENTS_SEQ_3 ) ) = \ 82 left. BOOST_PP_ARRAY_ELEM( I, BOOST_PP_SEQ_TO_ARRAY( ISAAC_COMPONENTS_SEQ_3 ) ) BOOST_PP_ARRAY_ELEM( 1, OP ) \ 83 right. BOOST_PP_ARRAY_ELEM( I, BOOST_PP_SEQ_TO_ARRAY( ISAAC_COMPONENTS_SEQ_3 ) ); 85 #define ISAAC_OVERLOAD_OPERATOR_SUBDEF_ROTHER(Z, I, OP ) \ 86 result. BOOST_PP_ARRAY_ELEM( I, BOOST_PP_SEQ_TO_ARRAY( ISAAC_COMPONENTS_SEQ_3 ) ) = \ 87 left. BOOST_PP_ARRAY_ELEM( I, BOOST_PP_SEQ_TO_ARRAY( ISAAC_COMPONENTS_SEQ_3 ) ) BOOST_PP_ARRAY_ELEM( 1, OP ) \ 90 #define ISAAC_OVERLOAD_OPERATOR_SUBDEF_LOTHER(Z, I, OP ) \ 91 result. BOOST_PP_ARRAY_ELEM( I, BOOST_PP_SEQ_TO_ARRAY( ISAAC_COMPONENTS_SEQ_3 ) ) = \ 92 left BOOST_PP_ARRAY_ELEM( 1, OP ) \ 93 right. BOOST_PP_ARRAY_ELEM( I, BOOST_PP_SEQ_TO_ARRAY( ISAAC_COMPONENTS_SEQ_3 ) ); 95 #define ISAAC_OVERLOAD_OPERATOR_SUBDEF_UNARY(Z, I, OP ) \ 96 result. BOOST_PP_ARRAY_ELEM( I, BOOST_PP_SEQ_TO_ARRAY( ISAAC_COMPONENTS_SEQ_3 ) ) = BOOST_PP_ARRAY_ELEM( 1, OP ) \ 97 left. BOOST_PP_ARRAY_ELEM( I, BOOST_PP_SEQ_TO_ARRAY( ISAAC_COMPONENTS_SEQ_3 ) ); 100 #define ISAAC_OVERLOAD_OPERATOR_DEF(Z, I, OP) \ 101 ISAAC_HOST_DEVICE_INLINE BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) operator BOOST_PP_ARRAY_ELEM( 1, OP ) ( \ 102 const BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) & left, \ 103 const BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) & right) \ 105 BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) result; \ 106 BOOST_PP_REPEAT( BOOST_PP_INC(I), ISAAC_OVERLOAD_OPERATOR_SUBDEF, OP ) \ 109 ISAAC_HOST_DEVICE_INLINE BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) operator BOOST_PP_ARRAY_ELEM( 1, OP ) ( \ 110 const BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) & left, \ 111 const isaac_float & right) \ 113 BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) result; \ 114 BOOST_PP_REPEAT( BOOST_PP_INC(I), ISAAC_OVERLOAD_OPERATOR_SUBDEF_ROTHER, OP ) \ 117 ISAAC_HOST_DEVICE_INLINE BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) operator BOOST_PP_ARRAY_ELEM( 1, OP ) ( \ 118 const isaac_float & left, \ 119 const BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) & right ) \ 121 BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) result; \ 122 BOOST_PP_REPEAT( BOOST_PP_INC(I), ISAAC_OVERLOAD_OPERATOR_SUBDEF_LOTHER, OP ) \ 126 #define ISAAC_OVERLOAD_OPERATOR_DEF_UNARY(Z, I, OP) \ 127 ISAAC_HOST_DEVICE_INLINE BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) operator BOOST_PP_ARRAY_ELEM( 1, OP ) ( \ 128 const BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) & left ) \ 130 BOOST_PP_CAT( BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( 0, OP ) ), BOOST_PP_INC(I) ) result; \ 131 BOOST_PP_REPEAT( BOOST_PP_INC(I), ISAAC_OVERLOAD_OPERATOR_SUBDEF_UNARY, OP ) \ 135 #define ISAAC_OVERLOAD_OPERATOR_COUNT 4 136 #define ISAAC_OVERLOAD_OPERATORS (ISAAC_OVERLOAD_OPERATOR_COUNT, (+, -, *, / ) ) 138 #define ISAAC_OVERLOAD_ITERATOR(Z, I, TYPE) \ 139 BOOST_PP_REPEAT( 4, ISAAC_OVERLOAD_OPERATOR_DEF, (2, (TYPE, BOOST_PP_ARRAY_ELEM( I, ISAAC_OVERLOAD_OPERATORS ) ) ) ) \ 141 #define ISAAC_OVERLOAD_OPERATOR_CREATE( TYPE ) \ 142 BOOST_PP_REPEAT( ISAAC_OVERLOAD_OPERATOR_COUNT, ISAAC_OVERLOAD_ITERATOR, TYPE ) \ 143 BOOST_PP_REPEAT( 4, ISAAC_OVERLOAD_OPERATOR_DEF_UNARY, (2, (TYPE, - ) ) ) 150 #undef ISAAC_OVERLOAD_OPERATOR_SUBDEF_LOTHER 151 #undef ISAAC_OVERLOAD_OPERATOR_SUBDEF_ROTHER 152 #undef ISAAC_OVERLOAD_OPERATOR_COUNT 153 #undef ISAAC_OVERLOAD_OPERATORS 154 #undef ISAAC_OVERLOAD_ITERATOR 155 #undef ISAAC_OVERLOAD_OPERATOR_SUBDEF 156 #undef ISAAC_OVERLOAD_OPERATOR_SUBDEF_UNARY 157 #undef ISAAC_OVERLOAD_OPERATOR_DEF 158 #undef ISAAC_OVERLOAD_OPERATOR_DEF_UNARY 159 #undef ISAAC_OVERLOAD_OPERATOR_CREATE 161 #define ISAAC_DIM_TYPES ( 4, ( size, float, int, uint ) ) 162 #define ISAAC_DIM_TYPES_DIM ( 4, ( size_dim, float_dim, int_dim, uint_dim ) ) 164 #define ISAAC_DIM_SUBDEF(Z, J, I ) \ 166 struct BOOST_PP_CAT( isaac_, BOOST_PP_ARRAY_ELEM( I, ISAAC_DIM_TYPES_DIM ) ) \ 167 < size_t( BOOST_PP_INC(J) ) > { \ 168 BOOST_PP_CAT( isaac_, BOOST_PP_CAT( BOOST_PP_ARRAY_ELEM( I, ISAAC_DIM_TYPES ) , BOOST_PP_INC(J) ) ) value; }; 170 #define ISAAC_DIM_DEF(Z, I, unused) \ 171 template < size_t > \ 172 struct BOOST_PP_CAT( isaac_ , BOOST_PP_ARRAY_ELEM( I, ISAAC_DIM_TYPES_DIM ) ); \ 173 BOOST_PP_REPEAT( 4, ISAAC_DIM_SUBDEF, I ) 177 #undef ISAAC_DIM_SUBDEF 179 #undef ISAAC_DIM_TYPES 180 #undef ISAAC_DIM_TYPES_DIM 182 template <
size_t simdim >
199 isaac_float4* pointer[ N ];
205 isaac_float4* pointer[ N ];
206 std::map< isaac_uint, isaac_float4 > description[ N ];
219 isaac_float value[ N ];
237 isaac_float min[ N ];
238 isaac_float max[ N ];
isaac_size_dim< simdim > local_size
IsaacVisualizationMetaEnum
ISAAC_HOST_DEVICE_INLINE clipping_struct()
#define ISAAC_UINT_DEF(Z, I, unused)
isaac_size_dim< simdim > position_scaled
#define ISAAC_INT_DEF(Z, I, unused)
isaac_size_dim< simdim > local_size_scaled
isaac_size_dim< simdim > global_size_scaled
#define ISAAC_SIZE_DEF(Z, I, unused)
#define ISAAC_MAX_FUNCTORS
#define ISAAC_OVERLOAD_OPERATOR_CREATE(TYPE)
#define ISAAC_HOST_DEVICE_INLINE
#define ISAAC_FLOAT_DEF(Z, I, unused)
size_t max_global_size_scaled
#define ISAAC_DIM_DEF(Z, I, unused)
#define ISAAC_MAX_CLIPPING
isaac_size_dim< simdim > global_size
isaac_size_dim< simdim > position