Skip to content

Commit 0763b21

Browse files
authored
Updates the file headers throughout the repository. (#263)
* Updates the file headers throughout the repository. - Updates the copyright years. - Standardizes the header formats. - Minor fixes to file or module doc strings. - Update contribution guide.
1 parent 1a20082 commit 0763b21

File tree

86 files changed

+659
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+659
-436
lines changed

CONTRIBUTING.md

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,78 @@
1-
# Python code style
1+
# Mechanical Source Issues¶
2+
3+
## Source Code Formatting¶
4+
5+
### Python code style
26

3-
## black
47

58
We use [black](https://black.readthedocs.io/en/stable/) code formatter.
69

710
- Revision: `20.8b1` or branch `stable`.
811
- See configuration in `pyproject.toml`.
912

1013
Run before each commit: `black .`
14+
15+
### C/C++ File Headers
16+
17+
Every C API source file should have a header on it that describes the basic
18+
purpose of the file. The standard header looks like this:
19+
20+
```
21+
//===----- dpctl_sycl_event_interface.h - C API for sycl::event -*-C++-*- ===//
22+
//
23+
// Data Parallel Control (dpCtl)
24+
//
25+
// Copyright 2020-2021 Intel Corporation
26+
//
27+
// Licensed under the Apache License, Version 2.0 (the "License");
28+
// you may not use this file except in compliance with the License.
29+
// You may obtain a copy of the License at
30+
//
31+
// http://www.apache.org/licenses/LICENSE-2.0
32+
//
33+
// Unless required by applicable law or agreed to in writing, software
34+
// distributed under the License is distributed on an "AS IS" BASIS,
35+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36+
// See the License for the specific language governing permissions and
37+
// limitations under the License.
38+
//
39+
//===----------------------------------------------------------------------===//
40+
///
41+
/// \file
42+
/// This header declares a C API to a sub-set of the sycl::event interface.
43+
///
44+
//===----------------------------------------------------------------------===//
45+
```
46+
Few things to note about this format:
47+
- The `-*- C++ -*-` string on the first line is needed to tell Emacs that
48+
the file is a C++ file. The string is only needed for `*.h` headers and
49+
should be omitted for `*.cpp` files. Without the string Emacs assumes that
50+
file is a C header.
51+
- The copyright year should be updated every calendar year.
52+
- Each comment line should be a max of 80 chars.
53+
- A Doxygen `\file` tag describing the contents of the file must be provided.
54+
Also note that the `\file` tag is inside a Doxygen comment block (defined by `///`
55+
comment marker instead of the `//` comment marker used in the rest of the header.
56+
57+
### Python File Headers
58+
59+
Every Python and Cython file should only include the following license header:
60+
61+
```
62+
# Data Parallel Control (dpCtl)
63+
#
64+
# Copyright 2020-2021 Intel Corporation
65+
#
66+
# Licensed under the Apache License, Version 2.0 (the "License");
67+
# you may not use this file except in compliance with the License.
68+
# You may obtain a copy of the License at
69+
#
70+
# http://www.apache.org/licenses/LICENSE-2.0
71+
#
72+
# Unless required by applicable law or agreed to in writing, software
73+
# distributed under the License is distributed on an "AS IS" BASIS,
74+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75+
# See the License for the specific language governing permissions and
76+
# limitations under the License.
77+
```
78+
The copyright year should be updated every calendar year.

dpctl-capi/cmake/modules/FindDPCPP.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Data Parallel Control Library (dpCtl)
1+
# Data Parallel Control (dpCtl)
22
#
3-
# Copyright 2020 Intel Corporation
3+
# Copyright 2020-2021 Intel Corporation
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

dpctl-capi/cmake/modules/FindLcov.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Data Parallel Control Library (dpCtl)
1+
# Data Parallel Control (dpCtl)
22
#
3-
# Copyright 2020 Intel Corporation
3+
# Copyright 2020-2021 Intel Corporation
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

dpctl-capi/cmake/modules/FindLevelZero.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Data Parallel Control Library (dpCtl)
1+
# Data Parallel Control (dpCtl)
22
#
3-
# Copyright 2020 Intel Corporation
3+
# Copyright 2020-2021 Intel Corporation
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

dpctl-capi/helper/include/dpctl_dynamic_lib_helper.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--------------- dpctl_dynamic_lib_helper.h - dpctl-C_API -*-C++-*-===//
1+
//===--- dpctl_dynamic_lib_helper.h - Dynamic library helper -*-C++-*- ===//
22
//
3-
// Data Parallel Control Library (dpCtl)
3+
// Data Parallel Control (dpCtl)
44
//
5-
// Copyright 2020 Intel Corporation
5+
// Copyright 2020-2021 Intel Corporation
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.

dpctl-capi/helper/include/dpctl_utils_helper.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===------------------ dpctl_utils.h - dpctl-C_API ---*--- C++ -----*-----===//
1+
//===-- dpctl_utils.h - Enum to string helper functions -*-C++-*- ===//
22
//
3-
// Data Parallel Control Library (dpCtl)
3+
// Data Parallel Control (dpCtl)
44
//
5-
// Copyright 2020 Intel Corporation
5+
// Copyright 2020-2021 Intel Corporation
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020
///
2121
/// \file
22-
/// This file defines common helper functions used in other places in DPCTL.
22+
/// This file defines common helper functions used in other places in dpCtl.
2323
//===----------------------------------------------------------------------===//
2424

2525
#pragma once

dpctl-capi/helper/source/dpctl_utils_helper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===------ dpctl_utils_helper.cpp - dpctl-C_API ----*---- C++ -----*-----===//
1+
//===- dpctl_utils_helper.cpp - Implementation of enum to string helpers ===//
22
//
3-
// Data Parallel Control Library (dpCtl)
3+
// Data Parallel Control (dpCtl)
44
//
5-
// Copyright 2020 Intel Corporation
5+
// Copyright 2020-2021 Intel Corporation
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.

dpctl-capi/include/Config/dpctl_config.h.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===---- dpctl-capi/Config/dpCtl-config.h - dpctl-C API -------*- C++ -*-===//
1+
//===--------- dpctl_config.h - Configured options for dpCtl C API ===//
22
//
3-
// Data Parallel Control Library (dpCtl)
3+
// Data Parallel Control (dpCtl)
44
//
5-
// Copyright 2020 Intel Corporation
5+
// Copyright 2020-2021 Intel Corporation
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.

dpctl-capi/include/Support/CBindingWrapping.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===---- Support/CBindingWrapping.h - DPCTL-SYCL interface --*-- C ---*---===//
1+
//===- CBindingWrapping.h - Wrappers for casting C pointers -*-C++-*- ===//
22
//
3-
// Data Parallel Control Library (dpCtl)
3+
// Data Parallel Control (dpCtl)
44
//
5-
// Copyright 2020 Intel Corporation
5+
// Copyright 2020-2021 Intel Corporation
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020
///
2121
/// \file
22-
/// This file declares the wrapping macros for the DPCTL C interface.
22+
/// This file declares the wrapping macros for the dpCtl C interface.
2323
///
2424
//===----------------------------------------------------------------------===//
2525

dpctl-capi/include/Support/DllExport.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--------- Support/DllExport.h - DPCTL-SYCL interface ---*--- C ---*---===//
1+
//===--------- DllExport.h - Decalres dllexport for Windows -*-C++-*- ===//
22
//
3-
// Data Parallel Control Library (dpCtl)
3+
// Data Parallel Control (dpCtl)
44
//
5-
// Copyright 2020 Intel Corporation
5+
// Copyright 2020-2021 Intel Corporation
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)