[llvm] [Offload][L0] Include context allocations in kernel indirect access flags (PR #229384)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 00:33:15 PDT 2026
================
@@ -167,6 +168,32 @@ TEST_P(olLaunchKernelCompositeTest, Success) {
ASSERT_SUCCESS(olMemFree(Context, Mem));
}
+struct Wrapper {
+ uint32_t *Out;
+};
+
+TEST_P(olLaunchKernelByValPtrTest, Success) {
----------------
blazej-smorawski wrote:
I see that L0 example uses a pointer to a structure:
```cpp
struct node {
node* next;
};
node* begin = nullptr;
zeMemAllocHost(hContext, &desc, sizeof(node), 1, &begin);
zeMemAllocHost(hContext, &desc, sizeof(node), 1, &begin->next);
zeMemAllocHost(hContext, &desc, sizeof(node), 1, &begin->next->next);
// 'begin' is passed as kernel argument and appended into command list
zeKernelSetIndirectAccess(hKernel, ZE KERNEL INDIRECT ACCESS FLAG HOST);
zeKernelSetArgumentValue(hKernel, 0, sizeof(node*), &begin);
zeCommandListAppendLaunchKernel(hCommandList, hKernel, &launchArgs, nullptr, 0, nullptr);
zeCommandQueueExecuteCommandLists(hCommandQueue, 1, &hCommandList, nullptr);
...
```
But maybe your test was enough, I'm not sure myself.
https://github.com/llvm/llvm-project/pull/229384
More information about the llvm-commits
mailing list