coder.GpuCodeConfig
Configuration parameters for CUDA code generation from MATLAB code
Description
coder.GpuCodeConfig objects specify the code configuration parameters
for generating NVIDIA®
CUDA® code from MATLAB® code. Use the properties of the coder.GpuCodeConfig
object to customize CUDA features, such as kernel launch parameters, NVIDIA code libraries, and CUDA compute capability.
Creation
To create a coder.GpuCodeConfig object, first create one of these
code configuration objects by using the coder.gpuConfig function:
The GpuConfig property of the configuration object
contains a coder.GpuCodeConfig object.
Properties
Examples
Limitations
On Windows® platforms, the generated makefiles for standalone targets, such as dynamic libraries, static libraries, and executables, do not set the
/MTor/MDcompiler flags. These flags direct the Visual Studio® compiler to use the multithread library. By default, Visual Studio uses the/MTflag during compilation. To pass other compiler-specific flags, use theCompilerFlagsproperty. For example, to specify the/MDflag for a configuration objectcfg, enter this code :cfg.GpuConfig.CompilerFlags = "-Xcompiler /MD";The
nvcccompiler supports a limited set of file suffixes. For example, if object file contains version numbers, compilation may fail. In such cases, create symbolic links or specify"-Xlinker"in theCompilerFlagsproperty.
Alternative Functionality
App
You can use the GPU Coder app to configure the code generator and generate CUDA code. For more information, see Generate Code by Using the GPU Coder App.