[llvm] [Offload] Implement the remaining initial Offload API (PR #122106)
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 19 08:06:25 PST 2025
================
@@ -460,6 +474,524 @@ OL_APIEXPORT ol_result_t OL_APICALL olGetDeviceInfoSize(
// [out] pointer to the number of bytes required to store the query
size_t *PropSizeRet);
+///////////////////////////////////////////////////////////////////////////////
+/// @brief Return the special host device used to represent the host in memory
+/// transfer operations
+///
+/// @details
+/// - The host device does not support queues
+///
+/// @returns
+/// - ::OL_RESULT_SUCCESS
+/// - ::OL_ERRC_UNINITIALIZED
+/// - ::OL_ERRC_DEVICE_LOST
+/// - ::OL_ERRC_INVALID_NULL_HANDLE
+/// - ::OL_ERRC_INVALID_NULL_POINTER
+/// + `NULL == Device`
+OL_APIEXPORT ol_result_t OL_APICALL olGetHostDevice(
+ // Output pointer for the device
+ ol_device_handle_t *Device);
+
+///////////////////////////////////////////////////////////////////////////////
+/// @brief Represents the type of allocation made with olMemAlloc
+typedef enum ol_alloc_type_t {
+ /// Host allocation
+ OL_ALLOC_TYPE_HOST = 0,
+ /// Device allocation
+ OL_ALLOC_TYPE_DEVICE = 1,
+ /// Shared allocation
+ OL_ALLOC_TYPE_SHARED = 2,
+ /// @cond
+ OL_ALLOC_TYPE_FORCE_UINT32 = 0x7fffffff
+ /// @endcond
+
+} ol_alloc_type_t;
+
+///////////////////////////////////////////////////////////////////////////////
+/// @brief Creates a memory allocation on the specified device
----------------
jdoerfert wrote:
These should end in a full stop. Others too.
https://github.com/llvm/llvm-project/pull/122106
More information about the llvm-commits
mailing list