KhronosGroup / KhronosGroup/OpenCL-Docs

Support for bit-fields in structs

Open
#301 0 comments 0 reactions 0 assignees View on GitHub
agenda OpenCL C Spec themed-agenda
Dominant language
Python
Stars
420
Forks
131
Avg merge
5d 13h
Merged PRs (30d)
11

Description

OpenCL C s6.9 doesn't allow bit-fields in structs due to portability/interoperability issues between host and device caused by data layouts being implementation-defined and therefore hard to handle in applications.

However, it seems that there is no guarantee of the struct layout anyway in OpenCL particularly resulting in inconsistent alignments b/w host and device. Considering this fact, allowing bit-fileds in structs won't introduce a new problem. Could this be relaxed?

Contributor guide

Open the contributing guide

Research direction

The issue cites OpenCL C §6.9; start by reading that specification section and comparing the current struct-layout rules. Determine whether the restriction should change and what interoperability behavior would need to be documented; no repository file or test is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers, documentation
Issue type
Feature
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.