From 0a1a41919124bc6008aa0171e7af7963ef9b30f8 Mon Sep 17 00:00:00 2001 From: "systems-assistant[bot]" <221163467+systems-assistant[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 23:24:57 -0700 Subject: [PATCH] SWDEV-534394 - Add test for kernel launch stream on different device (#565) Co-authored-by: Pengda Xie --- .../module/hip_module_launch_kernel_common.hh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/projects/hip-tests/catch/unit/module/hip_module_launch_kernel_common.hh b/projects/hip-tests/catch/unit/module/hip_module_launch_kernel_common.hh index b5dc9f7720..32bb9ed1c8 100644 --- a/projects/hip-tests/catch/unit/module/hip_module_launch_kernel_common.hh +++ b/projects/hip-tests/catch/unit/module/hip_module_launch_kernel_common.hh @@ -229,6 +229,24 @@ template void ModuleLaunchKernelNegativeParamet hipErrorInvalidValue); } + SECTION("Stream not on the same device") { + int numDevices = 0; + HIP_CHECK(hipGetDeviceCount(&numDevices)); + if (numDevices < 2) { + SUCCEED("skipped the testcase as number of devices is less than 2"); + } else { + HIP_CHECK(hipSetDevice(1)); + hipStream_t s1; + HIP_CHECK(hipStreamCreate(&s1)); + HIP_CHECK(hipSetDevice(0)); + hipFunction_t f = GetKernel(mg.module(), "Kernel42"); + void* extra[0] = {}; + HIP_CHECK_ERROR(func(f, 1, 1, 1, 1, 1, 1, 0, s1, nullptr, extra, nullptr, nullptr, 0u), + hipErrorInvalidResourceHandle); + HIP_CHECK(hipStreamDestroy(s1)); + } + } + SECTION("Invalid extra") { hipFunction_t f = GetKernel(mg.module(), "Kernel42"); void* extra[0] = {};