3-5. Run (gpu-run)

By setting set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) in the root CMakeLists.txt, all compiled executable files will be organized within the bin subdirectory of your build directory.

There are two ways to execute a compiled binary according to your code.

1. Codes including GPU codes.

  • Includeing cuda runtime APIs.

    • e.g., cuda_runtime_api.h ...

  • Including HEaaN device APIs.

    • e.g., functions in the device/device.hpp, device/CudaTools.hpp

In this case, you must use built-in CLI named gpu-run.

cd bin
gpu-run my_program

2. Codes without GPU codes.

  • Pure CPU code only (standard C++ programs)

Code that runs only on the CPU can be executed directly using the standard Linux/Unix execution method, without needing the gpu-run command.

cd bin
./my_program

Last updated

Was this helpful?