[llvm] [libsycl] USM Aligned allocation functions (PR #213468)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 13:00:33 PDT 2026


================
@@ -103,14 +153,38 @@ void *malloc(std::size_t numBytes, const device &syclDevice,
 
   void *Ptr{};
   auto OLDevice = detail::getSyclObjImpl(syclDevice)->getOLHandle();
-  auto Result =
-      kind == usm::alloc::host
-          ? detail::callNoCheck(olMemAllocHost, OLDevice, numBytes, &Ptr)
-          : detail::callNoCheck(olMemAlloc, OLDevice,
-                                detail::getOlAllocType(kind), numBytes, &Ptr);
+
+  ol_result_t Result;
----------------
Robertkq wrote:

Weirdly enough, it's actually a pointer to struct:
```cpp
/// @brief Result type returned by all entry points.
typedef const struct ol_error_struct_t* ol_result_t;
```
I'l add the `{}` as that will still be an explicit default initialization of it

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


More information about the llvm-commits mailing list