Conditional parameter evaluation

Hello, I was wondering if there was a way to write conditional parameter evaluation, something like @parameter(condition) to apply the @parameter only if condition is true. Practial example of unrolling loop:
# Current:
@parameter
if nchunks <= 4:
@parameter
for chunk in range(nchunks):
var idx = ...
dest.store(idx, src.load[width=32](idx))
else:
for chunk in range(nchunks):
var idx = ...
dest.store(idx, src.load[width=32](idx))

# Ideal:
@parameter(nchunks <= 4)
for chunk in range(nchunks):
var idx = ...
dest.store(idx, src.load[width=32](idx))
# Current:
@parameter
if nchunks <= 4:
@parameter
for chunk in range(nchunks):
var idx = ...
dest.store(idx, src.load[width=32](idx))
else:
for chunk in range(nchunks):
var idx = ...
dest.store(idx, src.load[width=32](idx))

# Ideal:
@parameter(nchunks <= 4)
for chunk in range(nchunks):
var idx = ...
dest.store(idx, src.load[width=32](idx))
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server