主要内容

coder.gpuEnvConfig

创建包含传递参数的配置对象Coder.CheckGPuInstall.用于执行GPU代码生成环境检查

描述

Thecoder.gpuEnvConfigobject contains the configuration parameters thatCoder.CheckGPuInstall.uses to verify the GPU code generation environment.

Creation

描述

gpuEnvObj = coder.gpuEnvConfigcreates agpuenvconfig主机开发计算机的配置对象。

example

gpuenvobj = coder.gpuenvconfig(HW)creates agpuenvconfig指定的硬件类型的配置对象hwhwcan take the value of'主持人','jetson', or'drive'。Jetson和Drive类型要求MATLAB®编码器™Support Package for NVIDIA®Jetson®和nvidia drive™平台。

Properties

expand all

This field is a read-only property set at the time of creating agpuenvconfig配置对象。这个领域可以取得价值'主持人','jetson', or'drive'。Jetson和Drive类型要求MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE®平台

例子:gpuEnvObj.Hardware

选中要在检查环境时必须使用的GPU设备ID。默认,GpuIdis set to 0.

例子:gpuenvobj.gpuid = 1;

When this field is set to true, basic GPU code generation check is performed. The generated code is not executed.

例子:gpuenvobj.basiccodegen = true;

When this field is set to true, basic GPU code generation and execution checks are performed on the selected GPU device.

例子:gpuenvobj.basiccodeexec = true;

When this field is set to true, deep learning GPU code generation check is performed for the library target indicated by theDeepLibTargetproperty. The generated code is not executed.

例子:gpuenvobj.deepcodegen = true;

当此字段设置为TRUE时,对由此指示的库目标执行深度学习GPU代码生成和执行检查DeepLibTargetproperty on the selected GPU device.

例子:gpuenvobj.deepcodeexec = true;

This field indicates the library target for which deep learning code generation and execution checks are performed.

例子:gpuenvobj.deeplibtarget =.'cudnn';

This field checks if the compute capability of the selected GPU device meets the minimum compute capability required for the selected TensorRT data precision.

例子:gpuEnvObj.DataType = 'fp32';

当此字段设置为true时,将在当前工作文件夹中生成结果的HTML报告。必须将启用当前的工作文件夹。

例子:gpuEnvObj.GenReport = true;

当此字段设置为true时,抑制了在命令行上打印的输出。

例子:gpuenvobj.quiet = true;

检查主机上正确配置的NVTX库安装。此库用于分析。

例子:gpuenvobj.profiming = true;

This field contains the path to the CUDA®libraries on the host. The default value is based on the currentnvcc在Linux操作系统上找到的位置和Windows操作系统中的“CUDA_PATH”环境变量。您还可以修改此值以选择不同的位置。

例子:gpuEnvObj.CudaPath = '/usr/local/cuda';

此字段包含主机上的CUDNN库的路径。默认值基于“NVIDIA_CUDNN”环境变量,如果设置为基础。您还可以修改此值以选择不同的位置。

例子:gpuEnvObj.CudnnPath = '/usr/local/cuda/cudnn';

This field contains the path to the TensorRT libraries on the host. The default value is based on the "NVIDIA_TENSORRT" environment variable if set. You can also modify this value to select a different location.

例子:gpuenvobj.tensorrtpath ='/ usr / local / cuda / tensorr';

此字段包含主机上NVTX库的路径。默认值基于Windows操作系统上的“NVToolSext_Path”环境变量,如果设置为基础。在Linux上,它是从“LD_Library_Path”获得的。您还可以修改此值以选择不同的位置。

例子:gpuenvobj.nvtxpath ='/ usr / local / cuda /';

This field accepts a "jetson" or a "drive" hardware object. This field needs (for jetson/drive) to be set before running environment checks on the board.

例子:gpuEnvObj.Hardware = jetsonHwObj;

Specify the time in seconds that the software waits before validating the execution tests on the target.

例子:gpuEnvObj.ExecTimeout = 25;

例子

全部收缩

此示例显示了如何验证您的开发计算机是否具有GPU代码生成所需的所有工具和配置。

Create acoder.gpuEnvConfig你可以传递给的对象Coder.CheckGPuInstall.function.

In the MATLAB Command Window, enter:

gpuenvobj = coder.gpuenvconfig;gpuenvobj.basiccodegen = 1;gpuenvobj.basiccodeexec = 1;gpuenvobj.deeplibtarget =.'tensorrt';gpuenvobj.deepcodeexec = 1;gpuenvobj.deepcodegen = 1;结果= Coder.CheckGPuInstall(GPUENVOBJ)

The output shown here is representative. Your results might differ.

兼容GPU:通过CUDA环境:通过运行时间:通过袖口:通过CUSOLVER:通过CUBLAS:通过了CUDNN环境:通过了Tensorrt环境:通过基本代码:通过基本代码(Tensorrt)代码生成:通过深度学习(Tensorrt)代码执行:传递结果=带有字段的结构:GPU:1 CUDA:1 CUDNN:1 TensorRT:1 BasicCodegen:1 BasicCodeExec:1 DeepCodeGEN:1 DENDCODEEXEC:1剖面:0
Introduced in R2019a