Skip to content
Draft
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
5 changes: 4 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ add_subdirectory(kernel_smoke)
add_subdirectory(multithread)

# Graph API:
add_subdirectory(graph)
add_subdirectory(graph)

# Nightly ROCm bring-up regression tests:
add_subdirectory(nightly_symbols)
9 changes: 9 additions & 0 deletions tests/nightly_symbols/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2026 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

add_hip_cts_test(nightly_symbols_test
SOURCES nightly_symbols_test.cpp
)
52 changes: 52 additions & 0 deletions tests/nightly_symbols/nightly_symbols_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2026 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// ABI-surface check: a libamdhip64 targeting the recent HIP ABI must export
// these extended entry points. They were added across HIP versions
// (hipDrvLaunchKernelEx is versioned @hip_6.5) and are absent from older
// builds, so a runtime or a downstream library linked against the newer
// symbols fails to load if any is missing.
//
// Presence only: the test does not call them. Their argument contracts differ
// and a real implementation would dereference the (here absent) arguments, so
// invoking them generically would be undefined behavior. This is GPU-free: it
// dlopens the library under test and resolves each symbol.

#include <dlfcn.h>

#include <catch2/catch_test_macros.hpp>
#include "hip_loader.hpp"

namespace {
const char* const kExtendedSymbols[] = {
"hipDrvLaunchKernelEx", // versioned @hip_6.5
"hipGetFuncBySymbol",
"hipStreamBatchMemOp",
"hipMemGetHandleForAddressRange",
"hipMemcpyBatchAsync",
"hipImportExternalMemory",
"hipExternalMemoryGetMappedBuffer",
"hipDestroyExternalMemory",
};
} // namespace

TEST_CASE("libamdhip64 exports the extended HIP entry points",
"[symbols][nightly]") {
// Re-open the same binary the loader resolved (RTLD_NOW forces every
// relocation).
const std::string& lib = HipLoader::instance().libraryPath();
void* handle = dlopen(lib.c_str(), RTLD_NOW | RTLD_LOCAL);
REQUIRE(handle != nullptr);

for (const char* name : kExtendedSymbols) {
INFO("symbol: " << name);
// A -fvisibility regression or a version script that re-hides these would
// fail here.
REQUIRE(dlsym(handle, name) != nullptr);
}

dlclose(handle);
}