RuntimeAttributes
✖
RuntimeAttributes
Details
- RuntimeAttributes applies to the execution of the compiled function.
- A possible setting for RuntimeAttributes is Listable.
- RuntimeAttributes->Listable is effectively equivalent to the Listable attribute of the built-in function.
- If a compiled function with Listable attribute matches its argument specification, it will run in the normal way.
- If a compiled function with Listable attribute receives any arguments with higher rank than specified, the function will thread over these arguments.
Examples
Basic Examples (3)Summary of the most common use cases
This creates a compiled function that is listable:
https://wolfram.com/xid/0tqg9e1vm995jm-bid3j6
It operates on a single input in normal fashion:
https://wolfram.com/xid/0tqg9e1vm995jm-eiexky
When the arguments include a list that does not match the input specification, it threads the function over that argument:
https://wolfram.com/xid/0tqg9e1vm995jm-h7ile
This compiled function is not listable:
https://wolfram.com/xid/0tqg9e1vm995jm-lvn29x
An error results when the argument specification does not match:
https://wolfram.com/xid/0tqg9e1vm995jm-ff8si7
If there is a branch, listability needs a function to be defined, as shown below using Function:
https://wolfram.com/xid/0tqg9e1vm995jm-cz9qk
A listable compiled function does the same thing much faster:
https://wolfram.com/xid/0tqg9e1vm995jm-dttx1n
A listable compiled function can run in parallel, giving an acceleration on multicore machines:
https://wolfram.com/xid/0tqg9e1vm995jm-ihoo6s
https://wolfram.com/xid/0tqg9e1vm995jm-di8bmb
Wolfram Research (2010), RuntimeAttributes, Wolfram Language function, https://reference.wolfram.com/language/ref/RuntimeAttributes.html.
Text
Wolfram Research (2010), RuntimeAttributes, Wolfram Language function, https://reference.wolfram.com/language/ref/RuntimeAttributes.html.
Wolfram Research (2010), RuntimeAttributes, Wolfram Language function, https://reference.wolfram.com/language/ref/RuntimeAttributes.html.
CMS
Wolfram Language. 2010. "RuntimeAttributes." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RuntimeAttributes.html.
Wolfram Language. 2010. "RuntimeAttributes." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RuntimeAttributes.html.
APA
Wolfram Language. (2010). RuntimeAttributes. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RuntimeAttributes.html
Wolfram Language. (2010). RuntimeAttributes. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RuntimeAttributes.html
BibTeX
@misc{reference.wolfram_2024_runtimeattributes, author="Wolfram Research", title="{RuntimeAttributes}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/RuntimeAttributes.html}", note=[Accessed: 08-January-2025
]}
BibLaTeX
@online{reference.wolfram_2024_runtimeattributes, organization={Wolfram Research}, title={RuntimeAttributes}, year={2010}, url={https://reference.wolfram.com/language/ref/RuntimeAttributes.html}, note=[Accessed: 08-January-2025
]}