Skip to content

Replace SUCCEED-based skips with HipTest::HIP_SKIP_TEST in hip-tests#4567

Open
iassiour wants to merge 10 commits intodevelopfrom
fix/hip-tests-use-hip-skip-test-instead-of-succeed
Open

Replace SUCCEED-based skips with HipTest::HIP_SKIP_TEST in hip-tests#4567
iassiour wants to merge 10 commits intodevelopfrom
fix/hip-tests-use-hip-skip-test-instead-of-succeed

Conversation

@iassiour
Copy link
Copy Markdown
Contributor

Runtime skips (multi-GPU, P2P, memory pool, managed memory, arch checks, perf no-device, etc.) previously used Catch SUCCEED, which reports pass. Use HipTest::HIP_SKIP_TEST so ctest can detect HIP_SKIP_THIS_TEST.

Includes control-flow fixes where skip paths must return before further setup, and string formatting where skips used stream insertion.

Made-with: Cursor

Motivation

Technical Details

JIRA ID

Test Plan

Test Result

Submission Checklist

@iassiour iassiour requested a review from a team as a code owner March 30, 2026 18:51
Copilot AI review requested due to automatic review settings March 30, 2026 18:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates HIP Catch2 tests to report runtime skips as skipped (via HipTest::HIP_SKIP_TEST) instead of passed (via SUCCEED), so ctest can correctly classify these cases using SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST".

Changes:

  • Replace SUCCEED-based runtime skip paths (multi-GPU/P2P/mempool/managed memory/arch/no-device/etc.) with HipTest::HIP_SKIP_TEST.
  • Add some early return/continue control-flow fixes so skip paths don’t proceed into unsupported setup/execution.
  • Fix a few skip-message formatting cases that previously relied on stream insertion by building strings explicitly.

Reviewed changes

