在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:tshort/StaticCompiler.jl开源软件地址:https://github.com/tshort/StaticCompiler.jl开源编程语言:Julia 100.0%开源软件介绍:StaticCompilerThis is an experimental package to compile Julia code to standalone libraries. A system image is not needed. Installation and Usageusing Pkg
Pkg.add("StaticCompiler") julia> using StaticCompiler
julia> fib(n) = n <= 1 ? n : fib(n - 1) + fib(n - 2)
fib (generic function with 1 method)
julia> fib_compiled, path = compile(fib, Tuple{Int}, "fib")
(f = fib(::Int64) :: Int64, path = "fib")
julia> fib_compiled(10)
55 Now we can quit this session and load a new one where julia> using StaticCompiler
julia> fib
ERROR: UndefVarError: fib not defined
julia> fib_compiled = load_function("fib")
fib(::Int64) :: Int64
julia> fib_compiled(10)
55 See the file ApproachThis package uses the GPUCompiler package to generate code. Limitations
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论