[SWDEV-431345][SWDEV-432633] toplevel cmake for hip samples
Change-Id: If22e7e96604f184458cc6ab6bb9945152f9359e0
このコミットが含まれているのは:
@@ -39,9 +39,18 @@ set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(MatrixTranspose MatrixTranspose.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(MatrixTranspose ${EXCLUDE_OPTION} MatrixTranspose.cpp)
|
||||
|
||||
target_include_directories(MatrixTranspose PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(MatrixTranspose hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook MatrixTranspose)
|
||||
endif()
|
||||
|
||||
@@ -39,9 +39,18 @@ set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(inline_asm inline_asm.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(inline_asm ${EXCLUDE_OPTION} inline_asm.cpp)
|
||||
|
||||
target_include_directories(inline_asm PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(inline_asm hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook inline_asm)
|
||||
endif()
|
||||
|
||||
@@ -39,19 +39,27 @@ set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(texture2dDrv texture2dDrv.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(texture2dDrv ${EXCLUDE_OPTION} texture2dDrv.cpp)
|
||||
|
||||
# Generate code object
|
||||
add_custom_target(
|
||||
codeobj
|
||||
ALL
|
||||
COMMAND ${HIP_HIPCC_EXECUTABLE} --genco ../tex2dKernel.cpp -o tex2dKernel.code
|
||||
COMMENT "codeobj generated"
|
||||
codeobj3
|
||||
COMMAND ${HIP_HIPCC_EXECUTABLE} --genco ${CMAKE_CURRENT_SOURCE_DIR}/tex2dKernel.cpp -o tex2dKernel.code
|
||||
COMMENT "codeobj3 generated"
|
||||
)
|
||||
|
||||
add_dependencies(texture2dDrv codeobj)
|
||||
add_dependencies(texture2dDrv codeobj3)
|
||||
|
||||
target_include_directories(texture2dDrv PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(texture2dDrv hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook texture2dDrv)
|
||||
endif()
|
||||
|
||||
@@ -48,13 +48,18 @@ else()
|
||||
endif()
|
||||
|
||||
set(MY_SOURCE_FILES MatrixTranspose.cpp)
|
||||
set(MY_TARGET_NAME MatrixTranspose)
|
||||
set(MY_TARGET_NAME MatrixTranspose1)
|
||||
set(MY_HIPCC_OPTIONS)
|
||||
set(MY_CLANG_OPTIONS)
|
||||
set(MY_NVCC_OPTIONS)
|
||||
|
||||
set_source_files_properties(${MY_SOURCE_FILES} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
|
||||
hip_add_executable(${MY_TARGET_NAME} ${MY_SOURCE_FILES} HIPCC_OPTIONS ${MY_HIPCC_OPTIONS} CLANG_OPTIONS ${MY_CLANG_OPTIONS} NVCC_OPTIONS ${MY_NVCC_OPTIONS})
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
hip_add_executable(${MY_TARGET_NAME} ${EXCLUDE_OPTION} ${MY_SOURCE_FILES} HIPCC_OPTIONS ${MY_HIPCC_OPTIONS} CLANG_OPTIONS ${MY_CLANG_OPTIONS} NVCC_OPTIONS ${MY_NVCC_OPTIONS})
|
||||
|
||||
target_include_directories(${MY_TARGET_NAME} PRIVATE ../../common)
|
||||
|
||||
@@ -65,3 +70,7 @@ if(TARGET hip::host)
|
||||
message(STATUS "Found hip::host at ${hip_DIR}")
|
||||
target_link_libraries(${MY_TARGET_NAME} hip::host)
|
||||
endif()
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook ${MY_TARGET_NAME})
|
||||
endif()
|
||||
|
||||
@@ -39,9 +39,18 @@ set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(occupancy occupancy.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(occupancy ${EXCLUDE_OPTION} occupancy.cpp)
|
||||
|
||||
target_include_directories(occupancy PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(occupancy hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook occupancy)
|
||||
endif()
|
||||
|
||||
@@ -39,9 +39,18 @@ set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(gpuarch gpuarch.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(gpuarch ${EXCLUDE_OPTION} gpuarch.cpp)
|
||||
|
||||
target_include_directories(gpuarch PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(gpuarch hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook gpuarch)
|
||||
endif()
|
||||
@@ -27,33 +27,42 @@ set(CMAKE_BUILD_TYPE Release)
|
||||
# Turn static library generation ON
|
||||
option(BUILD_SHARED_LIBS "Build as a shared library" OFF)
|
||||
|
||||
set(CPP_SOURCES hipDevice.cpp)
|
||||
set(CPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hipDevice.cpp)
|
||||
|
||||
# For windows, We need to tell cmake how to create static library.
|
||||
if (WIN32)
|
||||
set (CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> /out:<TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
|
||||
# Generate static lib libHipDevice.a
|
||||
add_library(HipDevice STATIC ${CPP_SOURCES})
|
||||
add_library(HipDevice ${EXCLUDE_OPTION} STATIC ${CPP_SOURCES})
|
||||
|
||||
target_compile_options(HipDevice PRIVATE -fgpu-rdc)
|
||||
target_link_libraries(HipDevice PRIVATE -fgpu-rdc)
|
||||
target_include_directories(HipDevice PRIVATE ${CMAKE_PREFIX_PATH}/hsa/include)
|
||||
|
||||
# Create test executable that uses libHipDevice.a
|
||||
set(TEST_SOURCES ${CMAKE_SOURCE_DIR}/hipMain2.cpp)
|
||||
set(TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hipMain2.cpp)
|
||||
|
||||
add_executable(test_device_static ${TEST_SOURCES})
|
||||
add_executable(test_device_static ${EXCLUDE_OPTION} ${TEST_SOURCES})
|
||||
add_dependencies(test_device_static HipDevice)
|
||||
target_compile_options(test_device_static PRIVATE -fgpu-rdc)
|
||||
|
||||
# For windows, Change in a way to pass lib details
|
||||
if (WIN32)
|
||||
target_link_libraries(test_device_static PRIVATE -lHipDevice -L${CMAKE_BINARY_DIR})
|
||||
target_link_libraries(test_device_static PRIVATE -lHipDevice -L${CMAKE_CURRENT_BINARY_DIR})
|
||||
else()
|
||||
target_link_libraries(test_device_static PRIVATE HipDevice)
|
||||
endif()
|
||||
|
||||
target_link_libraries(test_device_static PRIVATE -fgpu-rdc amdhip64 amd_comgr)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook HipDevice test_device_static)
|
||||
endif()
|
||||
@@ -27,26 +27,32 @@ set(CMAKE_BUILD_TYPE Release)
|
||||
# Turn static library generation ON
|
||||
option(BUILD_SHARED_LIBS "Build as a shared library" OFF)
|
||||
|
||||
set(CPP_SOURCES hipOptLibrary.cpp)
|
||||
set(CPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hipOptLibrary.cpp)
|
||||
|
||||
# For windows, We need to tell cmake how to create static library.
|
||||
if (WIN32)
|
||||
set (CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> /out:<TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
|
||||
set(TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hipMain1.cpp)
|
||||
|
||||
# Generate static lib libHipOptLibrary.a.
|
||||
add_library(HipOptLibrary STATIC ${CPP_SOURCES})
|
||||
add_library(HipOptLibrary ${EXCLUDE_OPTION} STATIC ${CPP_SOURCES})
|
||||
|
||||
# Set-up the correct flags to generate the static library.
|
||||
target_link_options(HipOptLibrary PRIVATE --emit-static-lib)
|
||||
target_include_directories(HipOptLibrary PRIVATE /opt/rocm/hsa/include)
|
||||
|
||||
# Create test executable that uses libHipOptLibrary.a
|
||||
set(TEST_SOURCES ${CMAKE_SOURCE_DIR}/hipMain1.cpp)
|
||||
|
||||
add_executable(test_opt_static ${TEST_SOURCES})
|
||||
add_executable(test_opt_static ${EXCLUDE_OPTION} ${TEST_SOURCES})
|
||||
add_dependencies(test_opt_static HipOptLibrary)
|
||||
target_link_libraries(test_opt_static PRIVATE -lHipOptLibrary -L${CMAKE_BINARY_DIR})
|
||||
target_link_libraries(test_opt_static PRIVATE -lHipOptLibrary -L${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(test_opt_static PRIVATE amdhip64 amd_comgr)
|
||||
@@ -54,3 +60,6 @@ else()
|
||||
target_link_libraries(test_opt_static PRIVATE amdhip64 amd_comgr hsa-runtime64::hsa-runtime64)
|
||||
endif()
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook HipOptLibrary test_opt_static)
|
||||
endif()
|
||||
@@ -32,13 +32,24 @@ if(UNIX)
|
||||
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++")
|
||||
|
||||
# Find hip
|
||||
find_package(hip REQUIRED)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(test_cpp square.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(test_cpp ${EXCLUDE_OPTION} square.cpp)
|
||||
|
||||
target_include_directories(test_cpp PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(test_cpp hip::device)
|
||||
target_link_libraries(test_cpp hip::device)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook test_cpp)
|
||||
endif()
|
||||
|
||||
@@ -12,14 +12,25 @@ if(UNIX)
|
||||
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++")
|
||||
|
||||
find_package(hip REQUIRED)
|
||||
|
||||
add_executable(test_fortran TestFortran.F90)
|
||||
add_executable(test_cpp MatrixTranspose.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(test_fortran ${EXCLUDE_OPTION} TestFortran.F90)
|
||||
add_executable(test_cpp1 ${EXCLUDE_OPTION} MatrixTranspose.cpp)
|
||||
|
||||
target_link_libraries(test_cpp PUBLIC hip::device)
|
||||
target_link_libraries(test_cpp1 PUBLIC hip::device)
|
||||
|
||||
target_include_directories(test_cpp PRIVATE ../../common)
|
||||
target_include_directories(test_cpp1 PRIVATE ../../common)
|
||||
|
||||
# Assuming to build a C/C++-to-Fortran library binding.
|
||||
target_link_libraries(test_fortran PUBLIC hip::device)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook test_cpp1 test_fortran)
|
||||
endif()
|
||||
|
||||
@@ -39,9 +39,18 @@ set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(hipEvent hipEvent.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(hipEvent ${EXCLUDE_OPTION} hipEvent.cpp)
|
||||
|
||||
target_include_directories(hipEvent PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(hipEvent hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook hipEvent)
|
||||
endif()
|
||||
@@ -43,8 +43,6 @@ if (WIN32 AND HIPINFO_INTERNAL_BUILD)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --rocm-path=${CMAKE_PREFIX_PATH}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
# Find hip
|
||||
find_package(hip REQUIRED)
|
||||
if (WIN32)
|
||||
@@ -96,3 +94,6 @@ else (WIN32)
|
||||
target_link_libraries(hipVulkan hip::host vulkan glfw)
|
||||
endif (WIN32)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook hipVulkan)
|
||||
endif()
|
||||
|
||||
@@ -32,13 +32,24 @@ if(UNIX)
|
||||
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++")
|
||||
|
||||
# Find HIP
|
||||
find_package(hip REQUIRED)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(square square.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(square1 ${EXCLUDE_OPTION} square.cpp)
|
||||
|
||||
target_include_directories(square PRIVATE ../../common)
|
||||
target_include_directories(square1 PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(square hip::device)
|
||||
target_link_libraries(square1 hip::device)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook square1)
|
||||
endif()
|
||||
|
||||
@@ -20,10 +20,33 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.21.3)
|
||||
|
||||
if(UNIX)
|
||||
if(NOT DEFINED ROCM_PATH)
|
||||
set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.")
|
||||
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( NOT DEFINED CMAKE_HIP_COMPILER_ROCM)
|
||||
set(CMAKE_HIP_COMPILER_ROCM_ROOT ${ROCM_PATH})
|
||||
endif()
|
||||
|
||||
set(CMAKE_HIP_ARCHITECTURES OFF)
|
||||
|
||||
project(cmake_hip_lang_support VERSION 1.0
|
||||
DESCRIPTION "HIP Language Support with upstream CMake"
|
||||
LANGUAGES HIP)
|
||||
# Create the executable
|
||||
add_executable(square square.hip)
|
||||
|
||||
target_include_directories(square PRIVATE ../../common)
|
||||
# Create the executable
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(square2 ${EXCLUDE_OPTION} square.hip)
|
||||
|
||||
target_include_directories(square2 PRIVATE ../../common)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook square2)
|
||||
endif()
|
||||
|
||||
@@ -30,13 +30,20 @@ if(UNIX)
|
||||
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++")
|
||||
|
||||
# Find hiprtc
|
||||
find_package(hiprtc REQUIRED)
|
||||
# Find hip
|
||||
find_package(hip REQUIRED)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(test saxpy.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(test ${EXCLUDE_OPTION} saxpy.cpp)
|
||||
|
||||
# Link with HIPRTC
|
||||
target_link_libraries(test hiprtc::hiprtc)
|
||||
@@ -44,3 +51,7 @@ target_link_libraries(test hiprtc::hiprtc)
|
||||
target_link_libraries(test hip::device)
|
||||
|
||||
target_include_directories(test PRIVATE ../../common)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook test)
|
||||
endif()
|
||||
|
||||
@@ -39,9 +39,18 @@ set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(sharedMemory sharedMemory.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(sharedMemory ${EXCLUDE_OPTION} sharedMemory.cpp)
|
||||
|
||||
target_include_directories(sharedMemory PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(sharedMemory hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook sharedMemory)
|
||||
endif()
|
||||
@@ -39,9 +39,18 @@ set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# Create the excutable
|
||||
add_executable(shfl shfl.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(shfl ${EXCLUDE_OPTION} shfl.cpp)
|
||||
|
||||
target_include_directories(shfl PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(shfl hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook shfl)
|
||||
endif()
|
||||
@@ -38,9 +38,18 @@ set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
|
||||
# Create the excutable
|
||||
add_executable(2dshfl 2dshfl.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(2dshfl ${EXCLUDE_OPTION} 2dshfl.cpp)
|
||||
|
||||
target_include_directories(2dshfl PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(2dshfl hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook 2dshfl)
|
||||
endif()
|
||||
|
||||
@@ -40,9 +40,18 @@ set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
|
||||
# Create the excutable
|
||||
add_executable(dynamic_shared dynamic_shared.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(dynamic_shared ${EXCLUDE_OPTION} dynamic_shared.cpp)
|
||||
|
||||
target_include_directories(dynamic_shared PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(dynamic_shared hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook dynamic_shared)
|
||||
endif()
|
||||
|
||||
@@ -38,9 +38,18 @@ set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
|
||||
# Create the excutable
|
||||
add_executable(stream stream.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(stream ${EXCLUDE_OPTION} stream.cpp)
|
||||
|
||||
target_include_directories(stream PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(stream hip::host)
|
||||
|
||||
if(TARGET cookbook)
|
||||
add_dependencies(build_cookbook stream)
|
||||
endif()
|
||||
|
||||
@@ -37,7 +37,16 @@ set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
|
||||
# Create the excutable
|
||||
add_executable(peer2peer peer2peer.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(peer2peer ${EXCLUDE_OPTION} peer2peer.cpp)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(peer2peer hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook peer2peer)
|
||||
endif()
|
||||
|
||||
@@ -38,9 +38,18 @@ set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE})
|
||||
set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
||||
|
||||
# Create the excutable
|
||||
add_executable(unroll unroll.cpp)
|
||||
if(TARGET build_cookbook)
|
||||
set(EXCLUDE_OPTION EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
set(EXCLUDE_OPTION )
|
||||
endif()
|
||||
add_executable(unroll ${EXCLUDE_OPTION} unroll.cpp)
|
||||
|
||||
target_include_directories(unroll PRIVATE ../../common)
|
||||
|
||||
# Link with HIP
|
||||
target_link_libraries(unroll hip::host)
|
||||
|
||||
if(TARGET build_cookbook)
|
||||
add_dependencies(build_cookbook unroll)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# Copyright (c) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
add_custom_target(build_cookbook)
|
||||
add_subdirectory(0_MatrixTranspose)
|
||||
add_subdirectory(1_hipEvent)
|
||||
add_subdirectory(3_shared_memory)
|
||||
add_subdirectory(4_shfl)
|
||||
add_subdirectory(5_2dshfl)
|
||||
add_subdirectory(6_dynamic_shared)
|
||||
add_subdirectory(7_streams)
|
||||
add_subdirectory(8_peer2peer)
|
||||
add_subdirectory(9_unroll)
|
||||
add_subdirectory(10_inline_asm)
|
||||
add_subdirectory(11_texture_driver)
|
||||
add_subdirectory(12_cmake_hip_add_executable)
|
||||
add_subdirectory(13_occupancy)
|
||||
add_subdirectory(14_gpu_arch)
|
||||
add_subdirectory(15_static_library/device_functions)
|
||||
add_subdirectory(15_static_library/host_functions)
|
||||
#add_subdirectory(16_assembly_to_executable)
|
||||
#add_subdirectory(17_llvm_ir_to_executable)
|
||||
add_subdirectory(18_cmake_hip_device)
|
||||
add_subdirectory(19_cmake_lang)
|
||||
#add_subdirectory(20_hip_vulkan)
|
||||
add_subdirectory(21_cmake_hip_cxx_clang)
|
||||
#add_subdirectory(22_cmake_hip_lang)
|
||||
add_subdirectory(23_cmake_hiprtc)
|
||||
新しいイシューから参照
ユーザーをブロックする