2026-07-17 10:56:59 -08:00
|
|
|
# Libsycl Coding Standards
|
2026-01-15 00:39:45 -09:00
|
|
|
|
2026-07-17 10:56:59 -08:00
|
|
|
:::{contents}
|
|
|
|
|
:local: true
|
|
|
|
|
:::
|
2026-01-15 00:39:45 -09:00
|
|
|
|
2026-07-17 10:56:59 -08:00
|
|
|
## Introduction
|
2026-01-15 00:39:45 -09:00
|
|
|
|
2026-07-17 10:56:59 -08:00
|
|
|
The `libsycl` project follows the
|
|
|
|
|
[LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html) with
|
2026-01-15 00:39:45 -09:00
|
|
|
exceptions as described in this document.
|
|
|
|
|
|
2026-07-17 10:56:59 -08:00
|
|
|
### Naming
|
2026-01-15 00:39:45 -09:00
|
|
|
|
2026-07-17 10:56:59 -08:00
|
|
|
#### Names of Macros, Types, Functions, Variables, and Enumerators
|
2026-01-15 00:39:45 -09:00
|
|
|
|
|
|
|
|
Entities specified by the SYCL specification are named as required by the SYCL
|
|
|
|
|
specification. Names of all other entities follow the guidance in the LLVM
|
|
|
|
|
Coding Standards.
|
|
|
|
|
|
2026-07-17 10:56:59 -08:00
|
|
|
#### Names of Files and Directories
|
2026-01-15 00:39:45 -09:00
|
|
|
|
2026-07-17 10:56:59 -08:00
|
|
|
- **Directory Names** should be in snake case (e.g. `test_e2e`) except in
|
2026-01-15 00:39:45 -09:00
|
|
|
cases where LLVM project wide conventions are used. For example, LIT tests
|
2026-07-17 10:56:59 -08:00
|
|
|
often use an `Inputs` directory to hold files that are used by tests but
|
2026-01-15 00:39:45 -09:00
|
|
|
that should be excluded from test discovery.
|
2026-07-17 10:56:59 -08:00
|
|
|
- **File Names in snake case** should be used for all C++ implementation files.
|
|
|
|
|
For example files in directories `include`, `src`, `test`, `utils`,
|
|
|
|
|
and `tools` should be named in snake case.
|
|
|
|
|
- **File Names in camel case** should be used for most other files. For example
|
|
|
|
|
files in directories `cmake/modules` and `docs` should be named in camel
|
2026-01-15 00:39:45 -09:00
|
|
|
case.
|
2026-07-17 10:56:59 -08:00
|
|
|
|