Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how

Legacy Documentation

Mathematica 8 (2010)

This is documentation for Mathematica 8, which was
based on an earlier version of Wolfram Language.
View current documentation (Version 14.3)

CompilationTarget

CompilationTarget
is an option for Compile that specifies the target runtime for the compiled function.
  • The following settings can be used:
"WVM" the Wolfram Virtual Machine
"C" C code
  • creates code for the traditional Mathematica virtual machine.
  • creates C code, which is compiled to an external machine code library and linked back into Mathematica.
  • External files created when a target is specified are deleted either after use or when Mathematica exits.
  • A suitable external C compiler is required to target C code. If one is not found, Mathematica will use the .
  • When either or targets are specified, the following additional settings can be used:
RuntimeAttributes -> Listable compile a function with Listable attribute
Parallelization -> True try using multiple threads if possible
(3)
You can target C code generation from Compile :
This runs the compilation using C code:
C code generation runs faster:
The default operation using the WVM runs more slowly:
You can combine parallel operations with C code generation to get even faster operation:
You can target C code generation from Compile :
Out[1]=
This runs the compilation using C code:
Out[2]=
C code generation runs faster:
Out[1]=
The default operation using the WVM runs more slowly:
Out[2]=
You can combine parallel operations with C code generation to get even faster operation:
Out[1]=
(1)
A real-time plotting of the Mandelbrot set, the computation using a CompilationTarget of C and parallelism is fast enough to update the image in real time.
First, the compiled function to compute values:
Now, a plot viewer to display the result and handle the interactions:
Now you can invoke the functions. Note that this is an image to interact with the picture you need to evaluate the commands:
New in 8


ja zh

AltStyle によって変換されたページ (->オリジナル) /