Copilot reviewed 90 out of 90 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
projects/hip-tests/catch/unit/texture/hipTexRefSetGetMipmappedArray.cc Use HIP_SKIP_TEST when mipmapped arrays aren’t supported.
projects/hip-tests/catch/unit/texture/hipBindTextureToMipmappedArray.cc Use HIP_SKIP_TEST for unsupported mipmap platform/config.
projects/hip-tests/catch/unit/streamperthread/hipStreamPerThrdTsts.cc Convert managed-mem / coop-launch skips to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/stream/hipMultiStream.cc Skip when no GPU is available (now a real ctest skip).
projects/hip-tests/catch/unit/stream/hipLaunchHostFunc.cc Skip multi-device test when devices < 2.
projects/hip-tests/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags.cc Skip MGPU test when devices < 2.
projects/hip-tests/catch/unit/module/hip_module_launch_kernel_common.hh Convert MGPU-dependent section skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/module/hipModuleGetGlobal.cc Skip when devices < 2.
projects/hip-tests/catch/unit/module/hipModuleGetFunction.cc Skip when devices < 2.
projects/hip-tests/catch/unit/memory/mempool_common.hh Skip when memory pools aren’t supported.
projects/hip-tests/catch/unit/memory/hipPointerGetAttribute.cc Convert P2P/multi-device skips to HIP_SKIP_TEST and add a return path.
projects/hip-tests/catch/unit/memory/hipMemcpy_EdgeCases.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add early return in one path.
projects/hip-tests/catch/unit/memory/hipMemcpyWithStream_old.cc Convert single-GPU skips to HIP_SKIP_TEST and restructure for early return.
projects/hip-tests/catch/unit/memory/hipMemcpyPeerAsync_old.cc Convert skip conditions to HIP_SKIP_TEST and add early return.
projects/hip-tests/catch/unit/memory/hipMemcpyParam2DAsync_old.cc Convert peer-access / device-count skips to HIP_SKIP_TEST and add return for device-count.
projects/hip-tests/catch/unit/memory/hipMemcpyHtoA_old.cc Convert peer-access / device-count skips to HIP_SKIP_TEST and add return for device-count.
projects/hip-tests/catch/unit/memory/hipMemcpyDtoDAsync.cc Convert MGPU/P2P skips to HIP_SKIP_TEST with early returns.
projects/hip-tests/catch/unit/memory/hipMemcpyAtoH_old.cc Convert peer-access / device-count skips to HIP_SKIP_TEST and add return for device-count.
projects/hip-tests/catch/unit/memory/hipMemcpyAsync_old.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add early return in one path.
projects/hip-tests/catch/unit/memory/hipMemcpy3D_old.cc Convert peer-access / device-count skips to HIP_SKIP_TEST and add return for device-count.
projects/hip-tests/catch/unit/memory/hipMemcpy3DAsync_old.cc Convert peer-access / device-count skips to HIP_SKIP_TEST and add returns for device-count.
projects/hip-tests/catch/unit/memory/hipMemcpy2DToArray_old.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add early returns for device-count.
projects/hip-tests/catch/unit/memory/hipMemcpy2DToArrayAsync_old.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add early returns for device-count.
projects/hip-tests/catch/unit/memory/hipMemcpy2DFromArray_old.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add early returns for device-count.
projects/hip-tests/catch/unit/memory/hipMemcpy2DFromArrayAsync_old.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add early returns for device-count.
projects/hip-tests/catch/unit/memory/hipMemcpy2DAsync_old.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add early return for device-count.
projects/hip-tests/catch/unit/memory/hipMemVmm.cc Convert VMM-support skips to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/memory/hipMemRangeGetAttribute_old.cc Convert managed-memory / pageable-HMM stability skips to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/memory/hipMemPrefetchAsyncExtTsts.cc Convert managed-memory / multi-GPU skips to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/memory/hipMemPoolTrimTo.cc Convert MGPU skip to HIP_SKIP_TEST and return early.
projects/hip-tests/catch/unit/memory/hipMemPoolApi.cc Convert memory-pool support skips to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/memory/hipMemCoherencyTst.cc Convert managed-memory capability skips to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/memory/hipMemAdvise_old.cc Convert MGPU / managed-memory skips to HIP_SKIP_TEST and add early returns in some paths.
projects/hip-tests/catch/unit/memory/hipMemAdviseMmap.cc Convert pageable-memory-access skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/memory/hipMallocManaged_MultiScenario.cc Convert pageable-HMM oversubscription stability skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/memory/hipMallocManaged.cc Convert stream-insertion skip messages to formatted strings + HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/memory/hipMallocArray.cc Convert gfx-specific skip to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/memory/hipHostMalloc.cc Convert host-mapping/coherence skips to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/memory/hipHostAlloc.cc Convert host-mapping skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/memory/hipFreeMipmappedArray.cc Convert “insufficient memory” skip to HIP_SKIP_TEST with formatted message; add <string>.
projects/hip-tests/catch/unit/memory/hipDrvMemcpy3D_old.cc Convert MGPU device-count skips to HIP_SKIP_TEST + early returns.
projects/hip-tests/catch/unit/memory/hipDrvMemcpy3DAsync_old.cc Convert MGPU device-count skips to HIP_SKIP_TEST + early returns.
projects/hip-tests/catch/unit/graph/hipStreamBeginCapture_old.cc Convert MGPU skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/graph/hipStreamBeginCapture.cc Convert MGPU skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/graph/hipGraphUpload.cc Convert no-device skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/graph/hipGraphMemAllocNodeGetParams.cc Convert no-device skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/graph/hipGraphLaunch_old.cc Convert no-device skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/graph/hipGraphInstantiateWithFlags.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add returns for device-count.
projects/hip-tests/catch/unit/graph/hipGraphCloneComplx.cc Convert MGPU skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/graph/hipGraphClone.cc Convert MGPU/P2P skip paths to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/graph/hipGraphAddMemcpyNodeToSymbol_old.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add early returns.
projects/hip-tests/catch/unit/graph/hipGraphAddMemcpyNodeFromSymbol_old.cc Convert MGPU/P2P skips to HIP_SKIP_TEST and add early returns.
projects/hip-tests/catch/unit/graph/hipGraphAddChildGraphNode.cc Convert MGPU skip to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/graph/hipDrvGraphAddMemcpyNode.cc Convert MGPU skip to HIP_SKIP_TEST and add early return.
projects/hip-tests/catch/unit/executionControl/hipLaunchCooperativeKernelMultiDevice.cc Convert device-count skips to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/event/Unit_hipEventMGpuMThreads.cc Convert MGPU skips to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/deviceLib/unsafeAtomicAdd_RTC.cc Convert feature/host-mapping skips to HIP_SKIP_TEST; add <string> and formatted messages.
projects/hip-tests/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withunsafeflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withoutflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withnounsafeflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withunsafeflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withoutflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withnounsafeflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/threadfence_system.cc Convert allocation-failure “skip” to HIP_SKIP_TEST.
projects/hip-tests/catch/unit/deviceLib/BuiltIns_fmin.cc Convert feature/host-mapping skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/BuiltIns_fmax.cc Convert feature/host-mapping skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/AtomicAdd_NonCoherent_withunsafeflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/AtomicAdd_NonCoherent_withoutflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/AtomicAdd_NonCoherent_withnoUnsafeflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/AtomicAdd_Coherent_withunsafeflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/AtomicAdd_Coherent_withoutflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/unit/deviceLib/AtomicAdd_Coherent_withnoUnsafeflag.cc Convert skips to HIP_SKIP_TEST; add <string>.
projects/hip-tests/catch/stress/memory/hipMemPrftchAsyncStressTst.cc Convert managed-memory skip to HIP_SKIP_TEST.
projects/hip-tests/catch/stress/memory/hipMallocManagedStress.cc Convert managed-memory skip to HIP_SKIP_TEST.
projects/hip-tests/catch/perftests/vmm/hipPerfVMMAlloc.cc Convert no-device perf skip to HIP_SKIP_TEST; adjust message.
projects/hip-tests/catch/perftests/memory/hipPerfSharedMemReadSpeed.cc Convert no-device perf skip to HIP_SKIP_TEST.
projects/hip-tests/catch/perftests/memory/hipPerfMemcpy.cc Convert no-device perf skip to HIP_SKIP_TEST.
projects/hip-tests/catch/perftests/memory/hipPerfMemMallocCpyFree.cc Convert no-device perf skip to HIP_SKIP_TEST.
projects/hip-tests/catch/perftests/memory/hipPerfHostNumaAlloc.cc Convert invalid device-count skip to HIP_SKIP_TEST and return early.
projects/hip-tests/catch/perftests/memory/hipPerfDevMemWriteSpeed.cc Convert no-device perf skip to HIP_SKIP_TEST.
projects/hip-tests/catch/perftests/memory/hipPerfDevMemReadSpeed.cc Convert no-device perf skip to HIP_SKIP_TEST.
projects/hip-tests/catch/perftests/memory/hipPerfBufferCopySpeedAll2All.cc Replace trailing SUCCEED with REQUIRE(true).
projects/hip-tests/catch/perftests/memory/hipPerfBufferCopySpeed.cc Convert no-device perf skip to HIP_SKIP_TEST.
projects/hip-tests/catch/perftests/memory/hipPerfBufferCopyRectSpeed.cc Convert no-device perf skip to HIP_SKIP_TEST.
projects/hip-tests/catch/multiproc/hipGetDevicePropertiesMproc.cc Convert “not enough GPUs” skip to HIP_SKIP_TEST.
projects/hip-tests/catch/multiproc/hipGetDeviceAttributeMproc.cc Convert “not enough GPUs” skip to HIP_SKIP_TEST.
projects/hip-tests/catch/multiproc/hipDeviceTotalMemMproc.cc Convert “not enough GPUs” skip to HIP_SKIP_TEST.
projects/hip-tests/catch/multiproc/hipDeviceGetPCIBusIdMproc.cc Convert “not enough GPUs” skip to HIP_SKIP_TEST.
projects/hip-tests/catch/multiproc/hipDeviceComputeCapabilityMproc.cc Convert “not enough GPUs” skip to HIP_SKIP_TEST.
projects/hip-tests/catch/include/hip_test_checkers.hh Convert missing-assembly-file “skip” to HIP_SKIP_TEST.
Comments suppressed due to low confidence (1)

