[llvm] [Offload] `olEnqueueHostCallback` (PR #152482)

Callum Fare via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 7 05:17:44 PDT 2025


================
@@ -0,0 +1,48 @@
+//===------- Offload API tests - olEnqueueHostCallback --------------------===//
+//
+// Part of the LLVM Project, 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "../common/Fixtures.hpp"
+#include <OffloadAPI.h>
+#include <gtest/gtest.h>
+
+struct olEnqueueHostCallbackTest : OffloadQueueTest {};
+OFFLOAD_TESTS_INSTANTIATE_DEVICE_FIXTURE(olEnqueueHostCallbackTest);
+
+TEST_P(olEnqueueHostCallbackTest, Success) {
+  ASSERT_SUCCESS(olEnqueueHostCallback(Queue, [](void *) {}, nullptr));
+}
+
+TEST_P(olEnqueueHostCallbackTest, SuccessSequence) {
----------------
callumfare wrote:

Would it be possible to add a test that depends on another queue operation (e.g. a kernel or even a write to host/shared memory) to ensure the host function actually executes at the correct point in the queue?

https://github.com/llvm/llvm-project/pull/152482


More information about the llvm-commits mailing list