anchor.diff:      let rndNumbers = Seq.initInfinite (fun _ -> rng.NextDouble() * 100. - 50. |> conv<'T>)
       let rndBools = Seq.initInfinite (fun _ -> rng.NextDouble() >= 0.5)
   
  -    let a = rndNumbers |> HostTensor.ofSeqWithShape shape |> Tensor.transfer dev
  -    let b = rndNumbers |> HostTensor.ofSeqWithShape shape |> Tensor.transfer dev
  -    let p = rndBools |> HostTensor.ofSeqWithShape shape |> Tensor.transfer dev
  -    let q = rndBools |> HostTensor.ofSeqWithShape shape |> Tensor.transfer dev
  +    let a = cache.Get "a" (fun () -> rndNumbers |> HostTensor.ofSeqWithShape shape) |> Tensor.transfer dev
  +    let b = cache.Get "b" (fun () -> rndNumbers |> HostTensor.ofSeqWithShape shape) |> Tensor.transfer dev
  +    let p = cache.Get "p" (fun () -> rndBools |> HostTensor.ofSeqWithShape shape) |> Tensor.transfer dev
  +    let q = cache.Get "q" (fun () -> rndBools |> HostTensor.ofSeqWithShape shape) |> Tensor.transfer dev
       
       let maskedSetTarget = Tensor<'T>.zeros dev shape
       let maskedSetElems = 
  -        if dev = HostTensor.Dev then a.M(p)
  +        if dev = HostTensor.Dev then cache.Get "maskedSetElems" (fun () -> a.M(p))
           else Tensor<'T>.zeros dev shape // masking currently unsupported on CUDA
  +
  +    do cache.Dispose ()
   
       interface IWorker with
           member __.Nothing () = let c = a in ()
  
positive.code:     abstract SymEigDec: unit -> unit
      
  
  type Worker<'T> (dev, shape) =
      let lastAxis = List.length shape - 1
      let nElems = shape |> List.fold (*) 1L
  
  
negative.code: ﻿open System
  open System.Reflection
  open System.IO
  open System.Collections.Generic
  
  open ManagedCuda
  open ManagedCuda.BasicTypes
  