anchor.diff:                                                               sizes: Expr list,
                                                                args: Dictionary<string, obj>, 
                                                                localSize: int array,
  -                                                             globalSize: int array) =        
  -        let intSizes = sizes |> 
  -                        List.map(fun (e:Expr) -> this.LiftArgumentsAndKernelCalls(e, args, localSize, globalSize).EvalUntyped() :?> int)
  -        ExplicitAllocationSize(intSizes |> List.toArray)           
  +                                                             globalSize: int array) =   
  +        let intSizes = new List<int>()    
  +        for exp in sizes do
  +            let lifted = this.LiftArgumentsAndKernelCalls(exp, args, localSize, globalSize)
  +            let evaluated = lifted.EvalUntyped()
  +            intSizes.Add(evaluated :?> int)
  +        ExplicitAllocationSize(intSizes |> Seq.toArray)           
   
       member private this.AddReturnTypeVar(kernel:FunctionInfo, var:Var, args:Expr list) =
           if (var.IsMutable) then
  
positive.code:             else if m.DeclaringType.Name = "KernelLanguage" && (m.Name = "get_work_dim") then
                  Expr.Value(globalSize.Rank)
              else
                  e
          | Patterns.Var(v) ->
              if (args.ContainsKey(v.Name)) then
                  Expr.Value(args.[v.Name])
              else
                  e
          | ExprShape.ShapeVar(v) ->
              e
          | ExprShape.ShapeLambda(l, b) ->
  
negative.code:                                                     localSize: int array,
                                                      globalSize: int array) =
          match e with
          // Return allocation expression can contain a call to global_size, local_size, num_groups or work_dim
          | Patterns.Call(o, m, arguments) ->
              if m.DeclaringType.Name = "KernelLanguage" && (m.Name = "get_global_size") then
                  Expr.Value(globalSize.[arguments.[0].EvalUntyped() :?> int])
  