CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
49 lines
1.8 KiB
CMake
49 lines
1.8 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
|
|
project(RTWeekend LANGUAGES CXX HIP)
|
|
|
|
if(WIN32)
|
|
set(CMAKE_CXX_USING_LINKER_DEFAULT "-fuse-ld=lld")
|
|
set(CMAKE_CXX_USING_LINKER_LLD "-fuse-ld=lld")
|
|
set(CMAKE_HIP_USING_LINKER_DEFAULT "-fuse-ld=lld")
|
|
set(CMAKE_HIP_USING_LINKER_LLD "-fuse-ld=lld")
|
|
endif()
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
endif()
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH $ENV{ROCM_PATH} /opt/rocm)
|
|
|
|
add_executable(inOneWeekend main.hip)
|
|
|
|
target_compile_options(inOneWeekend PUBLIC "-O3" "-fgpu-rdc" "-march=native")
|
|
target_link_options(inOneWeekend PUBLIC "-fgpu-rdc" "--hip-link")
|
|
|
|
if(WIN32)
|
|
# TheRock embeds /DEFAULTLIB:c++ in amdhip64.lib but doesn't ship libc++ on Windows,
|
|
# and clang's HIP driver auto-injects -lc++. Suppress both; MSVC's stdlib pulls in
|
|
# automatically via #pragma comment(lib, "msvcprt") from MSVC headers.
|
|
target_link_options(inOneWeekend PRIVATE "-nostdlib++" "-Xlinker" "/NODEFAULTLIB:c++.lib")
|
|
endif()
|
|
|
|
find_package(hipthreads REQUIRED)
|
|
find_package(rocprim REQUIRED)
|
|
find_package(rocthrust REQUIRED)
|
|
|
|
target_link_libraries(inOneWeekend PRIVATE hipthreads::hipthreads)
|
|
target_link_libraries(inOneWeekend PRIVATE roc::rocthrust)
|
|
|
|
target_compile_definitions(inOneWeekend PUBLIC __HIP__)
|
|
|
|
# LINUX:
|
|
# cd examples/InOneWeekendRaytracer/step4-simdize && cmake -B build && cmake --build build && time ./build/bin/inOneWeekend > image.ppm
|
|
|
|
# WINDOWS (from x64 Native Tools Command Prompt for VS 2022):
|
|
# cd examples/InOneWeekendRaytracer/step4-simdize && cmake -G Ninja -B build -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_C_COMPILER="clang" -DHIP_PLATFORM=amd -DCMAKE_HIP_ARCHITECTURES=gfx1201 -DCMAKE_BUILD_TYPE=Release . && cmake --build build && build\bin\inOneWeekend > image.ppm
|