Files
TheRock/rocm-systems/projects/hip-tests/catch/unit/texture/CMakeLists.txt
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

152 lines
5.1 KiB
CMake

# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
#
# SPDX-License-Identifier: MIT
# Common Tests - Test independent of all platforms
set(TEST_SRC
hipCreateTextureObject_ArgValidation.cc
hipCreateTextureObject_Linear.cc
hipCreateTextureObject_Pitch2D.cc
hipCreateTextureObject_Array.cc
hipTextureObjFetchVector.cc
hipNormalizedFloatValueTex.cc
hipTextureObj2D.cc
hipSimpleTexture3D.cc
hipTextureRef2D.cc
hipSimpleTexture1DLayered.cc
hipSimpleTexture2DLayered.cc
hipBindTexture.cc
hipBindTexture2D.cc
hipTex1DFetchCheckModes.cc
hipGetChanDesc.cc
hipGetTextureAlignmentOffset.cc
hipGetTextureReference.cc
hipTexObjPitch.cc
hipTexRefSetArray.cc
hipTexRefGetArray.cc
hipTexRefGetBorderColor.cc
hipTexRefSetBorderColor.cc
hipTexRefGetAddress.cc
hipTexRefSetAddress.cc
hipTexRefGetFormat.cc
hipTexRefSetFormat.cc
hipTextureObj1DFetch.cc
hipTextureObj1DCheckModes.cc
hipTextureObj2DCheckModes.cc
hipTextureObj3DCheckModes.cc
hipTextureObj1DCheckSRGBModes.cc
hipTextureObj2DCheckSRGBModes.cc
hipTexObjectCreate.cc
hipTexObjectTests.cc
hipTextureObjectTests.cc
hipTexRefSetAddress2D.cc
hipTexRefSetMaxAnisotropy.cc
hipTexRefGetMaxAnisotropy.cc
hipUnbindTexture.cc
hipTexRefSetFlags.cc
hipBindTextureToArray.cc
hipTexRefGetFlags.cc
hipTexRefSetAddressMode.cc
hipTexRefGetAddressMode.cc
hipTexRefSetGetFilterMode.cc
hipDeviceGetTexture1DLinearMaxWidth.cc
hipMipmappedArrayGetMemoryRequirements.cc
)
# tests not for gfx90a+
set(NOT_FOR_gfx90a_AND_ABOVE_TEST
tex1D.cc
tex1DGrad.cc
tex1DLayeredGrad.cc
tex1Dfetch.cc
tex1DLayered.cc
tex2D.cc
tex2DGrad.cc
tex2DLayeredGrad.cc
tex2Dgather.cc
tex2DLayered.cc
tex3D.cc
tex3DGrad.cc
hipBindTextureToMipmappedArray.cc
hipMallocMipmappedArray.cc
hipFreeMipmappedArray.cc
hipGetMipmappedArrayLevel.cc
hipMipmappedArrayCreate.cc
hipMipmappedArrayDestroy.cc
hipMipmappedArrayGetLevel.cc
tex1DLod.cc
tex1DLayeredLod.cc
tex2DLod.cc
tex2DLayeredLod.cc
tex3DLod.cc
hipTexRefSetGetMipmapFilterMode.cc
hipTexRefSetGetMipmapLevelBias.cc
hipTexRefSetGetMipmapLevelClamp.cc
hipTexRefSetGetMipmappedArray.cc
)
if (HIP_PLATFORM MATCHES "amd")
set(${TEST_SRC} ${TEST_SRC} hipTextureMipmapObj1D.cc
hipTextureMipmapObj2D.cc
hipTextureMipmapObj3D.cc
)
endif()
set(gfx90a_AND_ABOVE_TARGETS gfx90a gfx942 gfx950)
function(CheckRejectedArchs OFFLOAD_ARCH_STR_LOCAL)
set(ARCH_CHECK -1 PARENT_SCOPE)
string(REGEX MATCHALL "--offload-arch=gfx[0-9a-z]+" OFFLOAD_ARCH_LIST ${OFFLOAD_ARCH_STR_LOCAL})
foreach(OFFLOAD_ARCH IN LISTS OFFLOAD_ARCH_LIST)
string(REGEX MATCHALL "--offload-arch=(gfx[0-9a-z]+)" matches ${OFFLOAD_ARCH})
if (CMAKE_MATCH_COUNT EQUAL 1)
if (CMAKE_MATCH_1 IN_LIST gfx90a_AND_ABOVE_TARGETS)
set(ARCH_CHECK 1 PARENT_SCOPE)
endif() # CMAKE_MATCH_1
endif() # CMAKE_MATCH_COUNT
endforeach() # OFFLOAD_ARCH_LIST
endfunction() # CheckAcceptedArchs
if (HIP_PLATFORM MATCHES "amd")
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code
COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -Wno-deprecated-declarations
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
-o tex_ref_get_module.code
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc)
else()
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code
COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST}
-x cu ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc
-I${HIP_INCLUDE_DIR}
-o tex_ref_get_module.code
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc)
endif()
add_custom_target(tex_ref_get_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code)
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code)
if(HIP_PLATFORM MATCHES "amd")
if (DEFINED OFFLOAD_ARCH_STR)
CheckRejectedArchs(${OFFLOAD_ARCH_STR})
elseif(DEFINED $ENV{HCC_AMDGPU_TARGET})
CheckRejectedArchs($ENV{HCC_AMDGPU_TARGET})
else()
set(ARCH_CHECK -1)
endif()
if(${ARCH_CHECK} EQUAL -1)
message(STATUS "Adding test: ${NOT_FOR_gfx90a_AND_ABOVE_TEST}")
set(TEST_SRC ${TEST_SRC} ${NOT_FOR_gfx90a_AND_ABOVE_TEST})
else()
message(STATUS "Removing test: ${NOT_FOR_gfx90a_AND_ABOVE_TEST}")
endif()
else()
set(TEST_SRC ${TEST_SRC} ${NOT_FOR_gfx90a_AND_ABOVE_TEST})
endif()
get_filename_component(HIP_TEST_LABELS ${CMAKE_CURRENT_SOURCE_DIR} NAME)
hip_add_exe_to_target(NAME TextureTest
TEST_SRC ${TEST_SRC}
TEST_TARGET_NAME build_tests)
target_compile_options(TextureTest PRIVATE -Wno-deprecated-declarations)
add_dependencies(TextureTest tex_ref_get_module)