Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# SPDX-FileCopyrightText: 2020 CERN
# SPDX-License-Identifier: Apache-2.0
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
# This would be nice to have but seems to also (mis)align function parameters
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IndentCaseLabels: false
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60000
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 2
UseTab: Never
...

35 changes: 35 additions & 0 deletions .github/workflows/clang-format-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-FileCopyrightText: 2025 CERN for the benefit of the AdePT project
# SPDX-License-Identifier: CC-BY-4.0

name: Clang-Format Check

on: [pull_request, push]

jobs:
clang-format-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

# 1) Add the official LLVM repository for clang-format, the highest available version for ubuntu-22 is clang 19
- name: Add LLVM apt repo (Clang 19)
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main"
sudo apt-get update

# 2) Install latest version
- name: Install clang-format
run: |
sudo apt-get install -y clang-format-19
clang-format-19 --version

# 3) Check formatting
- name: Check formatting
run: |
# Specify file extensions to be checked
FILES=$(git ls-files '*.cpp' '*.h' '*.cu' '*.cuh' '*.hh' '*.cc' '*.icc')

# '-n' checks if files need reformatting
# '--Werror' throws an error if formatting is incorrect
clang-format-19 -style=file -n --Werror $FILES
14 changes: 14 additions & 0 deletions .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: 2017-2019 Free Software Foundation Europe e.V.
# SPDX-License-Identifier: GPL-3.0-or-later

name: REUSE Compliance Check

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
30 changes: 30 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: 2025 CERN for the benefit of the AdePT project
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.25)

project(AdePTExamples
VERSION 0.1.0
LANGUAGES CXX CUDA)

# Options for later when you start adding examples
option(ADEPT_EXAMPLES_BUILD_TESTS "Build tests for AdePT examples" ON)
option(ADEPT_EXAMPLES_ENABLE_CUDA "Enable CUDA builds (required for most AdePT examples)" ON)

# Find AdePT (and, transitively, VecGeom / VecCore / G4HepEm)
#
# You typically provide CMAKE_PREFIX_PATH so that CMake can locate AdePT’s config.
# e.g.:
# cmake -S. -Bbuild \
# -DCMAKE_PREFIX_PATH="<path_to_AdePT_installation>;<other_deps>"
#
find_package(AdePT REQUIRED)

message(STATUS "Found AdePT include dirs: ${AdePT_INCLUDE_DIRS}")
message(STATUS "Found AdePT libraries : ${AdePT_LIBRARIES}")

# Later: add actual examples under examples/
add_subdirectory(examples)

# Optionally, you can expose a meta-target for all examples once they exist
# add_custom_target(adept_examples_all DEPENDS <example-targets-go-here>)
110 changes: 110 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!--
SPDX-FileCopyrightText: 2025 CERN for the benefit of the AdePT project
SPDX-License-Identifier: CC-BY-4.0
-->

# Code Of Conduct

