# Is there a way to run code from @code\_native

**URL:** <https://discourse.julialang.org/t/is-there-a-way-to-run-code-from-code-native/96644>\
**Category:** General Usage\
**Created:** [March 27, 2023, 1:55am UTC](https://discourse.julialang.org/t/is-there-a-way-to-run-code-from-code-native/96644 "2023-03-27T01:55:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zentrik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zentrik/32/35409_2.png) [@Zentrik](https://discourse.julialang.org/u/Zentrik)\
**Post date:** [March 27, 2023, 1:55am UTC](https://discourse.julialang.org/t/is-there-a-way-to-run-code-from-code-native/96644/1 "2023-03-27T01:55:48Z")

</div>

I want to `@code_native` a function, make some edits to the assembly and then run it.

For example a function I want to edit is

```julia
using SIMD

f(x, y) = any(x > y)

x = Vec{8, Float32}(1)
y = Vec{8, Float32}(0)

```

I would like some way to copy `@code_native debuginfo=:none f(x, y)` and then run it.

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [March 27, 2023, 2:47am UTC](https://discourse.julialang.org/t/is-there-a-way-to-run-code-from-code-native/96644/2 "2023-03-27T02:47:41Z")

</div>

You can `llvmcall` and use assembly, but you’d need to edit it.  
Alternatively, if it’s big enough that those modifications are unwieldy, you could compile into a shared library with gcc and `ccall` it.

Here is an example: [VectorizationBase.jl/intrin\_funcs.jl at 2842337a85aefc5e3352e1b6272589f4e53c58ee · JuliaSIMD/VectorizationBase.jl · GitHub](https://github.com/JuliaSIMD/VectorizationBase.jl/blob/2842337a85aefc5e3352e1b6272589f4e53c58ee/src/llvm_intrin/intrin_funcs.jl#L934)  
See here for more details: [LLVM Language Reference Manual — LLVM 17.0.0git documentation](https://llvm.org/docs/LangRef.html#inline-assembler-expressions)
