oneapi-src / oneapi-src/oneAPI-samples
identifier "cl_bitfield" is undefined
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 1.2k
- 派生
- 745
- PR 合并指标
- 30 天内没有已合并 PR
描述
Summary
I got the above error when I tried to compile "vector-add-buffers.cpp" from the openmp-samples.
Version
2026.1
Environment
Windows
Steps to reproduce
Produce a Visual Studio solution with the supplied CMakeLists.txt of VectorAdd, and try to compile (inside Visual Studio).
Observed behavior
A lot of lines of the type: "identifier "cl_bitfield" is undefined" in cl.h. The first undefined is at cl.h line no. 48.
This is puzzling because cl.h contains the following lines:
40 typedef cl_ulong cl_bitfield;
typedef cl_ulong cl_properties;
typedef cl_bitfield cl_device_type;
typedef cl_uint cl_platform_info;
typedef cl_uint cl_device_info;
typedef cl_bitfield cl_device_fp_config;
typedef cl_uint cl_device_mem_cache_type;
typedef cl_uint cl_device_local_mem_type;
48 typedef cl_bitfield cl_device_exec_capabilities;
That is, "cl_bitfield" is defined before it is used.
Expected behavior
Document behavior you expect.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
通过根据提供的 CMakeLists.txt 生成 VectorAdd Visual Studio 解决方案并在 Windows 上编译 vector-add-buffers.cpp,重现该失败。然后检查第 40–48 行附近的 cl.h 以及 include 设置,以确定为什么 cl_bitfield 被报告为未定义。示例能够在没有这些标识符错误的情况下编译,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cmake, cpp
- 领域
- build-system
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 需要澄清
- 新手友好度
- 45/100