Skip to content

Commit

Permalink
Update samples (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
AryanSalmanpour authored Jan 13, 2025
1 parent cc601e5 commit 86d24a8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion samples/jpegDecode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,18 @@ list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH})

find_package(HIP QUIET)
find_package(rocJPEG QUIET)
find_package(rocprofiler-register QUIET)

if(HIP_FOUND AND ROCJPEG_FOUND)
if(HIP_FOUND AND ROCJPEG_FOUND AND rocprofiler-register_FOUND)
# HIP
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::host)
# rocJPEG
include_directories (${ROCJPEG_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${ROCJPEG_LIBRARY})
# std filesystem
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} stdc++fs)
# rocprofiler-register
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} rocprofiler-register::rocprofiler-register)

list(APPEND SOURCES ${PROJECT_SOURCE_DIR} jpegdecode.cpp)
add_executable(${PROJECT_NAME} ${SOURCES})
Expand All @@ -68,4 +71,7 @@ else()
if (NOT ROCJPEG_FOUND)
message(FATAL_ERROR "-- ERROR!: rocJPEG Not Found! - please install rocJPEG!")
endif()
if (NOT rocprofiler-register_FOUND)
message(FATAL_ERROR "-- ERROR!: rocprofiler-register Not Found! - please install rocprofiler-register!")
endif()
endif()
8 changes: 7 additions & 1 deletion samples/jpegDecodeBatched/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,18 @@ list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH})

find_package(HIP QUIET)
find_package(rocJPEG QUIET)
find_package(rocprofiler-register QUIET)

if(HIP_FOUND AND ROCJPEG_FOUND)
if(HIP_FOUND AND ROCJPEG_FOUND AND rocprofiler-register_FOUND)
# HIP
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::host)
# rocJPEG
include_directories (${ROCJPEG_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${ROCJPEG_LIBRARY})
# std filesystem
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} stdc++fs)
# rocprofiler-register
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} rocprofiler-register::rocprofiler-register)

list(APPEND SOURCES ${PROJECT_SOURCE_DIR} jpegdecodebatched.cpp)
add_executable(${PROJECT_NAME} ${SOURCES})
Expand All @@ -68,4 +71,7 @@ else()
if (NOT ROCJPEG_FOUND)
message(FATAL_ERROR "-- ERROR!: rocJPEG Not Found! - please install rocJPEG!")
endif()
if (NOT rocprofiler-register_FOUND)
message(FATAL_ERROR "-- ERROR!: rocprofiler-register Not Found! - please install rocprofiler-register!")
endif()
endif()
8 changes: 7 additions & 1 deletion samples/jpegDecodePerf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,21 @@ list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH})

find_package(HIP QUIET)
find_package(rocJPEG QUIET)
find_package(rocprofiler-register QUIET)

# threads
find_package(Threads REQUIRED)

if(HIP_FOUND AND ROCJPEG_FOUND AND Threads_FOUND)
if(HIP_FOUND AND ROCJPEG_FOUND AND Threads_FOUND AND rocprofiler-register_FOUND)
# HIP
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::host)
#threads
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} Threads::Threads)
# std filesystem
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} stdc++fs)
# rocprofiler-register
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} rocprofiler-register::rocprofiler-register)

# rocJPEG
include_directories (${ROCJPEG_INCLUDE_DIR})
Expand All @@ -77,4 +80,7 @@ else()
if (NOT Threads_FOUND)
message(FATAL_ERROR "-- ERROR!: Threads Not Found! - please insatll Threads!")
endif()
if (NOT rocprofiler-register_FOUND)
message(FATAL_ERROR "-- ERROR!: rocprofiler-register Not Found! - please install rocprofiler-register!")
endif()
endif()

0 comments on commit 86d24a8

Please sign in to comment.