KhronosGroup / KhronosGroup/OpenCL-Docs

Layout of structures used as kernel arguments

Open
#1,064 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
420
Forks
131
Avg merge
5d 13h
Merged PRs (30d)
11

Description

The OpenCL specification does not currently define how structures used as kernel arguments have to be laid out in memory. Most applications that make use of structures as kernel arguments rely on their layout being identical on the host and device, which nothing guarantees. These applications work "by accident".

Other APIs, such as Vulkan, require interface structures be explicitly laid out using decorations in SPIR-V modules.

How should OpenCL solve this issue? At the bare minimum we should add a warning to the spec.

Contributor guide

Open the contributing guide

Research direction

Start by reading the OpenCL specification sections covering kernel arguments and structure layout, then compare the issue's concern with Vulkan's SPIR-V interface-layout requirements. This is a design discussion rather than a localized edit; done requires an agreed specification change or an explicit warning addressing host/device structure layout.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.