Rate This Document
Findability
Accuracy
Completeness
Readability

Using KUPL APIs for Parallel Computing Acceleration

KUPL provides three modules for external optimization: multi-core parallelism, data management, and matrix programming.

  • The multi-core parallelism module offers a suite of KUPL APIs—including egroup, multi-threading, computational graph, and multi-queue multi-stream programming—designed to accelerate multi-threaded parallel computing.
  • The data management module provides KUPL APIs (e.g. memory management and shared memory communication) to accelerate data copy or communication.
  • The matrix programming module provides KUPL APIs (e.g. tensor definition and tensor computation) to accelerate matrix multiplication.

For details about how to enable the preceding KUPL modules for optimization, see the KUPL sample code repository.

The repository provides a set of sample code for using KUPL optimization features and the optimal implementation code for specific scenarios, helping you to quickly enable KUPL features.

The KUPL sample code root directory is organized into four top-level folders: multi-core parallelism, data management, matrix programming, and KUPL test cases. Each folder contains subdirectories dedicated to the key features of its respective module. Within these feature-specific directories, you will find the source code, Makefile, and a README file. The following describes how to run the sample.

  1. Install HPCKit by following the instructions in the Kunpeng HPCKit 26.1.RC1 Installation Guide.
  2. Execute source setvars.sh to load the KUPL dynamic link library (BiSheng version) and other required environment variables.
  3. Git clone the KUPL sample code repository to the local server.

    git clone https://gitee.com/openeuler/kupl-sample.git

  4. Compile and run the KUPL sample code repository in either of the following ways:
    • Perform full compilation and installation in one-click mode.
      1. Execute sh build.sh in the root directory of KUPL-sample to generate executable binaries of all features in their respective directories.
      2. Navigate to a specific feature directory by running a command such as cd mt/graph/ in the root directory.
      3. Run make run to execute the generated binaries and obtain the execution result.
    • Perform compilation and installation as required.
      1. Navigate to a specific feature directory by running a command such as cd mt/graph/ in the root directory.
      2. Run make to compile and generate the binary of a feature.
      3. Run make run to execute the generated binary and obtain the execution result.