CompiledComponentRawInterface[comp]
represents the raw interface of a compiled component.
CompiledComponentRawInterface
CompiledComponentRawInterface[comp]
represents the raw interface of a compiled component.
Details
- CompiledComponentRawInterface[comp] can be used to add raw library function declarations to a compilation command such as FunctionCompile.
- CompiledComponentRawInterface[comp] can be used to add raw library function declarations to a compiler environment with CreateCompilerEnvironment and with CompilerEnvironmentAppendTo.
- The raw library function declarations provided by CompiledComponentRawInterface are given by "RawLibraryFunctions" entries in DeclareCompiledComponent. These are given as a rule "name"Typed[funcName,ty]. This specifies that a compiled version of funcName with type ty will be exported by the library built for the component.
- Compilations that use declarations provided by CompiledComponentRawInterface refer directly to funcName in the "RawLibraryFunctions" setting.
Examples
Basic Examples (1)
CompiledComponentRawInterface is useful because it allows declarations from a compiled component to be used from a library without having to compile them.
DeclareCompiledComponent can create a raw library function to be used by other compiled code:
DeclareCompiledComponent["demoLibrary", {
FunctionDeclaration[square, Typed[{"Real64"} -> "Real64"]@Function[arg, arg ^ 2]]
}
];
DeclareCompiledComponent["demoLibrary", "RawLibraryFunctions" -> <|
"square" -> Typed[square, {"Real64"} -> "Real64"]
|>];BuildCompiledComponent["demoLibrary"]Load and initialize the component library:
LoadCompiledComponent["demoLibrary"]A declaration of the function in the library:
libDecl = LibraryFunctionDeclaration[square -> "square", "demoLibrary", {"Real64"} -> "Real64"];Compile a function that uses the library:
cf = FunctionCompile[{libDecl}, Function[{Typed[arg, "Real64"]}, square[arg]]]Run the computation that calls the library:
cf[5.6]Instead of using the LibraryFunctionDeclaration, the component library interface can be used directly:
cf = FunctionCompile[CompiledComponentRawInterface["demoLibrary"], Function[{Typed[arg, "Real64"]}, square[arg]]]cf[5.6]Related Guides
Related Links
History
Text
Wolfram Research (2024), CompiledComponentRawInterface, Wolfram Language function, https://reference.wolfram.com/language/ref/CompiledComponentRawInterface.html.
CMS
Wolfram Language. 2024. "CompiledComponentRawInterface." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CompiledComponentRawInterface.html.
APA
Wolfram Language. (2024). CompiledComponentRawInterface. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CompiledComponentRawInterface.html
BibTeX
@misc{reference.wolfram_2026_compiledcomponentrawinterface, author="Wolfram Research", title="{CompiledComponentRawInterface}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/CompiledComponentRawInterface.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_compiledcomponentrawinterface, organization={Wolfram Research}, title={CompiledComponentRawInterface}, year={2024}, url={https://reference.wolfram.com/language/ref/CompiledComponentRawInterface.html}, note=[Accessed: 12-June-2026]}