anchor.diff:      (with-valid-index-cpu (i n)
         (%update-velocity-cpu i v a))))
   
  -;; (defkernel %update-position (void ((i int) (x float4*) (v float4*)))
  -;;   (symbol-macrolet ((xi (aref x i))
  -;;                     (vi (aref v i)))
  -;;     (inc xi (/ (* vi dt)
  -;;               simscale))))
  -;; 
  -;; (defkernel update-position (void ((x float4*) (v float4*) (n int)))
  -;;   (with-valid-index (i n)
  -;;     (%update-position i x v)))
  +;; returns dummy integer to avoid __host__ qualifier
  +(defkernel %update-position (int ((i int) (x float4*) (v float4*)))
  +  (symbol-macrolet ((xi (aref x i))
  +                    (vi (aref v i)))
  +    (inc xi (/ (* vi dt)
  +              simscale)))
  +  (return 0))
  +
  +(defkernel update-position (void ((x float4*) (v float4*) (n int)))
  +  (with-valid-index (i n)
  +    (%update-position i x v)))
   
   (defun %update-position-cpu (i x v)
     (symbol-macrolet ((xi (mem-aref x i))
  
positive.code:     (with-valid-index-cpu (i n)
        (%update-density-cpu i rho x nbr info))))
  
  
  ;; (defkernel %update-pressure (void ((int i) (rho float*) (x float) (nbr int*) (info float*)))
  ;;   (symbol-macrolet ((rhoi (aref rho i))
  ;;                     (prsi (aref prs i)))
  ;;     (set prsi (* (- rhoi restdensity)
  ;;                  intstiff))))
  ;;
  ;; (defkernel update-pressure (void ((rho float*) (x float) (nbr int*) (info float*) (n int)))
  ;;   (with-valid-index (i n)
  ;;     (%update-pressure i rho x nbr info)))
  
  (defun %update-pressure-cpu (i prs rho)
    (symbol-macrolet ((rhoi (mem-aref rho i))
  
negative.code:     (with-valid-index-cpu (i n)
        (%boundary-condition-cpu i x v a info))))
  
  ;; returns dummy integer to avoid __host__ qualifier
  (defkernel %update-acceleration (int ((i int) (a float4*) (f float4*) (rho float*)))
    (symbol-macrolet ((ai   (aref a i))
                      (fi   (aref f i))
                      (rhoi (aref rho i)))
      (let ((g2 (float4 0.0 -9.8 0.0 0.0)))
        (set ai (+ (/ fi rhoi) g))))
    (return 0))
  
  (defkernel update-acceleration (void ((a float4*) (f float4*) (rho float*) (n int)))
    (with-valid-index (i n)
      (%update-acceleration i a f rho)))
  
  (defun %update-acceleration-cpu (i a f rho)
    (symbol-macrolet ((ai   (mem-aref a i))
                      (fi   (mem-aref f i))
                      (rhoi (mem-aref rho i)))
      (let ((g (make-float4 0.0 -9.8 0.0 0.0)))
        (setf ai (float4-add-cpu (float4-scale-inverted-cpu fi rhoi)
                                 g)))))
  
  (defun update-acceleration-cpu (a f rho n &key grid-dim block-dim)
    (with-thread-block (grid-dim block-dim)
      (with-valid-index-cpu (i n)
        (%update-acceleration-cpu i a f rho))))
  
  ;; returns dummy integer to avoid __host__ qualifier
  (defkernel %update-velocity (int ((i int) (v float4*) (a float4*)))
    (symbol-macrolet ((vi (aref v i))
                      (ai (aref a i)))
      (inc vi (* ai dt)))
    (return 0))
  
  (defkernel update-velocity (void ((v float4*) (a float4*) (n int)))
    (with-valid-index (i n)
      (%update-velocity i v a)))
  
  (defun %update-velocity-cpu (i v a)
    (symbol-macrolet ((vi (mem-aref v i))
  