Files
TheRock/rocm-systems/projects/hip-tests/catch/unit/vulkan_interop/hipGraphAddExternalSemaphoresWaitNode.cc
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

129 lines
4.0 KiB
C++

/*
* Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
*
* SPDX-License-Identifier: MIT
*/
#ifdef _WIN64
#define NOMINMAX
#endif /* _WIN64 */
#include <functional>
#include "vulkan_test.hh"
#include "wait_semaphore_common.hh"
#include "graph_tests_common.hh"
/**
* @addtogroup hipGraphAddExternalSemaphoresWaitNode hipGraphAddExternalSemaphoresWaitNode
* @{
* @ingroup GraphTest
* `hipGraphAddExternalSemaphoresWaitNode(hipGraphNode_t* pGraphNode, hipGraph_t graph, const
* hipGraphNode_t* pDependencies, size_t numDependencies, const hipExternalSemaphoreWaitNodeParams*
* nodeParams)` - Creates a external semaphor wait node and adds it to a graph.
*/
/**
* Test Description
* ------------------------
* - Creates two host visible Vulkan buffers.
* - Adds a buffer copy command which will copy from one buffer to another.
* - Creates an external Vulkan binary semaphore.
* - Creates a Vulkan fence and signals semaphore asynchronously.
* - Waits for the operation to finish successfully.
* Test source
* ------------------------
* - unit/vulkan_interop/hipGraphAddExternalSemaphoresWaitNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 6.0
*/
HIP_TEST_CASE(Unit_hipGraphAddExternalSemaphoresWaitNode_Positive_Basic) {
WaitExternalSemaphoreCommon(GraphExtSemaphoreWaitWrapper<>);
}
// Timeline semaphores unsupported on AMD
#if HT_NVIDIA
/**
* Test Description
* ------------------------
* - Creates an external Vulkan timeline semaphore.
* - Imports the semaphore and signals.
* - Waits for the operation to finish successfully.
* Test source
* ------------------------
* - unit/vulkan_interop/hipGraphAddExternalSemaphoresWaitNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 6.0
*/
HIP_TEST_CASE(Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Positive_Timeline_Semaphore) {
WaitExternalTimelineSemaphoreCommon(GraphExtSemaphoreWaitWrapper<>);
}
#endif
/**
* Test Description
* ------------------------
* - Creates two host visible Vulkan buffers.
* - Adds a buffer copy command which will copy from one buffer to another.
* - Creates multiple external Vulkan binary semaphores.
* - Createas a Vulkan fence and signals semaphores.
* - Waits for the operations to finish successfully.
* Test source
* ------------------------
* - unit/vulkan_interop/hipGraphAddExternalSemaphoresWaitNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 6.0
*/
HIP_TEST_CASE(Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Positive_Multiple_Semaphores) {
WaitExternalMultipleSemaphoresCommon(GraphExtSemaphoreWaitWrapper<>);
}
/**
* Test Description
* ------------------------
* - Test to verify hipGraphAddExternalSemaphoresWaitNode behavior with invalid arguments:
* -# Nullptr graph
* -# Nullptr graph node
* -# Invalid numDependencies for null list of dependencies
* -# Node in dependency is from different graph
* -# Invalid numNodes
* -# Duplicate node in dependencies
* Test source
* ------------------------
* - /unit/vulkan_interop/hipGraphAddExternalSemaphoresWaitNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 6.0
*/
HIP_TEST_CASE(Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Negative_Parameters) {
using namespace std::placeholders;
hipGraph_t graph = nullptr;
HIP_CHECK(hipGraphCreate(&graph, 0));
VulkanTest vkt(enable_validation);
hipExternalSemaphoreWaitParams wait_params = {};
wait_params.params.fence.value = 1;
auto hip_ext_semaphore = ImportBinarySemaphore(vkt);
hipExternalSemaphoreWaitNodeParams node_params = {};
node_params.extSemArray = &hip_ext_semaphore;
node_params.paramsArray = &wait_params;
node_params.numExtSems = 1;
GraphAddNodeCommonNegativeTests(
std::bind(hipGraphAddExternalSemaphoresWaitNode, _1, _2, _3, _4, &node_params), graph);
HIP_CHECK(hipDestroyExternalSemaphore(hip_ext_semaphore));
HIP_CHECK(hipGraphDestroy(graph));
}
/**
* End doxygen group GraphTest.
* @}
*/