anchor.diff:           (time 0)
            (flo 0))
       (with-cuda-context (dev-id)
  -      (with-memory-blocks ((f 'float (* nx ny))
  -                           (fn 'float (* nx ny)))
  -        (initialize-device-memory nx ny dx dy f)
  -        (start-timer)
  -        (dotimes (i 20000)
  -          (when (= (mod i 100) 0)
  -            (print-time i time))
  +      (with-timer (timer)
  +        (with-memory-blocks ((f 'float (* nx ny))
  +                             (fn 'float (* nx ny)))
  +          (initialize-device-memory nx ny dx dy f)
  +          (start-timer timer)
  +          (dotimes (i 20000)
  +            (when (= (mod i 100) 0)
  +              (print-time i time))
             ;(when (= (mod i nout) 0)
             ;  (output-pnm dir i nout nx ny f))
  -          (incf flo (diffusion2d nx ny f fn kappa dt dx dy))
  -          (incf time dt)
  -          (swap f fn))
  -        (print-time 20000 time)
  -        ;(output-pnm dir 20000 nout nx ny f)
  -        (print-elapsed-time)
  -        (print-performance flo)
  -        (stop-timer))))
  +            (incf flo (diffusion2d nx ny f fn kappa dt dx dy))
  +            (incf time dt)
  +            (swap f fn))
  +          (print-time 20000 time)
  +          ;(output-pnm dir 20000 nout nx ny f)
  +          (stop-timer timer)
  +          (synchronize-timer timer)
  +          (let ((elapsed-time (elapsed-time timer)))
  +            (print-elapsed-time elapsed-time)
  +            (print-performance flo elapsed-time))))))
     (values))
  
positive.code:         (let ((j (index nx jx jy))
                (x (- (* dx (+ (float jx 1.0) 0.5)) 0.5))
                (y (- (* dy (+ (float jy 1.0) 0.5)) 0.5)))
            (setf (mem-aref f j)
                  (exp (* (- alpha)
                          (+ (* x x) (* y y)))))))))
    (memcpy-host-to-device f))
  
  (defvar +block-dim-x+ 256)
  (defvar +block-dim-y+ 1)
  
negative.code:   (the fixnum (+ (the fixnum (* nx jy)) jx)))
  
  (defun image-value (f i j nx fmax fmin)
    (let ((fc (memory-block-aref f (index nx i j))))
      (truncate (* 256.0
                   (/ (- fc fmin) (- fmax fmin))))))
  
  