Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip texture management example on MI300 and above #130

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion HIP-Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,19 @@ if(NOT WIN32 AND NOT "${GPU_RUNTIME}" STREQUAL "HIP")
add_subdirectory(static_host_library)
endif()
add_subdirectory(streams)
add_subdirectory(texture_management)

# This example is not supported on gfx940, gfx941, and gfx942
# See: __HIP_NO_IMAGE_SUPPORT in hip/amd_detail/amd_device_functions.h
list(REMOVE_DUPLICATES CMAKE_HIP_ARCHITECTURES)
if(NOT (CMAKE_HIP_ARCHITECTURES MATCHES "gfx94*"))
add_subdirectory(texture_management)
else()
message(
WARNING
"Texture functions not supported on gfx94*, not building texture management example"
)
endif()

add_subdirectory(warp_shuffle)

find_package(glfw3)
Expand Down
5 changes: 4 additions & 1 deletion HIP-Basic/assembly_to_executable/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ endif()

# Remove duplicates.
list(REMOVE_DUPLICATES GPU_ARCHITECTURES)
message(STATUS "GPU_ARCHITECTURES: ${GPU_ARCHITECTURES}")
message(
STATUS
"assembly_to_executable - GPU_ARCHITECTURES: ${GPU_ARCHITECTURES}"
)

set_source_files_properties(
main.hip
Expand Down
5 changes: 4 additions & 1 deletion HIP-Basic/llvm_ir_to_executable/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ endif()

# Remove duplicates
list(REMOVE_DUPLICATES GPU_ARCHITECTURES)
message(STATUS "GPU_ARCHITECTURES: ${GPU_ARCHITECTURES}")
message(
STATUS
"llvm_ir_to_executable - GPU_ARCHITECTURES: ${GPU_ARCHITECTURES}"
)

set_source_files_properties(
main.hip
Expand Down
45 changes: 29 additions & 16 deletions HIP-Basic/texture_management/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,36 @@ endif()

list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}")

add_executable(${example_name} main.hip)
# Make example runnable using ctest
add_test(${example_name} ${example_name})

# Temporary workaround: a known bug prevents the example from executing succesfully
# if multiple GPUs are visible
set_tests_properties(
${example_name}
PROPERTIES ENVIRONMENT "HIP_VISIBLE_DEVICES=0"
# Check if GPU architecture is supported
list(REMOVE_DUPLICATES CMAKE_HIP_ARCHITECTURES)
message(
STATUS
"texture_management - CMAKE_HIP_ARCHITECTURES: ${CMAKE_HIP_ARCHITECTURES}"
)

set(include_dirs "../../Common")
if(GPU_RUNTIME STREQUAL "CUDA")
list(APPEND include_dirs "${ROCM_ROOT}/include")
endif()
if(NOT CMAKE_HIP_ARCHITECTURES MATCHES "gfx94*")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't add the folder on HIP-Basic/CMakeLists.txt this change does not seem necessary IINM. I would suggest either keeping this and removing the skipping code on HIP-Basic/CMakeLists.txt or vice-versa.

add_executable(${example_name} main.hip)

# Make example runnable using ctest
add_test(${example_name} ${example_name})

# Temporary workaround: a known bug prevents the example from executing succesfully
# if multiple GPUs are visible
set_tests_properties(
${example_name}
PROPERTIES ENVIRONMENT "HIP_VISIBLE_DEVICES=0"
)

set(include_dirs "../../Common")
if(GPU_RUNTIME STREQUAL "CUDA")
list(APPEND include_dirs "${ROCM_ROOT}/include")
endif()

target_include_directories(${example_name} PRIVATE ${include_dirs})
set_source_files_properties(main.hip PROPERTIES LANGUAGE ${GPU_RUNTIME})
target_include_directories(${example_name} PRIVATE ${include_dirs})
set_source_files_properties(main.hip PROPERTIES LANGUAGE ${GPU_RUNTIME})

install(TARGETS ${example_name})
install(TARGETS ${example_name})
else()
# As per hip/amd_detail/amd_device_function.h
message(WARNING "This example is not supported on gfx94*, skipping...")
endif()
Loading