Skip to content

Commit 9dd222b

Browse files
committed
Rename to olLaunchHostFunction
1 parent 57d8254 commit 9dd222b

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

offload/liboffload/API/Queue.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,26 +110,26 @@ def : Function {
110110
}
111111

112112
def : FptrTypedef {
113-
let name = "ol_queue_callback_cb_t";
114-
let desc = "Callback function for use by `olEnqueueHostCallback`.";
113+
let name = "ol_host_function_cb_t";
114+
let desc = "Host function for use by `olLaunchHostFunction`.";
115115
let params = [
116-
Param<"void *", "UserData", "user specified data passed into `olEnqueueHostCallback`.", PARAM_IN>,
116+
Param<"void *", "UserData", "user specified data passed into `olLaunchHostFunction`.", PARAM_IN>,
117117
];
118118
let return = "void";
119119
}
120120

121121
def : Function {
122-
let name = "olEnqueueHostCallback";
122+
let name = "olLaunchHostFunction";
123123
let desc = "Enqueue a callback function on the host.";
124124
let details = [
125-
"The provided function will be called from the same process as the one that called `olEnqueueHostCallback`.",
125+
"The provided function will be called from the same process as the one that called `olLaunchHostFunction`.",
126126
"The callback will not run until all previous work submitted to the queue has completed.",
127127
"The callback must return before any work submitted to the queue after it is started.",
128128
"The callback must not call any liboffload API functions or any backend specific functions (such as Cuda or HSA library functions).",
129129
];
130130
let params = [
131131
Param<"ol_queue_handle_t", "Queue", "handle of the queue", PARAM_IN>,
132-
Param<"ol_queue_callback_cb_t", "Callback", "the callback function to call on the host", PARAM_IN>,
132+
Param<"ol_host_function_cb_t", "Callback", "the callback function to call on the host", PARAM_IN>,
133133
Param<"void *", "UserData", "a pointer that will be passed verbatim to the callback function", PARAM_IN_OPTIONAL>,
134134
];
135135
let returns = [];

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,9 +833,9 @@ Error olGetSymbolInfoSize_impl(ol_symbol_handle_t Symbol,
833833
return olGetSymbolInfoImplDetail(Symbol, PropName, 0, nullptr, PropSizeRet);
834834
}
835835

836-
Error olEnqueueHostCallback_impl(ol_queue_handle_t Queue,
837-
ol_queue_callback_cb_t Callback,
838-
void *UserData) {
836+
Error olLaunchHostFunction_impl(ol_queue_handle_t Queue,
837+
ol_host_function_cb_t Callback,
838+
void *UserData) {
839839
return Queue->Device->Device->enqueueHostCallback(Callback, UserData,
840840
Queue->AsyncInfo);
841841
}

offload/unittests/OffloadAPI/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ add_offload_unittest("queue"
4242
queue/olGetQueueInfo.cpp
4343
queue/olGetQueueInfoSize.cpp
4444
queue/olWaitEvents.cpp
45-
queue/olEnqueueHostCallback.cpp)
45+
queue/olLaunchHostFunction.cpp)
4646

4747
add_offload_unittest("symbol"
4848
symbol/olGetSymbol.cpp

offload/unittests/OffloadAPI/queue/olEnqueueHostCallback.cpp renamed to offload/unittests/OffloadAPI/queue/olLaunchHostFunction.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===------- Offload API tests - olEnqueueHostCallback --------------------===//
1+
//===------- Offload API tests - olLaunchHostFunction ---------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -11,21 +11,21 @@
1111
#include <gtest/gtest.h>
1212
#include <thread>
1313

14-
struct olEnqueueHostCallbackTest : OffloadQueueTest {};
15-
OFFLOAD_TESTS_INSTANTIATE_DEVICE_FIXTURE(olEnqueueHostCallbackTest);
14+
struct olLaunchHostFunctionTest : OffloadQueueTest {};
15+
OFFLOAD_TESTS_INSTANTIATE_DEVICE_FIXTURE(olLaunchHostFunctionTest);
1616

17-
struct olEnqueueHostCallbackKernelTest : OffloadKernelTest {};
18-
OFFLOAD_TESTS_INSTANTIATE_DEVICE_FIXTURE(olEnqueueHostCallbackKernelTest);
17+
struct olLaunchHostFunctionKernelTest : OffloadKernelTest {};
18+
OFFLOAD_TESTS_INSTANTIATE_DEVICE_FIXTURE(olLaunchHostFunctionKernelTest);
1919

20-
TEST_P(olEnqueueHostCallbackTest, Success) {
21-
ASSERT_SUCCESS(olEnqueueHostCallback(Queue, [](void *) {}, nullptr));
20+
TEST_P(olLaunchHostFunctionTest, Success) {
21+
ASSERT_SUCCESS(olLaunchHostFunction(Queue, [](void *) {}, nullptr));
2222
}
2323

24-
TEST_P(olEnqueueHostCallbackTest, SuccessSequence) {
24+
TEST_P(olLaunchHostFunctionTest, SuccessSequence) {
2525
uint32_t Buff[16] = {1, 1};
2626

2727
for (auto BuffPtr = &Buff[2]; BuffPtr != &Buff[16]; BuffPtr++) {
28-
ASSERT_SUCCESS(olEnqueueHostCallback(
28+
ASSERT_SUCCESS(olLaunchHostFunction(
2929
Queue,
3030
[](void *BuffPtr) {
3131
uint32_t *AsU32 = reinterpret_cast<uint32_t *>(BuffPtr);
@@ -41,7 +41,7 @@ TEST_P(olEnqueueHostCallbackTest, SuccessSequence) {
4141
}
4242
}
4343

44-
TEST_P(olEnqueueHostCallbackKernelTest, SuccessBlocking) {
44+
TEST_P(olLaunchHostFunctionKernelTest, SuccessBlocking) {
4545
// Verify that a host kernel can block execution - A host task is created that
4646
// only resolves when Block is set to false.
4747
ol_kernel_launch_size_args_t LaunchArgs;
@@ -63,7 +63,7 @@ TEST_P(olEnqueueHostCallbackKernelTest, SuccessBlocking) {
6363
}
6464

6565
volatile bool Block = true;
66-
ASSERT_SUCCESS(olEnqueueHostCallback(
66+
ASSERT_SUCCESS(olLaunchHostFunction(
6767
Queue,
6868
[](void *Ptr) {
6969
volatile bool *Block =
@@ -95,12 +95,12 @@ TEST_P(olEnqueueHostCallbackKernelTest, SuccessBlocking) {
9595
ASSERT_SUCCESS(olMemFree(Mem));
9696
}
9797

98-
TEST_P(olEnqueueHostCallbackTest, InvalidNullCallback) {
98+
TEST_P(olLaunchHostFunctionTest, InvalidNullCallback) {
9999
ASSERT_ERROR(OL_ERRC_INVALID_NULL_POINTER,
100-
olEnqueueHostCallback(Queue, nullptr, nullptr));
100+
olLaunchHostFunction(Queue, nullptr, nullptr));
101101
}
102102

103-
TEST_P(olEnqueueHostCallbackTest, InvalidNullQueue) {
103+
TEST_P(olLaunchHostFunctionTest, InvalidNullQueue) {
104104
ASSERT_ERROR(OL_ERRC_INVALID_NULL_HANDLE,
105-
olEnqueueHostCallback(nullptr, [](void *) {}, nullptr));
105+
olLaunchHostFunction(nullptr, [](void *) {}, nullptr));
106106
}

0 commit comments

Comments
 (0)