配置参数CUDA代码生成的MATLAB代码通过使用GPU编码器
的编码器。GpuCodeConfig
或coder.gpuConfig
对象包含的配置参数codegen
用于生成CUDA®MEX,一个静态库,一个动态链接库,或一个带有GPU Coder™的可执行程序。将对象传递给codegen
函数的配置
选择。
cfg = coder.gpuConfig (
为指定的构建类型创建代码生成配置对象,该对象可以是CUDA MEX、静态库、动态链接库或可执行程序。如果嵌入式编码器®产品被安装,它创建一个build_type
)编码器。EmbeddedCodeConfig
对象,用于静态库、动态库或可执行构建类型。
cfg = coder.gpuConfig (
创建代码生成配置对象以生成CUDAbuild_type
“是”,假)“自由”
,“dll”
,或exe”
即使安装了Embedded Coder产品,也会输出。
cfg = coder.gpuConfig (
创建一个build_type
“是”,真的)编码器。EmbeddedCodeConfig
配置对象,即使未安装Embedded Coder产品。但是,使用编码器。EmbeddedCodeConfig
对象需要Embedded Coder许可证。
GPU编码器总是设置PassStructByReference
财产的编码器。CodeConfig
和编码器。EmbeddedCodeConfig
代码配置对象为true。
GPU编码器总是设置EnableSignedLeftShifts
和EnableSignedRightShifts
财产的编码器。EmbeddedCodeConfig
代码配置对象为true。
对于独立的目标,如静态库、动态链接库或Windows中的可执行程序®环境中,生成的makefile不设置每公吨
或/ MD
编译器标志。这些标志指示Visual Studio编译器使用多线程库。默认情况下,Visual Studio使用每公吨
在编译过程中。要传递其他编译器特定的标志,请使用CompilerFlags
选择。例如,
cfg.GpuConfig.CompilerFlags =“-Xcompiler / MD”;
的学校网站
编译器对输入文件后缀有限制。例如,如果目标文件包含版本号,编译可能会失败。在这种情况下,创建符号链接或传递“-Xlinker”
到CompilerFlags
.
codegen
|coder.gpu.kernel
|gpucoder.stencilKernel
|gpucoder.matrixMatrixKernel
|coder.gpu.constantMemory
|gpucoder.reduce
|gpucoder.sort
|coder.gpu.nokernel