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
Copy file name to clipboardExpand all lines: README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,14 @@ Hello, world!
65
65
```
66
66
This latter approach comes with substantially more limitations, as you cannot rely on `libjulia` (see, e.g., [StaticTools.jl](https://github.com/brenhinkeller/StaticTools.jl) for some ways to work around these limitations).
67
67
68
+
### Mixtape
69
+
70
+
This feature allows one to change functionality when statically compiling. This uses code and API from [Mixtape](https://github.com/JuliaCompilerPlugins/Mixtape.jl) to transform lowered code much like [Cassette](https://github.com/JuliaLabs/Cassette.jl).
71
+
72
+
To use the Mixtape feature, define a `CompilationContext` struct and pass this to any of the compilation functions with the `mixtape` keyword. Define `transform` and `allow` functions for this `CompilationContext` to define the transformation to be done.
73
+
74
+
See [here](https://github.com/tshort/StaticCompiler.jl/blob/master/test/testintegration.jl#L329) for an example.
75
+
68
76
## Approach
69
77
70
78
This package uses the [GPUCompiler package](https://github.com/JuliaGPU/GPUCompiler.jl) to generate code.
isconcretetype(rt) ||error("`$f$types` did not infer to a concrete type. Got `$rt`")
252
264
nativetype =isprimitivetype(rt) ||isa(rt, Ptr)
253
265
nativetype ||@warn"Return type `$rt` of `$f$types` does not appear to be a native type. Consider returning only a single value of a native machine type (i.e., a single float, int/uint, bool, or pointer). \n\nIgnoring this warning may result in Undefined Behavior!"
@@ -302,7 +314,7 @@ function compile_shlib(f::Function, types=(), path::String="./", name=GPUCompile
302
314
tt = Base.to_tuple_type(types)
303
315
isconcretetype(tt) ||error("input type signature `$types` is not concrete")
isconcretetype(rt) ||error("`$f$types` did not infer to a concrete type. Got `$rt`")
307
319
nativetype =isprimitivetype(rt) ||isa(rt, Ptr)
308
320
nativetype ||@warn"Return type `$rt` of `$f$types` does not appear to be a native type. Consider returning only a single value of a native machine type (i.e., a single float, int/uint, bool, or pointer). \n\nIgnoring this warning may result in Undefined Behavior!"
0 commit comments