projects/hip-tests/catch/unit/deviceLib/threadfence_system.cc:49

  • If hipHostMalloc(&data, ...) fails, HIP_SKIP_TEST only prints and execution continues; data is uninitialized and is dereferenced on the next line. After printing the skip message, return early (and only free resources that were successfully allocated) to avoid undefined behavior/crashes.
  if (hipHostMalloc(&data, sizeof(int), hipHostMallocCoherent) != hipSuccess) {
    HipTest::HIP_SKIP_TEST("Memory allocation failed. Skip test. Is SVM atomic supported?");
  }

  constexpr int init_data = 1000;
  *data = init_data;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sruscica sruscica requested a review from cadolphe-amd March 31, 2026 19:08
@iassiour iassiour force-pushed the fix/hip-tests-use-hip-skip-test-instead-of-succeed branch from 34beae3 to 870a4dd Compare March 31, 2026 21:04
iassiour added 8 commits April 1, 2026 09:04
Runtime skips (multi-GPU, P2P, memory pool, managed memory, arch checks,
perf no-device, etc.) previously used Catch SUCCEED, which reports pass.
Use HipTest::HIP_SKIP_TEST so ctest can detect HIP_SKIP_THIS_TEST.

Includes control-flow fixes where skip paths must return before further
setup, and string formatting where skips used stream insertion.

