You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> using GPUCompiler
julia> @generatedfunctiontrywarn()
return :(GPUCompiler.@safe_warn "watch out!")
end
trywarn (generic function with 1 method)
julia> trywarn()
ERROR: The function body AST defined by this @generated function is not pure. This likely means it contains a closure, a comprehension or a generator.
Stacktrace:
[1] top-level scope
@ REPL[5]:1
The problem is there's no public closure-free API to change the current logger. The non-public way is to reassign current_task().logstate, which is what with_logger does under the hood.
So I guess the choices are
Copy the internals of with_logger, i.e., reassign the non-public current_task().logstate
Revert to mutating the global logger and hope that @safe_* is never used in a task that's attached to a non-global logger
The text was updated successfully, but these errors were encountered:
This is my fault, ref #622
MWE:
The problem is there's no public closure-free API to change the current logger. The non-public way is to reassign
current_task().logstate
, which is whatwith_logger
does under the hood.So I guess the choices are
with_logger
, i.e., reassign the non-publiccurrent_task().logstate
@safe_*
is never used in a task that's attached to a non-global loggerThe text was updated successfully, but these errors were encountered: