Configuration parameters for CUDA code generation from MATLAB code by using GPU Coder
The coder.GpuCodeConfig
or
coder.gpuConfig
object contains the configuration parameters that
codegen
uses for generating CUDA® MEX, a static library, a dynamically linked library, or an executable
program with GPU Coder™. Pass the object to the codegen
function by using the
-config
option.
cfg = coder.gpuConfig(
creates a code generation configuration object for the specified build type,
which can be CUDA MEX, a static library, a dynamically linked library, or an
executable program. If the Embedded Coder® product is installed, it creates a build_type
)coder.EmbeddedCodeConfig
object for static library, dynamic
library, or executable build types.
cfg = coder.gpuConfig(
creates a code generation configuration object to generate CUDA
build_type
,'ecoder',false)'lib'
, 'dll'
, or 'exe'
output even if the Embedded Coder product is installed.
cfg = coder.gpuConfig(
creates a build_type
,'ecoder',true)coder.EmbeddedCodeConfig
configuration object even if the Embedded Coder product is not installed. However, code generation using a
coder.EmbeddedCodeConfig
object requires an Embedded Coder license.
GPU Coder always sets the PassStructByReference
property
of the coder.CodeConfig
and coder.EmbeddedCodeConfig
code
configuration object to true.
GPU Coder always sets the EnableSignedLeftShifts
and the
EnableSignedRightShifts
property of the coder.EmbeddedCodeConfig
code
configuration object to true.
For standalone targets such as static library, dynamically linked library, or
executable program in the Windows® environment, the generated makefiles does not set
/MT
or /MD
compiler flags. These flags
indicate to the Visual Studio compiler to use the multithread library. By
default, Visual Studio uses the /MT
during compilation. To
pass other compiler specific flags, use the CompilerFlags
option. For
example,
cfg.GpuConfig.CompilerFlags = '-Xcompiler /MD';
The nvcc
compiler has limitations on input file suffixes.
For example, if object file contains version numbers, compilation may fail. In
such cases create symbolic links or pass '-Xlinker'
to the
CompilerFlags
.
codegen
| coder.gpu.constantMemory
| coder.gpu.kernel
| coder.gpu.nokernel
| gpucoder.matrixMatrixKernel
| gpucoder.reduce
| gpucoder.sort
| gpucoder.stencilKernel