Hi all,

I'm getting the error:

```
Error: variable i cannot be read at compile time
Error: template instance script.runKernelBenchmarks!(Tuple!(DotProduct!float, Gaussian!float, Polynomial!float, Exponential!float, Log!float, Cauchy!float, Power!float, Wave!float, Sigmoid!float)) error instantiating
```

When I run ...

```
...
auto runKernelBenchmarks(KS)(KS kernels, long[] n, bool verbose = true)
{
  auto tmp = bench(kernels[0], n, verbose);
  alias R = typeof(tmp);
  R[] results = new R[kernels.length];
  results[0] = tmp;
  for(size_t i = 1; i < results.length; ++i)
  {
    results[i] = bench(kernels[i], n, verbose);
  }
  return results;
}

void main()
{
  alias T = float;
auto kernels = tuple(DotProduct!(T)(), Gaussian!(T)(1), Polynomial!(T)(2.5f, 1), Exponential!(T)(1), Log!(T)(3), Cauchy!(T)(1), Power!(T)(2.5f), Wave!(T)(1), Sigmoid!(T)(1, 1));
  string[] kernelNames = ["DotProduct",  "Gaussian", "Polynomial",
                       "Exponential", "Log",      "Cauchy",
                       "Power",       "Wave",     "Sigmoid"];
  long[] n = [100L, 500L, 1000L];
  auto results = runKernelBenchmarks(kernels, n);
  writeln("Results: ", results);
}
```

Thanks

Reply via email to