Spaces:
Running
Running
Download python_embed/Lib/site-packages/llvmlite/binding/context.py from Aluode/PerceptionLabPortable: direct link, hf CLI and curl.
- Browser
- Download file 706 Bytes
-
https://huggingface.co/spaces/Aluode/PerceptionLabPortable/resolve/main/python_embed/Lib/site-packages/llvmlite/binding/context.py
- Command line
-
hf download hf://spaces/Aluode/PerceptionLabPortable/python_embed/Lib/site-packages/llvmlite/binding/context.py
-
curl -L -o context.py https://huggingface.co/spaces/Aluode/PerceptionLabPortable/resolve/main/python_embed/Lib/site-packages/llvmlite/binding/context.py
706 Bytes
| from llvmlite.binding import ffi | |
| def create_context(): | |
| return ContextRef( | |
| ffi.lib.LLVMPY_ContextCreate()) | |
| def get_global_context(): | |
| return GlobalContextRef( | |
| ffi.lib.LLVMPY_GetGlobalContext()) | |
| class ContextRef(ffi.ObjectRef): | |
| def __init__(self, context_ptr): | |
| super(ContextRef, self).__init__(context_ptr) | |
| def _dispose(self): | |
| ffi.lib.LLVMPY_ContextDispose(self) | |
| class GlobalContextRef(ContextRef): | |
| def _dispose(self): | |
| pass | |
| ffi.lib.LLVMPY_GetGlobalContext.restype = ffi.LLVMContextRef | |
| ffi.lib.LLVMPY_ContextCreate.restype = ffi.LLVMContextRef | |
| ffi.lib.LLVMPY_ContextDispose.argtypes = [ffi.LLVMContextRef] | |