Add hipDNN to your project#
2026-03-31
2 min read time
This topic demonstrates how to include hipDNN in a CMake project on a system with ROCm installed.
Prerequisites#
ROCm and hipDNN must be installed along with the dependencies. See hipDNN installation.
Steps#
Add
hipdnn_frontendin yourCMakeLists.txtfile:project(my_app LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) find_package(hipdnn_frontend CONFIG REQUIRED) add_executable(my_app main.cpp) target_link_libraries(my_app PRIVATE hipdnn_frontend)
find_package(hipdnn_frontend)transitively brings inhipdnn_backend,hipdnn_data_sdk, andhip, so only onefind_packagecall is needed. HIP runtime APIs (hipMalloc,hipFree, etc.) are available through the transitivehip::hostlink dependency.If CMake can’t find the packages, set
CMAKE_PREFIX_PATHto the ROCm install location. hipDNN CMake files are installed to<ROCM Install Path>/lib/cmakeby default, which CMake might already be searching automatically depending on your system configuration. For example:-DCMAKE_PREFIX_PATH=/opt/rocm/lib/cmake.
Include the frontend header to access the hipDNN graph API:
#include <hipdnn_frontend.hpp>
Next steps#
See Samples for complete working examples of building and executing operation graphs.