setupCodegenContext

Select the target hardware to build code for from multiple live connection objects

Description

example

setupCodegenContext(hwObj) selects the NVIDIA®target hardware to generate code for. When there are multiple live connection objects for different targets, the code generator performs remote build on the target for which a recent live object was created. To choose a hardware board for performing remote build, use the setupCodegenContext() method of the respective live hardware object. If only one live connection object was created, it is not necessary to call this method.

Examples

collapse all

This example shows how to use the setupCodegenContext() method and select the Jetson board for code generation when the MATLAB® session has multiple live connection objects.

Create a connection, hwJetson, from the MATLAB software to NVIDIA Jetson hardware.

hwJetson = jetson
Checking for CUDA availability on the Target...
Checking for 'nvcc' in the target system path...
Checking for cuDNN library availability on the Target...
Checking for TensorRT library availability on the Target...
Checking for prerequisite libraries is complete.
Gathering hardware details...
Gathering hardware details is complete.
 Board name        : NVIDIA Jetson TX2
 CUDA Version      : 9.0
 cuDNN Version     : 7.0
 TensorRT Version  : 3.0
 Available Webcams :  
 Available GPUs    : NVIDIA Tegra X2

hwJetson = 

  jetson with properties:

      DeviceAddress: '192.168.1.15'
               Port: 22
          BoardName: 'NVIDIA Jetson TX2'
        CUDAVersion: '9.0'
       cuDNNVersion: '7.0'
    TensorRTVersion: '3.0'
            GpuInfo: [1×1 struct]
         webcamlist: []

Create a connection, hwDRIVE, from the MATLAB software to NVIDIA DRIVE hardware.

hwDRIVE = DRIVE('192.168.1.16','nvidia','nvidia');
Checking for CUDA availability on the Target...
Checking for 'nvcc' in the target system path...
Checking for cuDNN library availability on the Target...
Checking for TensorRT library availability on the Target...
Checking for prerequisite libraries is complete.
Gathering hardware details...
Gathering hardware details is complete.
 Board name        : NVIDIA Drive
 CUDA Version      : 9.0
 cuDNN Version     : 7.0
 TensorRT Version  : 3.0
 Available Webcams : Microsoft® LifeCam Cinema(TM)
 Available GPUs    : Graphics Device,NVIDIA Tegra X2

hwDRIVE = 

  drive with properties:

      DeviceAddress: '192.168.1.16'
               Port: 22
          BoardName: 'NVIDIA Drive'
        CUDAVersion: '9.0'
       cuDNNVersion: '7.0'
    TensorRTVersion: '3.0'
            GpuInfo: [1×2 struct]
         webcamlist: {'Microsoft® LifeCam Cinema(TM)'}

To choose a hardware board for performing remote build, use the setupCodegenContext() method of the respective live hardware object.

setupCodegenContext(hwJetson);

The code generator now performs code generation for the Jetson hardware target.

Input Arguments

collapse all

Connection to a specific NVIDIA hardware board, specified as a jetson or drive object.

Use the jetson or the drive function to create this connection.

Introduced in R2018b