diff --git a/projects/hip-tests/samples/0_Intro/bit_extract/CMakeLists.txt b/projects/hip-tests/samples/0_Intro/bit_extract/CMakeLists.txt new file mode 100644 index 0000000000..c9b13be812 --- /dev/null +++ b/projects/hip-tests/samples/0_Intro/bit_extract/CMakeLists.txt @@ -0,0 +1,20 @@ +project(bit_extract) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) + +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) + +# Create the excutable +add_executable(bit_extract bit_extract.cpp) + +# Link with HIP +target_link_libraries(bit_extract hip::host) \ No newline at end of file diff --git a/projects/hip-tests/samples/0_Intro/bit_extract/Makefile b/projects/hip-tests/samples/0_Intro/bit_extract/Makefile index 4a3a0bb4fe..3427815ffc 100644 --- a/projects/hip-tests/samples/0_Intro/bit_extract/Makefile +++ b/projects/hip-tests/samples/0_Intro/bit_extract/Makefile @@ -9,19 +9,15 @@ HIPCC=$(HIP_PATH)/bin/hipcc # Show how to use PLATFORM to specify different options for each compiler: ifeq (${HIP_PLATFORM}, nvcc) - HIPCC_FLAGS = -gencode=arch=compute_20,code=sm_20 + HIPCC_FLAGS = -gencode=arch=compute_20,code=sm_20 endif EXE=bit_extract -EXE_STATIC=bit_extract_static $(EXE): bit_extract.cpp $(HIPCC) $(HIPCC_FLAGS) $< -o $@ -$(EXE_STATIC): bit_extract.cpp - $(HIPCC) -use-staticlib $(HIPCC_FLAGS) $< -o $@ - -all: $(EXE) $(EXE_STATIC) +all: $(EXE) clean: - rm -f *.o $(EXE) $(EXE_STATIC) + rm -f *.o $(EXE) diff --git a/projects/hip-tests/samples/0_Intro/module_api/CMakeLists.txt b/projects/hip-tests/samples/0_Intro/module_api/CMakeLists.txt new file mode 100644 index 0000000000..0f5cc32f91 --- /dev/null +++ b/projects/hip-tests/samples/0_Intro/module_api/CMakeLists.txt @@ -0,0 +1,36 @@ +project(module_api) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) + +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) + +# Create the excutable +add_executable(runKernel.hip.out runKernel.cpp) +add_executable(launchKernelHcc.hip.out launchKernelHcc.cpp) +add_executable(defaultDriver.hip.out defaultDriver.cpp) + +# Generate code object +add_custom_target( + codeobj + ALL + COMMAND ${HIP_HIPCC_EXECUTABLE} --genco ../vcpy_kernel.cpp -o vcpy_kernel.code + COMMENT "codeobj generated" +) + +add_dependencies(runKernel.hip.out codeobj) +add_dependencies(launchKernelHcc.hip.out codeobj) +add_dependencies(defaultDriver.hip.out codeobj) + +# Link with HIP +target_link_libraries(runKernel.hip.out hip::host) +target_link_libraries(launchKernelHcc.hip.out hip::host) +target_link_libraries(defaultDriver.hip.out hip::host) diff --git a/projects/hip-tests/samples/0_Intro/module_api_global/CMakeLists.txt b/projects/hip-tests/samples/0_Intro/module_api_global/CMakeLists.txt new file mode 100644 index 0000000000..00caa79cfa --- /dev/null +++ b/projects/hip-tests/samples/0_Intro/module_api_global/CMakeLists.txt @@ -0,0 +1,30 @@ +project(modile_api_global) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) + +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) + +# Create the excutable +add_executable(runKernel.hip.out runKernel.cpp) + +# Generate code object +add_custom_target( + codeobj + ALL + COMMAND ${HIP_HIPCC_EXECUTABLE} --genco ../vcpy_kernel.cpp -o vcpy_kernel.code + COMMENT "codeobj generated" +) + +add_dependencies(runKernel.hip.out codeobj) + +# Link with HIP +target_link_libraries(runKernel.hip.out hip::host) \ No newline at end of file diff --git a/projects/hip-tests/samples/0_Intro/square/CMakeLists.txt b/projects/hip-tests/samples/0_Intro/square/CMakeLists.txt new file mode 100644 index 0000000000..845c43fd1f --- /dev/null +++ b/projects/hip-tests/samples/0_Intro/square/CMakeLists.txt @@ -0,0 +1,21 @@ +#Follow "README.md" to generate square.cpp if it's missing + +project(square) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) + +# Create the excutable +add_executable(square square.cpp) + +# Link with HIP +target_link_libraries(square hip::host) \ No newline at end of file diff --git a/projects/hip-tests/samples/0_Intro/square/Makefile b/projects/hip-tests/samples/0_Intro/square/Makefile index aa046eeaaa..9bb0dd8205 100644 --- a/projects/hip-tests/samples/0_Intro/square/Makefile +++ b/projects/hip-tests/samples/0_Intro/square/Makefile @@ -11,7 +11,7 @@ else SOURCES=square.cpp endif -all: square.out square.out.static +all: square.out # Step square.cpp: square.cu @@ -20,8 +20,5 @@ square.cpp: square.cu square.out: $(SOURCES) $(HIPCC) $(CXXFLAGS) $(SOURCES) -o $@ -square.out.static: $(SOURCES) - $(HIPCC) -use-staticlib $(CXXFLAGS) $(SOURCES) -o $@ - clean: - rm -f *.o *.out *.out.static square.cpp + rm -f *.o *.out square.cpp diff --git a/projects/hip-tests/samples/1_Utils/hipBusBandwidth/CMakeLists.txt b/projects/hip-tests/samples/1_Utils/hipBusBandwidth/CMakeLists.txt new file mode 100644 index 0000000000..df01c31d97 --- /dev/null +++ b/projects/hip-tests/samples/1_Utils/hipBusBandwidth/CMakeLists.txt @@ -0,0 +1,20 @@ +project(hipBusBandwidth) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(hipBusBandwidth hipBusBandwidth.cpp ResultDatabase.cpp) + +# Link with HIP +target_link_libraries(hipBusBandwidth hip::host) \ No newline at end of file diff --git a/projects/hip-tests/samples/1_Utils/hipCommander/CMakeLists.txt b/projects/hip-tests/samples/1_Utils/hipCommander/CMakeLists.txt new file mode 100644 index 0000000000..2592020c66 --- /dev/null +++ b/projects/hip-tests/samples/1_Utils/hipCommander/CMakeLists.txt @@ -0,0 +1,31 @@ +project(hipCommander) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(hipCommander hipCommander.cpp) + +# Generate code object +add_custom_target( + codeobj + ALL + COMMAND ${HIP_HIPCC_EXECUTABLE} --genco ../nullkernel.hip.cpp -o nullkernel.hsaco + COMMENT "codeobj generated" +) + +add_dependencies(hipCommander codeobj) + +# Link with HIP +target_link_libraries(hipCommander hip::host) +set_property(TARGET hipCommander PROPERTY CXX_STANDARD 11) diff --git a/projects/hip-tests/samples/1_Utils/hipDispatchLatency/CMakeLists.txt b/projects/hip-tests/samples/1_Utils/hipDispatchLatency/CMakeLists.txt new file mode 100644 index 0000000000..b267f91905 --- /dev/null +++ b/projects/hip-tests/samples/1_Utils/hipDispatchLatency/CMakeLists.txt @@ -0,0 +1,35 @@ +project(hipDispatchLatency) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(hipDispatchLatency hipDispatchLatency.cpp) +add_executable(hipDispatchEnqueueRateMT hipDispatchEnqueueRateMT.cpp) + +# Generate code object +add_custom_target( + codeobj + ALL + COMMAND ${HIP_HIPCC_EXECUTABLE} --genco ../test_kernel.cpp -o test_kernel.code + COMMENT "codeobj generated" +) + +add_dependencies(hipDispatchLatency codeobj) +add_dependencies(hipDispatchEnqueueRateMT codeobj) + +# Link with HIP +target_link_libraries(hipDispatchLatency hip::host) +target_link_libraries(hipDispatchEnqueueRateMT hip::host) +set_property(TARGET hipDispatchLatency PROPERTY CXX_STANDARD 11) +set_property(TARGET hipDispatchEnqueueRateMT PROPERTY CXX_STANDARD 11) diff --git a/projects/hip-tests/samples/1_Utils/hipInfo/CMakeLists.txt b/projects/hip-tests/samples/1_Utils/hipInfo/CMakeLists.txt new file mode 100644 index 0000000000..f3678d3160 --- /dev/null +++ b/projects/hip-tests/samples/1_Utils/hipInfo/CMakeLists.txt @@ -0,0 +1,20 @@ +project(hipInfo) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(hipInfo hipInfo.cpp) + +# Link with HIP +target_link_libraries(hipInfo hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt new file mode 100644 index 0000000000..de5bb0b5ea --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt @@ -0,0 +1,20 @@ +project(MatrixTranspose) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(MatrixTranspose MatrixTranspose.cpp) + +# Link with HIP +target_link_libraries(MatrixTranspose hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/10_inline_asm/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/10_inline_asm/CMakeLists.txt new file mode 100644 index 0000000000..7adb51f5de --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/10_inline_asm/CMakeLists.txt @@ -0,0 +1,20 @@ +project(inline_asm) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(inline_asm inline_asm.cpp) + +# Link with HIP +target_link_libraries(inline_asm hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/11_texture_driver/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/11_texture_driver/CMakeLists.txt new file mode 100644 index 0000000000..8ff242c993 --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/11_texture_driver/CMakeLists.txt @@ -0,0 +1,30 @@ +project(texture2dDrv) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(texture2dDrv texture2dDrv.cpp) + +# Generate code object +add_custom_target( + codeobj + ALL + COMMAND ${HIP_HIPCC_EXECUTABLE} --genco ../tex2dKernel.cpp -o tex2dKernel.code + COMMENT "codeobj generated" +) + +add_dependencies(texture2dDrv codeobj) + +# Link with HIP +target_link_libraries(texture2dDrv hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/13_occupancy/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/13_occupancy/CMakeLists.txt new file mode 100644 index 0000000000..6cad76a395 --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/13_occupancy/CMakeLists.txt @@ -0,0 +1,20 @@ +project(occupancy) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(occupancy occupancy.cpp) + +# Link with HIP +target_link_libraries(occupancy hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/1_hipEvent/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/1_hipEvent/CMakeLists.txt new file mode 100644 index 0000000000..6f6ee4e050 --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/1_hipEvent/CMakeLists.txt @@ -0,0 +1,20 @@ +project(hipEvent) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(hipEvent hipEvent.cpp) + +# Link with HIP +target_link_libraries(hipEvent hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/3_shared_memory/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/3_shared_memory/CMakeLists.txt new file mode 100644 index 0000000000..6401488628 --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/3_shared_memory/CMakeLists.txt @@ -0,0 +1,20 @@ +project(sharedMemory) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(sharedMemory sharedMemory.cpp) + +# Link with HIP +target_link_libraries(sharedMemory hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/4_shfl/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/4_shfl/CMakeLists.txt new file mode 100644 index 0000000000..9d142eeb02 --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/4_shfl/CMakeLists.txt @@ -0,0 +1,20 @@ +project(shfl) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_BUILD_TYPE Release) + +# Create the excutable +add_executable(shfl shfl.cpp) + +# Link with HIP +target_link_libraries(shfl hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/5_2dshfl/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/5_2dshfl/CMakeLists.txt new file mode 100644 index 0000000000..adc0e3595d --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/5_2dshfl/CMakeLists.txt @@ -0,0 +1,19 @@ +project(2dshfl) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) + +# Create the excutable +add_executable(2dshfl 2dshfl.cpp) + +# Link with HIP +target_link_libraries(2dshfl hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt new file mode 100644 index 0000000000..f177952d5a --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt @@ -0,0 +1,19 @@ +project(dynamic_shared) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) + +# Create the excutable +add_executable(dynamic_shared dynamic_shared.cpp) + +# Link with HIP +target_link_libraries(dynamic_shared hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/7_streams/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/7_streams/CMakeLists.txt new file mode 100644 index 0000000000..fac4187b47 --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/7_streams/CMakeLists.txt @@ -0,0 +1,19 @@ +project(stream) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) + +# Create the excutable +add_executable(stream stream.cpp) + +# Link with HIP +target_link_libraries(stream hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/8_peer2peer/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/8_peer2peer/CMakeLists.txt new file mode 100644 index 0000000000..7c38373911 --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/8_peer2peer/CMakeLists.txt @@ -0,0 +1,19 @@ +project(peer2peer) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) + +# Create the excutable +add_executable(peer2peer peer2peer.cpp) + +# Link with HIP +target_link_libraries(peer2peer hip::host) diff --git a/projects/hip-tests/samples/2_Cookbook/9_unroll/CMakeLists.txt b/projects/hip-tests/samples/2_Cookbook/9_unroll/CMakeLists.txt new file mode 100644 index 0000000000..fc1b740e33 --- /dev/null +++ b/projects/hip-tests/samples/2_Cookbook/9_unroll/CMakeLists.txt @@ -0,0 +1,19 @@ +project(unroll) + +cmake_minimum_required(VERSION 3.10) + +# Search for rocm in common locations +list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) + +# Find hip +find_package(hip) + +# Set compiler and linker +set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE}) +set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) + +# Create the excutable +add_executable(unroll unroll.cpp) + +# Link with HIP +target_link_libraries(unroll hip::host) diff --git a/projects/hip-tests/samples/README.md b/projects/hip-tests/samples/README.md new file mode 100644 index 0000000000..739045382e --- /dev/null +++ b/projects/hip-tests/samples/README.md @@ -0,0 +1,27 @@ +Build procedure + +We provide Makefile and CMakeLists.txt to build the samples seperately. + +1.Makefile supports shared lib of hip-rocclr runtime and nvcc. + +To build a sample, just type in sample folder, + +make + + + +2.CMakeLists.txt can support shared and static libs of hip-rocclr runtime. + +To build a sample, type in sample folder, + +mkdir build (if build folder is missing) + +cd build + +cmake .. + +make + +If you want debug version, follow, + +cmake -DCMAKE_BUILD_TYPE=Debug .. \ No newline at end of file