@@ -181,19 +181,19 @@ function body_runtime_newstruct_augfwd(N, Width, primtypes, active_refs, primarg
181181end
182182
183183function func_runtime_newstruct_augfwd (N, Width)
184- primargs, _, primtypes, allargs, typeargs, wrapped, batchshadowargs, _, active_refs = setup_macro_wraps (false , N, Width)
184+ primargs, _, primtypes, allargs, typeargs, wrapped, batchshadowargs, _, active_refs = setup_macro_wraps (false , N, Width; mixed_or_active = true )
185185 body = body_runtime_newstruct_augfwd (N, Width, primtypes, active_refs, primargs, batchshadowargs)
186186
187187 quote
188- function runtime_newstruct_augfwd (activity:: Type{Val{ActivityTup}} , width:: Val{$Width} , ModifiedBetween:: Val{MB} , RT :: Val{ReturnType } , :: Type{NewType } , $ (allargs... )):: ReturnType where {ActivityTup, MB, ReturnType, NewType, $ (typeargs... )}
188+ function runtime_newstruct_augfwd (activity:: Type{Val{ActivityTup}} , width:: Val{$Width} , ModifiedBetween:: Val{MB} , :: Type{NewType } , RT :: Val{ReturnType } , $ (allargs... )):: ReturnType where {ActivityTup, MB, ReturnType, NewType, $ (typeargs... )}
189189 $ body
190190 end
191191 end
192192end
193193
194- @generated function runtime_newstruct_augfwd (activity:: Type{Val{ActivityTup}} , width:: Val{Width} , ModifiedBetween:: Val{MB} , RT :: Val{ReturnType } , :: Type{NewType } , allargs... ):: ReturnType where {ActivityTup, MB, Width, ReturnType, NewType}
194+ @generated function runtime_newstruct_augfwd (activity:: Type{Val{ActivityTup}} , width:: Val{Width} , ModifiedBetween:: Val{MB} , :: Type{NewType } , RT :: Val{ReturnType } , allargs... ):: ReturnType where {ActivityTup, MB, Width, ReturnType, NewType}
195195 N = div (length (allargs)+ 2 , Width+ 1 )- 1
196- primargs, _, primtypes, _, _, wrapped, batchshadowargs, _, active_refs = setup_macro_wraps (false , N, Width, :allargs )
196+ primargs, _, primtypes, _, _, wrapped, batchshadowargs, _, active_refs = setup_macro_wraps (false , N, Width, :allargs ; mixed_or_active = true )
197197 return body_runtime_newstruct_augfwd (N, Width, primtypes, active_refs, primargs, batchshadowargs)
198198end
199199
@@ -325,7 +325,7 @@ function common_newstructv_augfwd(offset, B, orig, gutils, normalR, shadowR, tap
325325
326326 width = get_width (gutils)
327327
328- sret = generic_setup (orig, runtime_newstruct_augfwd, width == 1 ? Any : AnyArray (Int (width)), gutils, #= start=# offset, B, false ; firstconst= true , endcast = false )
328+ sret = generic_setup (orig, runtime_newstruct_augfwd, width == 1 ? Any : AnyArray (Int (width)), gutils, #= start=# offset, B, false ; firstconst= true , endcast = false , firstconst_after_tape = true )
329329
330330 if width == 1
331331 shadow = sret
@@ -369,7 +369,7 @@ function common_newstructv_rev(offset, B, orig, gutils, tape)
369369 if ! newstruct_common (#= fwd=# false , #= run=# false , offset, B, orig, gutils, #= normalR=# nothing , #= shadowR=# nothing )
370370 @assert tape != = C_NULL
371371 width = get_width (gutils)
372- generic_setup (orig, runtime_newstruct_rev, Nothing, gutils, #= start=# offset, B, true ; firstconst= true , tape)
372+ generic_setup (orig, runtime_newstruct_rev, Nothing, gutils, #= start=# offset, B, true ; firstconst= true , tape, firstconst_after_tape = true )
373373 end
374374
375375 return nothing
0 commit comments