# Generate Input for Tullio

**URL:** <https://discourse.julialang.org/t/generate-input-for-tullio/102859>\
**Category:** General Usage\
**Tags:** macros, tullio\
**Created:** [August 16, 2023, 12:08pm UTC](https://discourse.julialang.org/t/generate-input-for-tullio/102859 "2023-08-16T12:08:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexanderNenninger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexandernenninger/32/24602_2.png) [@AlexanderNenninger](https://discourse.julialang.org/u/AlexanderNenninger)\
**Post date:** [August 16, 2023, 12:08pm UTC](https://discourse.julialang.org/t/generate-input-for-tullio/102859/1 "2023-08-16T12:08:37Z")

</div>

I’d like to benchmark my own code for working with N-dimensional arrays. As baseline, Tullio seems to be the fastest, significantly faster than `sum`.

Given the setup

```julia
using BenchmarkTools
using Tullio

const M = 3
const N = 6
const dims = ntuple(x -> M, N)

# type(A) <: AbstractArray{T, N}, not specifically Array!
A = rand(dims...);

# Can be more complicated, but I'd like to get the MCVE working first.
@benchmark begin
    @tullio res = A[a, b, c, d, e, f]
end

```

How can I make my benchmark code parametric over `N` using a macro?

Edit: I’m also happy if a similar macro-less solution exists.

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [August 16, 2023, 1:27pm UTC](https://discourse.julialang.org/t/generate-input-for-tullio/102859/2 "2023-08-16T13:27:48Z")

</div>

I think [Tullio.jl does not allow for this](https://github.com/mcabbott/Tullio.jl/issues/11).

Probably you can adapt the snippets from @mcabbott
