Skip to content

Commit 7616417

Browse files
committed
Add missing docs
1 parent b7d14be commit 7616417

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

offload/liboffload/API/Device.td

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def : Enum {
3636

3737
def : FptrTypedef {
3838
let name = "ol_device_iterate_cb_t";
39-
let desc = "User-provided function called for each available device.";
39+
let desc = "User-provided function to be used with `olIterateDevices`";
4040
let params = [
4141
Param<"ol_device_handle_t", "Device", "the device handle of the current iteration", PARAM_IN>,
4242
Param<"void*", "UserData", "optional user data", PARAM_IN_OPTIONAL>
@@ -46,12 +46,17 @@ def : FptrTypedef {
4646

4747
def : Function {
4848
let name = "olIterateDevices";
49-
let desc = "";
49+
let desc = "Iterates over all available devices, calling the callback for each device.";
50+
let details = [
51+
"If the user-provided callback returns `false`, the iteration is stopped."
52+
];
5053
let params = [
5154
Param<"ol_device_iterate_cb_t", "Callback", "User-provided function called for each available device", PARAM_IN>,
5255
Param<"void*", "UserData", "Optional user data to pass to the callback", PARAM_IN_OPTIONAL>
5356
];
54-
let returns = [];
57+
let returns = [
58+
Return<"OL_ERRC_INVALID_DEVICE">
59+
];
5560
}
5661

5762
def : Function {

offload/liboffload/API/Memory.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def : Function {
4949
let name = "olMemcpy";
5050
let desc = "Enqueue a memcpy operation.";
5151
let details = [
52-
"For host pointers, use the device returned by olGetHostDevice",
52+
"For host pointers, use the host device belonging to the OL_PLATFORM_BACKEND_HOST platform.",
5353
"If a queue is specified, at least one device must be a non-host device",
5454
"If a queue is not specified, the memcpy happens synchronously"
5555
];

offload/liboffload/include/generated/OffloadAPI.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,22 +333,26 @@ typedef enum ol_device_info_t {
333333
} ol_device_info_t;
334334

335335
///////////////////////////////////////////////////////////////////////////////
336-
/// @brief User-provided function called for each available device.
336+
/// @brief User-provided function to be used with `olIterateDevices`
337337
typedef bool (*ol_device_iterate_cb_t)(
338338
// the device handle of the current iteration
339339
ol_device_handle_t Device,
340340
// optional user data
341341
void *UserData);
342342

343343
///////////////////////////////////////////////////////////////////////////////
344-
/// @brief
344+
/// @brief Iterates over all available devices, calling the callback for each
345+
/// device.
345346
///
346347
/// @details
348+
/// - If the user-provided callback returns `false`, the iteration is
349+
/// stopped.
347350
///
348351
/// @returns
349352
/// - ::OL_RESULT_SUCCESS
350353
/// - ::OL_ERRC_UNINITIALIZED
351354
/// - ::OL_ERRC_DEVICE_LOST
355+
/// - ::OL_ERRC_INVALID_DEVICE
352356
/// - ::OL_ERRC_INVALID_NULL_HANDLE
353357
/// - ::OL_ERRC_INVALID_NULL_POINTER
354358
OL_APIEXPORT ol_result_t OL_APICALL olIterateDevices(

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,6 @@ ol_impl_result_t olIterateDevices_impl(ol_device_iterate_cb_t Callback,
291291
return OL_SUCCESS;
292292
}
293293

294-
ol_impl_result_t olGetHostDevice_impl(ol_device_handle_t *Device) {
295-
*Device = HostDevice();
296-
return OL_SUCCESS;
297-
}
298-
299294
TargetAllocTy convertOlToPluginAllocTy(ol_alloc_type_t Type) {
300295
switch (Type) {
301296
case OL_ALLOC_TYPE_DEVICE:

offload/unittests/OffloadAPI/program/olDestroyProgram.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===------- Offload API tests - olReleaseProgram -------------------------===//
1+
//===------- Offload API tests - olDestroyProgram -------------------------===//
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.

0 commit comments

Comments
 (0)