The AdePT project observes [CERN's Code of Conduct](https://cern.ch/codeofconduct).
Below is a plain text summary of the [official PDF](https://cds.cern.ch/record/2240689/files/BrochureCodeofConductEN.pdf?)
as of 1. April 2020. Please consult the [PDF](https://cds.cern.ch/record/2240689/files/BrochureCodeofConductEN.pdf?)
for up-to-date information.

## USING THE CODE OF CONDUCT

We encourage a culture of openness where all contributors feel free to engage in a discussion about the Code of Conduct.

If you are unsure about any aspect of the Code of Conduct, there are a number of resources you may wish to access, including your hierarchy, the Human Resources Department, the Ombud Office or the Internal Audit.

In addition, to increase understanding of how the Code of Conduct applies to practical situations, you are encouraged to consult the Code of Conduct online FAQ’s, accessible at cern.ch/codeofconduct. This website will be updated on a regular basis.

## INTRODUCTION BY THE DIRECTOR-GENERAL

What we do in our working lives is important, and the way we do it is equally so. This is particularly true with the diverse community we have at CERN. People from all over the world come here, bringing with them different cultures and different ways of working. This diversity is part of our strength, and it’s something that we need to nurture constantly. That’s why CERN has developed a Code of Conduct that is built on a set of core CERN values, defined following broad consultation by the HR Department across the Organization in order to determine the values that underline the spirit of CERN.

Those values are integrity, commitment, professionalism, creativity and diversity. Taken together, they provide the basis for respect: respect for others, respect for the Organization and respect for its mission.

The Code of Conduct is the blueprint for how we work together. It was launched in 2010, accompanied by an Ombud Office to provide an informal route to the resolution of potential conflicts, and to serve as an interpreter of the Code of Conduct if and when necessary. I think it is fair to say that since then CERN’s values have become a natural and inherent part of the Organisation’s working landscape.

There have been occasions where people have had to be reminded of the Code’s stipulations, but these have been rare. Rather than a tool for the Organization to use as a stick, the Code is a tool for all of us to use as a guide.

Our Code of Conduct sets out in black and white the basic standards and rules of behaviour that we can expect to find in the workplace, and it provides guidance on how our actions may influence and support the good reputation of CERN. It is there to ensure that we pursue our mission of research, innovation, training and collaboration while respecting the highest ethical standards of behaviour.

It is not an exhaustive list of dos and don’ts. Rather, it is a practical guide, assisting us in understanding the consequences of how we treat others, how can we expect to be treated in the workplace, and how we should behave as ambassadors for CERN and for particle physics. It serves to help us maintain and develop a workplace marked by mutual respect.

Nurturing respect generates self-respect, and a respectful workplace is one where everyone can give their best in a supportive, collaborative, and pleasant environment.

**Fabiola Gianotti**, Director-General

## INTEGRITY
BEHAVING ETHICALLY, WITH INTELLECTUAL HONESTY AND BEING ACCOUNTABLE FOR ONE’S OWN ACTIONS.

A high standard of integrity in the performance of our work and in our relationships with others promotes a culture of trust and responsibility.

### AS CERN CONTRIBUTORS, WE:

- Exercise our authority responsibly. In particular, we abstain from using our authority or position to obtain personal benefits or favours.
- Demonstrate fairness and impartiality.
- Ensure that we credit others for their contribution.
- Avoid conflict of interest or situations that could be perceived as such.
- Refrain from any act or omission designed to deceive others, or to achieve a gain resulting in a loss of funds or reputation for CERN.
- Safeguard confidential information, documents or data, and ensure that such material in our possession is properly protected.
- Respect the privacy of others and protect personal information given to us in confidence.

## COMMITMENT
DEMONSTRATING A HIGH LEVEL OF MOTIVATION AND DEDICATION TO THE ORGANIZATION

Our collective commitment to CERN is essential both to the achievement of its mission and the protection of its reputation.

### AS CERN CONTRIBUTORS, WE:
- Promote the CERN mission and act in accordance with CERN values.
- Appreciate that our behaviour, both on site and outside CERN, may reflect upon CERN.
- Protect the reputation of CERN and our colleagues in communications with internal and external parties.
- Familiarize ourselves with all applicable rules and regulations.
- Promote and maintain a safe and healthy environment, following relevant safety rules.
- Educate ourselves on the responsibilities which accompany the privileges and immunities which may be granted to us for the benefit of CERN.
- Demonstrate flexibility and adapt to CERN’s evolving needs.

## PROFESSIONALISM
PRODUCING A HIGH LEVEL OF RESULTS WITHIN RESOURCE AND TIME CONSTRAINTS AND FOSTERING MUTUAL UNDERSTANDING

Our ability to deliver and to create a positive work environment permits us to achieve high professional standards, individually and collectively.

### AS CERN CONTRIBUTORS, WE:

- Define clear and realistic objectives and deliverables for our activities, and communicate them to our colleagues.
- Ensure that the human, material and financial resources entrusted to us are used optimally for the benefit of CERN.
- Invest in CERN’s future by taking long-term effectiveness into account when managing short and medium-term activities.
- Maintain a professional environment characterized by good working relations and an atmosphere of tolerance and mutual respect.
- Provide advice and guidance to colleagues, where appropriate, and exercise adequate supervision and control over tasks that we delegate.
- Address conflict proactively and impartially.
- Abstain from and actively discourage all forms of harassment as well as verbal, non-verbal, written or physical abuse.

## CREATIVITY
BEING AT THE FOREFRONT OF ONE’S PROFESSIONAL FIELD, FURTHERING INNOVATION AND ORGANIZATIONAL DEVELOPMENT

CERN encourages continuous learning and development and values innovation as well as a proactive approach to acquiring and sharing information.

### AS CERN CONTRIBUTORS, WE:
- Follow developments within our domain.
- Use our professional experience in a constructive manner.
- Contribute to the evolution of CERN by committing to sharing our knowledge.
- Share with internal parties any information that could benefit them in their work.
- Are open to new ideas and approaches.
- Adopt alternative outlooks in order to generate new thoughts and concepts.
- Conduct our work in a structured way to enhance knowledge transfer and continuity.

## DIVERSITY
APPRECIATING DIFFERENCES, FOSTERING EQUALITY, AND PROMOTING COLLABORATION

CERN’s excellence derives from an environment in which the knowledge and perspectives of a diverse workforce are valued and dialogue is encouraged at all levels.

### AS CERN CONTRIBUTORS, WE:
- Respect and value differences.
- Promote inclusiveness in the workplace in terms of both personal characteristics and professional abilities.
- Demonstrate team spirit and invest in team building.
- Treat others with tact, courtesy and respect.
- Abstain from and actively discourage discrimination in all forms.
- Avoid offending others by exercising restraint, and are aware that statements or actions not intended to be offensive to another person may be perceived as such.
- Refrain from unpleasant or disparaging remarks or actions, in particular on the basis of sex, age, religion, beliefs, nationality, culture, ethnicity, race, sexual orientation, status at CERN, disability, or family situation.

Loading