-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from cyndwith/main
Updates to documentation and iGPU example
- Loading branch information
Showing
13 changed files
with
1,575 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@echo off | ||
|
||
if "%RYZEN_AI_INSTALLATION_PATH%" == "" echo RYZEN_AI_INSTALLATION_PATH not set. This script requires the RYZEN_AI_INSTALLATION_PATH env var to be set to the RyzenAI 1.2 installation folder. & goto :error | ||
|
||
REM Check if the first argument is provided | ||
if "%1"=="" ( | ||
echo Usage: %0 [OpenCV_DIR] | ||
exit /b 1 | ||
) | ||
|
||
set "OpenCV_DIR=%~1" | ||
|
||
echo OpenCV_DIR is set to: %OpenCV_DIR% | ||
|
||
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CONFIGURATION_TYPES=Release -A x64 -T host=x64 -DCMAKE_INSTALL_PREFIX=. -DCMAKE_PREFIX_PATH=. -B build -S resnet50 -DOpenCV_DIR="%OpenCV_DIR%" -G "Visual Studio 17 2022" | ||
|
||
cmake --build .\build --config Release --target ALL_BUILD | ||
|
||
:error | ||
exit /b %errorlevel% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(resnet50 VERSION 1.0.0 LANGUAGES C CXX) | ||
set(CMAKE_CXX_STANDARD 17) | ||
find_package(Python 3.10 EXACT COMPONENTS Interpreter Development) | ||
|
||
set (RYZEN_AI_INSTALLATION_PATH $ENV{RYZEN_AI_INSTALLATION_PATH}) | ||
|
||
|
||
set(ONNXRUNTIME_ROOTDIR "${RYZEN_AI_INSTALLATION_PATH}/onnxruntime") | ||
|
||
include_directories("${ONNXRUNTIME_ROOTDIR}/include/onnxruntime/core/session") | ||
|
||
link_directories("${ONNXRUNTIME_ROOTDIR}/lib") | ||
|
||
link_directories("${CMAKE_INSTALL_PREFIX}/lib") | ||
|
||
|
||
|
||
find_package(OpenCV COMPONENTS core highgui imgproc REQUIRED) | ||
|
||
add_executable(resnet50 resnet50.cpp util/getopt.c) | ||
target_include_directories(resnet50 | ||
PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/util | ||
) | ||
target_link_libraries(resnet50 ${ORT_LIBRARY} ${OpenCV_LIBS} onnxruntime) | ||
install(TARGETS resnet50 RUNTIME DESTINATION bin) | ||
|
||
add_custom_command( | ||
TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy | ||
${RYZEN_AI_INSTALLATION_PATH}/onnxruntime/bin/DirectML.dll | ||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/DirectML.dll) | ||
|
||
add_custom_command( | ||
TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy | ||
${RYZEN_AI_INSTALLATION_PATH}/onnxruntime/bin/onnxruntime.dll | ||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/onnxruntime.dll) |
Oops, something went wrong.