KhronosGroup / KhronosGroup/SYCL-Docs
SYCL header are not "parsable"
- Dominant language
- JavaScript
- Stars
- 158
- Forks
- 80
- Avg merge
- 7d 6h
- Merged PRs (30d)
- 5
Description
So our header is not "parsable" (sorry, I don't know what the correct term is. "give no error when using `-fsyntax-only`" is quite long).
For example, using stream.h (#304 )
```
tapplencourt@jlselogin7:~/Specification/adoc/headers> g++ -fsyntax-only stream.h
stream.h:49:1: error: ‘__precision_manipulator__’ does not name a type
49 | __precision_manipulator__ setprecision(int precision);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
stream.h:51:1: error: ‘__width_manipulator__’ does not name a type
51 | __width_manipulator__ setw(int width);
| ^~~~~~~~~~~~~~~~~~~~~
stream.h:56:16: error: expected ‘)’ before ‘totalBufferSize’
56 | stream(size_t totalBufferSize, size_t workItemBufferSize, handler& cgh,
| ~ ^~~~~~~~~~~~~~~~
| )
stream.h:57:44: error: expected unqualified-id before ‘)’ token
57 | const property_list &propList = {});
| ^
stream.h:63:3: error: ‘size_t’ does not name a type
63 | size_t size() const noexcept;
| ^~~~~~
stream.h:1:1: note: ‘size_t’ is defined in header ‘’; did you forget to ‘#include ’?
+++ |+#include
1 | // Copyright (c) 2011-2021 The Khronos Group, Inc.
stream.h:66:3: error: ‘size_t’ does not name a type
66 | size_t get_size() const;
| ^~~~~~
stream.h:66:3: note: ‘size_t’ is defined in header ‘’; did you forget to ‘#include ’?
stream.h:68:3: error: ‘size_t’ does not name a type
68 | size_t get_work_item_buffer_size() const;
| ^~~~~~
stream.h:68:3: note: ‘size_t’ is defined in header ‘’; did you forget to ‘#include ’?
stream.h:73:3: error: ‘size_t’ does not name a type
73 | size_t get_max_statement_size() const;
| ^~~~~~
stream.h:73:3: note: ‘size_t’ is defined in header ‘’; did you forget to ‘#include ’?
```
I think we may want to fix that. It makes tools that use the header to generate stuff harder to use. For example, at ALCF, we develop a tool that parses header files to generate tracepoints. And the 'header -> ast' transformation fails if not everything is well defined.
PS: `__precision_manipulator__` and `__width_manipulator__` doesn't seem to be defined in the spec or by C++
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with headers/adoc/stream.h and reproduce the reported command, `g++ -fsyntax-only stream.h`, to identify undefined names and missing declarations. Check the other SYCL headers for the same problem; done means the headers can be parsed without syntax-only errors and the reported identifiers are defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100