Made-with: Cursor
- threadfence_system: return after HIP_SKIP_TEST; free first allocation if second fails
- hipMallocManaged Advanced: free managed buffers (and events when created) before return on skip
- hipMemcpyParam2DAsync_old: free pitch + host buffers when skipping for no P2P
- hipMemcpy3D_old: single-line HIP_SKIP_TEST strings (fix invalid literals)
- hipPerfBufferCopyRectSpeed: one-line skip message (reviewer request)
- hipPerfBufferCopySpeedAll2All: CHECK(true) + comment vs bare REQUIRE(true)

Made-with: Cursor
Introduce HipTest::SkipReason constexpr messages in hip_test_common.hh so
duplicate skip conditions share one stable string for logs and ctest.

Replace matching HIP_SKIP_TEST string literals across catch tests (P2P,
multi-GPU, memory pool, managed memory, host pinned, VMM, cooperative
launch, PCIe atomics, warp intrinsics, etc.). Wire CHECK_PCIE_ATOMIC_SUPPORT
to kPcieAtomicUnsupported.

Add tools/apply_skip_reason_constants.py to document and reproduce the
literal-to-constant mapping.

Made-with: Cursor
hipSetValidDevices and hipGetDeviceCount skip when deviceCount < 2, i.e. they
require at least two GPUs. Replace mistaken kFewerThanThreeGpus and align
skip messages with HipTest::SkipReason::kFewerThanTwoGpus.

Remove unused kFewerThanThreeGpus and fix apply_skip_reason_constants.py
mapping.

Made-with: Cursor
Drop the one-off bulk-replacement script from the tree; skip reason
constants remain in hip_test_common.hh.

Made-with: Cursor
…dMemory skips

Replace multi-line HIP_SKIP_TEST strings about GPU 0 lacking managed memory
with HipTest::SkipReason::kManagedMemoryUnsupported in stress and unit tests.

Made-with: Cursor
Add SkipReason::kFineGrainHwUnsupported for stable skip messages.

cache_coherency_cpu_gpu: gate device fine-grained path on
CheckIfFeatSupported(CT_FEATURE_FINEGRAIN_HWSUPPORT) instead of
hipDeviceAttributeFineGrainSupport.

unsafeAtomicAddDevice: emit HIP_SKIP_TEST when fine-grain CT feature
is unsupported (previously vacuous pass).

AtomicAdd / unsafeAtomicAdd / RTC tests: replace ad-hoc skip_gfx_msg
else branches with the canonical skip reason.

Includes hipEventCreateWithFlags updates on this branch.

Made-with: Cursor
@iassiour iassiour force-pushed the fix/hip-tests-use-hip-skip-test-instead-of-succeed branch from a6f2356 to 74acd4b Compare April 1, 2026 08:04
/* Test whether target device supports cooperative groups ****************/
if (device_properties.cooperativeLaunch == 0) {
SUCCEED("Cooperative group support not available...");
HipTest::HIP_SKIP_TEST("Cooperative group support not available...");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

kCooperativeLaunchUnsupported

HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kFineGrainHwUnsupported);
return true;
}
deviceFineGrain = 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Check this rework.

SUCCEED(
HipTest::HIP_SKIP_TEST(
"Mipmaps are Supported only on windows on devices with image support,"
" skipping the test.");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rework to remove skipping the test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe just kMipmappedArraysUnsupported?

@iassiour iassiour force-pushed the fix/hip-tests-use-hip-skip-test-instead-of-succeed branch from f18003c to cdca2f1 Compare April 2, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants