aboutsummaryrefslogtreecommitdiff
path: root/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp
diff options
context:
space:
mode:
authorRoss Brunton <ross@codeplay.com>2025-07-10 12:53:30 +0100
committerRoss Brunton <ross@codeplay.com>2025-07-10 14:55:06 +0100
commit2183d13cf39e8dceda18feb58a22afcb85dbcdc4 (patch)
treed05f94491854cdf4a96cdf4891fec19d48810252 /offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp
parent466357ab51609bceaf40daa04e2a4a9fe409939e (diff)
downloadllvm-users/RossBrunton/symbol2.zip
llvm-users/RossBrunton/symbol2.tar.gz
llvm-users/RossBrunton/symbol2.tar.bz2
[Offload] Add `olGetGlobalVariable`users/RossBrunton/symbol2
Looks up a global variable as a symbol
Diffstat (limited to 'offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp')
-rw-r--r--offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp b/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp
index acda479..cb77acf 100644
--- a/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp
+++ b/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp
@@ -223,6 +223,14 @@ TEST_P(olLaunchKernelGlobalTest, Success) {
ASSERT_SUCCESS(olMemFree(Mem));
}
+TEST_P(olLaunchKernelGlobalTest, InvalidNotAKernel) {
+ ol_symbol_handle_t Global = nullptr;
+ ASSERT_SUCCESS(olGetGlobalVariable(Program, "global", &Global));
+ ASSERT_ERROR(
+ OL_ERRC_SYMBOL_KIND,
+ olLaunchKernel(Queue, Device, Global, nullptr, 0, &LaunchArgs, nullptr));
+}
+
TEST_P(olLaunchKernelGlobalCtorTest, Success) {
void *Mem;
ASSERT_SUCCESS(olMemAlloc(Device, OL_ALLOC_TYPE_MANAGED,