Developing an Application

Creating an AscendCL Project

For details about how to develop an application, see the AscendCL Application Software Development Guide (C&C++) or AscendCL Application Software Development Guide (Python).

Creating an AscendCL Samples Sample Project

  • After an application project is created, in the src directory you can find the .cpp template code of the application for system initialization, model execution, model uninstallation, resource destruction, and more. You only need to make the following modifications to sample_process.cpp based on the model file name, image name, and path (relative path only).
    • Change the image file names and paths as needed. The following uses a C++ project as an example.
      //The .. directory is relative to the directory of the executable file.
      //For example, if the executable file is stored in the out directory, .. indicates the parent directory of the out directory.
      string testFile[] = {
              "../data/dog1_1024_683.bin",
              "../data/dog2_1024_683.bin"
          };
    • Change the name of the .om model file as needed. The following uses a C/C++ project as an example.
      //The .. directory is relative to the directory of the executable file.
      //For example, if the executable file is stored in the out directory, .. indicates the parent directory of the out directory.
      const char* omModelPath = "../model/resnet50.om";

    In the template code, APIs prefixed with acl are available to users. For details about the APIs, see the AscendCL Application Software Development Guide (C&C++) or AscendCL Application Software Development Guide (Python).

  • If you do not want to use the template code, see the AscendCL Application Software Development Guide (C&C++) or AscendCL Application Software Development Guide (Python).