Tape Machine (#30)
Adds a tape machine way of executing the code. The tape machine is a series of FunctionCall objects, which can either be called one by one, or be used to generate expressions to make up a function. Reviewed-on: Rubydragon/MetagraphOptimization.jl#30 Co-authored-by: Anton Reinhard <anton.reinhard@proton.me> Co-committed-by: Anton Reinhard <anton.reinhard@proton.me>
This commit is contained in:
@ -1,3 +1,18 @@
|
||||
"""
|
||||
noop()
|
||||
|
||||
Function with no arguments, returns nothing, does nothing. Useful for noop [`FunctionCall`](@ref)s.
|
||||
"""
|
||||
@inline noop() = nothing
|
||||
|
||||
"""
|
||||
unpack_identity(x::SVector)
|
||||
|
||||
Function taking an `SVector`, returning it unpacked.
|
||||
"""
|
||||
@inline unpack_identity(x::SVector{1, <:Any}) = x[1]
|
||||
@inline unpack_identity(x) = x
|
||||
|
||||
"""
|
||||
bytes_to_human_readable(bytes)
|
||||
|
||||
@ -104,6 +119,10 @@ function unroll_symbol_vector(vec::Vector)
|
||||
return result
|
||||
end
|
||||
|
||||
function unroll_symbol_vector(vec::SVector)
|
||||
return unroll_symbol_vector(Vector(vec))
|
||||
end
|
||||
|
||||
|
||||
|
||||
####################
|
||||
|
Reference in New Issue
Block a user