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

SCM Repository

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

Diff of /branches/pure-cfg/src/include/Diderot/shadow-types.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1427, Fri Jul 1 18:32:30 2011 UTC revision 1428, Fri Jul 1 18:57:08 2011 UTC
# Line 84  Line 84 
84  /*! \brief initialize a shadow 2D vector from a host vector.  /*! \brief initialize a shadow 2D vector from a host vector.
85   *  \param dst the shadow value to initialize (an array)   *  \param dst the shadow value to initialize (an array)
86   *  \param src the host vector to shadow.   *  \param src the host vector to shadow.
  *  
  * Note that the correctness of this function depends on the fact that  
  * the Shadow_vec2_t type is an array.  
87   */   */
88  STATIC_INLINE void ShadowVec2 (Shadow_vec2_t dst, Diderot_vec2_t src)  STATIC_INLINE void ShadowVec2 (Shadow_vec2_t dst, Diderot_vec2_t src)
89  {  {
# Line 97  Line 94 
94  /*! \brief initialize a shadow 3D vector from a host vector.  /*! \brief initialize a shadow 3D vector from a host vector.
95   *  \param dst the shadow value to initialize (an array)   *  \param dst the shadow value to initialize (an array)
96   *  \param src the host vector to shadow.   *  \param src the host vector to shadow.
  *  
  * Note that the correctness of this function depends on the fact that  
  * the Shadow_vec3_t type is an array.  
97   */   */
98  STATIC_INLINE void ShadowVec3 (Shadow_vec3_t dst, Diderot_vec3_t src)  STATIC_INLINE void ShadowVec3 (Shadow_vec3_t dst, Diderot_vec3_t src)
99  {  {
# Line 111  Line 105 
105  /*! \brief initialize a shadow 4D vector from a host vector.  /*! \brief initialize a shadow 4D vector from a host vector.
106   *  \param dst the shadow value to initialize (an array)   *  \param dst the shadow value to initialize (an array)
107   *  \param src the host vector to shadow.   *  \param src the host vector to shadow.
  *  
  * Note that the correctness of this function depends on the fact that  
  * the Shadow_vec4_t type is an array.  
108   */   */
109  STATIC_INLINE void ShadowVec4 (Shadow_vec4_t dst, Diderot_vec4_t src)  STATIC_INLINE void ShadowVec4 (Shadow_vec4_t dst, Diderot_vec4_t src)
110  {  {
# Line 177  Line 168 
168   */   */
169  void ShadowImage3D (cl_context cxt, Shadow_image3D_t *dst, Diderot_image3D_t *img);  void ShadowImage3D (cl_context cxt, Shadow_image3D_t *dst, Diderot_image3D_t *img);
170    
171    /*! \brief initialize a host 2D vector from a shadow vector.
172     *  \param dst the host value to initialize (an array)
173     *  \param src the shadow vector (an array)
174     */
175    STATIC_INLINE void UnshadowVec2 (Diderot_vec2_t dst, Shadow_vec2_t src)
176    {
177        ((Diderot_union2_t)(dst)).r[0] = VSUB(src,0);
178        ((Diderot_union2_t)(dst)).r[1] = VSUB(src,1);
179    }
180    
181    /*! \brief initialize a host 3D vector from a shadow vector.
182     *  \param dst the host value to initialize (an array)
183     *  \param src the shadow vector (an array)
184     */
185    STATIC_INLINE void UnshadowVec3 (Diderot_vec3_t dst, Shadow_vec3_t src)
186    {
187        ((Diderot_union3_t)(dst)).r[0] = VSUB(src,0);
188        ((Diderot_union3_t)(dst)).r[1] = VSUB(src,1);
189        ((Diderot_union3_t)(dst)).r[2] = VSUB(src,2);
190    }
191    
192    /*! \brief initialize a host 4D vector from a shadow vector.
193     *  \param dst the host value to initialize (an array)
194     *  \param src the shadow vector (an array)
195     */
196    STATIC_INLINE void UnshadowVec4 (Diderot_vec4_t dst, Shadow_vec4_t src)
197    {
198        ((Diderot_union4_t)(dst)).r[0] = VSUB(src,0);
199        ((Diderot_union4_t)(dst)).r[1] = VSUB(src,1);
200        ((Diderot_union4_t)(dst)).r[2] = VSUB(src,2);
201        ((Diderot_union4_t)(dst)).r[3] = VSUB(src,3);
202    }
203    
204  #endif /* !_SHADOW_TYPES_H_ */  #endif /* !_SHADOW_TYPES_H_ */

Legend:
Removed from v.1427  
changed lines
  Added in v.1428

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