diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..f6ac48d1 --- /dev/null +++ b/.clang-format @@ -0,0 +1,134 @@ +--- +Language: Cpp +BasedOnStyle: LLVM +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: false +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Right +AlignOperands: true +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DeriveLineEnding: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + SortPriority: 0 + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + SortPriority: 0 + - Regex: '.*' + Priority: 1 + SortPriority: 0 +IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' +IndentCaseLabels: false +IndentGotoLabels: true +IndentPPDirectives: None +IndentWidth: 2 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Right +ReflowComments: true +SortIncludes: true +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpaceBeforeSquareBrackets: false +Standard: Latest +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 8 +UseCRLF: false +UseTab: Never diff --git a/CMakeLists.txt b/CMakeLists.txt index 933329fa..2293fa9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,34 +13,14 @@ set(CMAKE_CXX_EXTENSIONS NO) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER) -if(BUILD_TYPE_UPPER STREQUAL "DEBUG") - set(CMAKE_CXX_FLAGS_DEBUG_INIT - "-gdwarf-4" - CACHE STRING "Flags used by the compiler during debug builds" FORCE) - set(CMAKE_C_FLAGS_DEBUG_INIT - "-gdwarf-4" - CACHE STRING "Flags used by the compiler during debug builds" FORCE) - set(CMAKE_CUDA_FLAGS_DEBUG_INIT - "-gdwarf-4" - CACHE STRING "Flags used by the compiler during debug builds" FORCE) - message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG_INIT}") - message(STATUS "CMAKE_C_FLAGS_DEBUG: ${CMAKE_C_FLAGS_DEBUG_INIT}") - message(STATUS "CMAKE_CUDA_FLAGS_DEBUG: ${CMAKE_CUDA_FLAGS_DEBUG_INIT}") - add_compile_options("-gdwarf-4") -elseif(BUILD_TYPE_UPPER STREQUAL "RELWITHDEBINFO") - set(CMAKE_CXX_FLAGS_DEBUG_INIT - "-gdwarf-4" - CACHE STRING "Flags used by the compiler during debug builds" FORCE) - set(CMAKE_C_FLAGS_DEBUG_INIT - "-gdwarf-4" - CACHE STRING "Flags used by the compiler during debug builds" FORCE) - set(CMAKE_CUDA_FLAGS_DEBUG_INIT - "-gdwarf-4" - CACHE STRING "Flags used by the compiler during debug builds" FORCE) - message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG_INIT}") - message(STATUS "CMAKE_C_FLAGS_DEBUG: ${CMAKE_C_FLAGS_DEBUG_INIT}") - message(STATUS "CMAKE_CUDA_FLAGS_DEBUG: ${CMAKE_CUDA_FLAGS_DEBUG_INIT}") +if(BUILD_TYPE_UPPER STREQUAL "DEBUG" OR BUILD_TYPE_UPPER STREQUAL + "RELWITHDEBINFO") add_compile_options("-gdwarf-4") + foreach(lang CXX C CUDA) + set(CMAKE_${lang}_FLAGS_${BUILD_TYPE_UPPER}_INIT + "-gdwarf-4" + CACHE STRING "Flags used by the compiler during debug builds" FORCE) + endforeach() endif() option(MNEME_ENABLE_CUDA "Enable CUDA" OFF) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..9642304f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,39 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and leaders pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..4cc4c58d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Contributing to Mneme + +Thank you for your interest in contributing to Mneme! We welcome contributions of all forms, including bug fixes, new features, documentation improvements, and performance enhancements. + +## Development Workflow + +1. **Fork and Clone**: Fork the repository and clone it locally. +2. **Branch**: Create a feature branch from `develop`. + ```bash + git checkout -b feature/my-new-feature develop + ``` +3. **Implement**: Write your code, adhering to the project's coding style. +4. **Test**: Ensure your changes pass existing tests and add new tests where appropriate. + - C++ Tests: Built with CMake (Enable `-DMNEME_ENABLE_TESTS=On`). + - Python Tests: Run via `pytest`. +5. **Commit**: Use descriptive commit messages. +6. **Push and PR**: Push your branch and open a Pull Request against `develop`. + +## Coding Style + +### C++ +We follow the LLVM coding style with slight modifications. +- Use **clang-format** to format your code before submitting. A `.clang-format` file is provided in the root directory. +- Indentation: 2 spaces. +- Headers: Use include guards or `#pragma once`. + +### Python +- Use **Black** for formatting. +- Use **Isort** for import sorting. +- Type hints are encouraged for public APIs. +- Configuration is available in `pyproject.toml`. + +## Reporting Issues + +Please search existing issues before reporting a new one. When opening an issue, provide: +- Mneme version / Commit hash. +- System information (OS, GPU, Driver version). +- Reproduction steps or a minimal example. diff --git a/cmake/MnemeFunctions.cmake b/cmake/MnemeFunctions.cmake index 90ef60d1..7a3768da 100644 --- a/cmake/MnemeFunctions.cmake +++ b/cmake/MnemeFunctions.cmake @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + function(add_mneme target) # Link proteus as a shared library for preloading. # TODO: Change to static linking and use linker wrapper flags for interposing. diff --git a/cmake/SetupLLVM.cmake b/cmake/SetupLLVM.cmake index 397b49d8..02c1a384 100644 --- a/cmake/SetupLLVM.cmake +++ b/cmake/SetupLLVM.cmake @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + # Add the location of LLVMConfig.cmake to CMake search paths (so that # find_package can locate it) diff --git a/include/mneme/DeviceTraits.hpp b/include/mneme/DeviceTraits.hpp index f6f5227c..56a4ed9b 100644 --- a/include/mneme/DeviceTraits.hpp +++ b/include/mneme/DeviceTraits.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #pragma once #include #include diff --git a/include/mneme/MnemeInternal.hpp b/include/mneme/MnemeInternal.hpp index ef5f5e58..7c7e6fe0 100644 --- a/include/mneme/MnemeInternal.hpp +++ b/include/mneme/MnemeInternal.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #ifdef MNEME_ENABLE_HIP #include "mneme/MnemeRecordHIP.hpp" using MnemeRecordImplT = mneme::MnemeRecorderHIP; diff --git a/include/mneme/MnemeJITProteus.hpp b/include/mneme/MnemeJITProteus.hpp index bbabe11c..a33cc2c6 100644 --- a/include/mneme/MnemeJITProteus.hpp +++ b/include/mneme/MnemeJITProteus.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include #include diff --git a/include/mneme/MnemeKernelInfo.hpp b/include/mneme/MnemeKernelInfo.hpp index 5a6e3c2d..b439d20d 100644 --- a/include/mneme/MnemeKernelInfo.hpp +++ b/include/mneme/MnemeKernelInfo.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #pragma once #include diff --git a/include/mneme/MnemeLLVMUtils.hpp b/include/mneme/MnemeLLVMUtils.hpp index 8e7febdc..557a36da 100644 --- a/include/mneme/MnemeLLVMUtils.hpp +++ b/include/mneme/MnemeLLVMUtils.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #pragma once #include "llvm/ADT/DenseMapInfo.h" #include diff --git a/include/mneme/MnemeLogger.hpp b/include/mneme/MnemeLogger.hpp index c4129f79..4b0ef798 100644 --- a/include/mneme/MnemeLogger.hpp +++ b/include/mneme/MnemeLogger.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #pragma once #ifdef MNEME_ENABLE_LOGGER diff --git a/include/mneme/MnemeMemory.hpp b/include/mneme/MnemeMemory.hpp index 71917891..52407c54 100644 --- a/include/mneme/MnemeMemory.hpp +++ b/include/mneme/MnemeMemory.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #pragma once #include diff --git a/include/mneme/MnemePageManager.hpp b/include/mneme/MnemePageManager.hpp index 9f2bebd8..31504016 100644 --- a/include/mneme/MnemePageManager.hpp +++ b/include/mneme/MnemePageManager.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #pragma once #include #include diff --git a/include/mneme/MnemePython.hpp b/include/mneme/MnemePython.hpp index d94d6705..7bbb29f0 100644 --- a/include/mneme/MnemePython.hpp +++ b/include/mneme/MnemePython.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include #include diff --git a/include/mneme/MnemeRecord.hpp b/include/mneme/MnemeRecord.hpp index e585a53a..16d27cc3 100644 --- a/include/mneme/MnemeRecord.hpp +++ b/include/mneme/MnemeRecord.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #pragma once #include "mneme/MnemeLLVMUtils.hpp" diff --git a/include/mneme/MnemeReplay.hpp b/include/mneme/MnemeReplay.hpp index 2a772996..70c61446 100644 --- a/include/mneme/MnemeReplay.hpp +++ b/include/mneme/MnemeReplay.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include #include #include diff --git a/include/mneme/MnemeSnapshot.hpp b/include/mneme/MnemeSnapshot.hpp index 588e2487..353f2610 100644 --- a/include/mneme/MnemeSnapshot.hpp +++ b/include/mneme/MnemeSnapshot.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #pragma once #include #include diff --git a/include/mneme/MnemeUtils.hpp b/include/mneme/MnemeUtils.hpp index c57db710..b0ec99fa 100644 --- a/include/mneme/MnemeUtils.hpp +++ b/include/mneme/MnemeUtils.hpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #pragma once #include #include diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..e3fcec5c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,19 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[tool.black] +line-length = 88 +target-version = ['py37', 'py38', 'py39', 'py310'] +include = '\.pyi?$' + +[tool.isort] +profile = "black" +multi_line_output = 3 + +[tool.pytest.ini_options] +testpaths = ["python/tests"] +addopts = "--cov=mneme --cov-report=xml" + +[tool.coverage.run] +omit = ["*/llvm/*"] diff --git a/python/mneme/__init__.py b/python/mneme/__init__.py index 5be7759b..8b3497aa 100644 --- a/python/mneme/__init__.py +++ b/python/mneme/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from .llvm import initfini initfini.initialize() diff --git a/python/mneme/async_executor.py b/python/mneme/async_executor.py index dd1ca864..170e95d1 100644 --- a/python/mneme/async_executor.py +++ b/python/mneme/async_executor.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + import queue import threading import time diff --git a/python/mneme/cli.py b/python/mneme/cli.py index 7d9a6fa8..c17a14c0 100644 --- a/python/mneme/cli.py +++ b/python/mneme/cli.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + import argparse import multiprocessing diff --git a/python/mneme/commands.py b/python/mneme/commands.py index ccfd8919..0398cf6a 100644 --- a/python/mneme/commands.py +++ b/python/mneme/commands.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + """ Mneme command-line interface implementation. diff --git a/python/mneme/convert.py b/python/mneme/convert.py index 7fd68f02..55ef8a40 100644 --- a/python/mneme/convert.py +++ b/python/mneme/convert.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from mneme.recorded_execution import RecordedExecution from mneme.mneme_types import ExperimentConfiguration from mneme.llvm import module diff --git a/python/mneme/device.py b/python/mneme/device.py index 24fbd7d3..ab60150f 100644 --- a/python/mneme/device.py +++ b/python/mneme/device.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + """ Device runtime bindings for Mneme (Python ↔ native runtime). diff --git a/python/mneme/futures.py b/python/mneme/futures.py index 44cbd723..8af304a3 100644 --- a/python/mneme/futures.py +++ b/python/mneme/futures.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + """ Future-like primitives for Mneme asynchronous evaluation. diff --git a/python/mneme/llvm/__init__.py b/python/mneme/llvm/__init__.py index c1f8baa3..4ecaaad3 100644 --- a/python/mneme/llvm/__init__.py +++ b/python/mneme/llvm/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from ._version import get_versions from .initfini import * from .module import * diff --git a/python/mneme/llvm/_lib_path_config.py b/python/mneme/llvm/_lib_path_config.py index e39d062d..8c4321f1 100644 --- a/python/mneme/llvm/_lib_path_config.py +++ b/python/mneme/llvm/_lib_path_config.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + # Auto-generated by setup.py from __future__ import annotations from pathlib import Path diff --git a/python/mneme/llvm/_version.py b/python/mneme/llvm/_version.py index dbe9f569..775d405f 100644 --- a/python/mneme/llvm/_version.py +++ b/python/mneme/llvm/_version.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + # This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag diff --git a/python/mneme/llvm/attribute.py b/python/mneme/llvm/attribute.py index aa54ab66..68bd6c96 100644 --- a/python/mneme/llvm/attribute.py +++ b/python/mneme/llvm/attribute.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from ctypes import ( POINTER, byref, diff --git a/python/mneme/llvm/buffer.py b/python/mneme/llvm/buffer.py index dc15c94a..30105f6b 100644 --- a/python/mneme/llvm/buffer.py +++ b/python/mneme/llvm/buffer.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from ctypes import c_size_t from . import ffi diff --git a/python/mneme/llvm/common.py b/python/mneme/llvm/common.py index 3f5746a5..884a018f 100644 --- a/python/mneme/llvm/common.py +++ b/python/mneme/llvm/common.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + import atexit diff --git a/python/mneme/llvm/context.py b/python/mneme/llvm/context.py index 116b59eb..a090048c 100644 --- a/python/mneme/llvm/context.py +++ b/python/mneme/llvm/context.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from . import ffi diff --git a/python/mneme/llvm/debug.py b/python/mneme/llvm/debug.py index 8d69884a..87290861 100644 --- a/python/mneme/llvm/debug.py +++ b/python/mneme/llvm/debug.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from mneme.llvm.common import _encode_string from . import ffi, module diff --git a/python/mneme/llvm/ffi.py b/python/mneme/llvm/ffi.py index ddc40e00..44b5b28d 100644 --- a/python/mneme/llvm/ffi.py +++ b/python/mneme/llvm/ffi.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + import ctypes import importlib.resources as _impres import sys diff --git a/python/mneme/llvm/initfini.py b/python/mneme/llvm/initfini.py index 1735cad4..6dcf259e 100644 --- a/python/mneme/llvm/initfini.py +++ b/python/mneme/llvm/initfini.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from ctypes import c_uint from . import ffi diff --git a/python/mneme/llvm/module.py b/python/mneme/llvm/module.py index 342ac691..4381151e 100644 --- a/python/mneme/llvm/module.py +++ b/python/mneme/llvm/module.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from ctypes import ( POINTER, byref, diff --git a/python/mneme/llvm/typeref.py b/python/mneme/llvm/typeref.py index 674b451f..d2821c61 100644 --- a/python/mneme/llvm/typeref.py +++ b/python/mneme/llvm/typeref.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from ctypes import c_int, c_bool, c_void_p, c_uint64 import enum diff --git a/python/mneme/llvm/utils.py b/python/mneme/llvm/utils.py index 92716acd..660e678f 100644 --- a/python/mneme/llvm/utils.py +++ b/python/mneme/llvm/utils.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + import os import sys diff --git a/python/mneme/llvm/value.py b/python/mneme/llvm/value.py index 642c8c7f..848f1112 100644 --- a/python/mneme/llvm/value.py +++ b/python/mneme/llvm/value.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + import enum from ctypes import ( POINTER, diff --git a/python/mneme/logging.py b/python/mneme/logging.py index 73d508ca..bc945343 100644 --- a/python/mneme/logging.py +++ b/python/mneme/logging.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + import logging from typing import Union diff --git a/python/mneme/mneme_types.py b/python/mneme/mneme_types.py index 9b16824f..6711b25a 100644 --- a/python/mneme/mneme_types.py +++ b/python/mneme/mneme_types.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + import hashlib import json from ctypes import Structure, c_uint diff --git a/python/mneme/page_manager.py b/python/mneme/page_manager.py index 828a450e..f5b2e51a 100644 --- a/python/mneme/page_manager.py +++ b/python/mneme/page_manager.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + """ ctypes wrapper for Mneme virtual address space (page manager). diff --git a/python/mneme/pipeline.py b/python/mneme/pipeline.py index 4f6c8e41..3fa20ba2 100644 --- a/python/mneme/pipeline.py +++ b/python/mneme/pipeline.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from __future__ import annotations import random diff --git a/python/mneme/profile.py b/python/mneme/profile.py index 1d8e9ade..4d9fdec1 100644 --- a/python/mneme/profile.py +++ b/python/mneme/profile.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + """ GPU profiling helpers (lazy-loaded native profiler binding). diff --git a/python/mneme/proteus/__init__.py b/python/mneme/proteus/__init__.py index e69de29b..f5a5b6e9 100644 --- a/python/mneme/proteus/__init__.py +++ b/python/mneme/proteus/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + diff --git a/python/mneme/proteus/jit.py b/python/mneme/proteus/jit.py index ac4426ae..6c878918 100644 --- a/python/mneme/proteus/jit.py +++ b/python/mneme/proteus/jit.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + """ Python FFI bindings for the Proteus JIT transformation and code-generation pipeline. diff --git a/python/mneme/recorded_execution.py b/python/mneme/recorded_execution.py index 90b0d53b..d7edb76b 100644 --- a/python/mneme/recorded_execution.py +++ b/python/mneme/recorded_execution.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + """ Recorded execution database and memory snapshot bindings. diff --git a/python/mneme/replay_executor.py b/python/mneme/replay_executor.py index 106d5689..13e62d2e 100644 --- a/python/mneme/replay_executor.py +++ b/python/mneme/replay_executor.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + """ mneme.replay_executor diff --git a/python/mneme/transforms/__init__.py b/python/mneme/transforms/__init__.py index e69de29b..f5a5b6e9 100644 --- a/python/mneme/transforms/__init__.py +++ b/python/mneme/transforms/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + diff --git a/python/mneme/transforms/transform.py b/python/mneme/transforms/transform.py index dd5bb99e..860b0cb3 100644 --- a/python/mneme/transforms/transform.py +++ b/python/mneme/transforms/transform.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from ctypes import c_char_p from ..llvm import ffi as ffi diff --git a/python/mneme/tuning/__init__.py b/python/mneme/tuning/__init__.py index e69de29b..f5a5b6e9 100644 --- a/python/mneme/tuning/__init__.py +++ b/python/mneme/tuning/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + diff --git a/python/mneme/tuning/sample_strategy.py b/python/mneme/tuning/sample_strategy.py index 5e4b350e..a833559f 100644 --- a/python/mneme/tuning/sample_strategy.py +++ b/python/mneme/tuning/sample_strategy.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from __future__ import annotations from abc import ABC, abstractmethod diff --git a/python/mneme/tuning/search_space.py b/python/mneme/tuning/search_space.py index 13f2808c..60d2a3fa 100644 --- a/python/mneme/tuning/search_space.py +++ b/python/mneme/tuning/search_space.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + from abc import ABC, abstractmethod from collections import defaultdict from typing import Any, Dict, List, Tuple, Iterable diff --git a/python/mneme/utils.py b/python/mneme/utils.py index 79cc25b0..1d7e6010 100644 --- a/python/mneme/utils.py +++ b/python/mneme/utils.py @@ -1,3 +1,6 @@ +# Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + import json import time from dataclasses import fields diff --git a/src/MnemeDeviceCode.cpp b/src/MnemeDeviceCode.cpp index c20537a3..ef4866e1 100644 --- a/src/MnemeDeviceCode.cpp +++ b/src/MnemeDeviceCode.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "mneme/DeviceTraits.hpp" #include #include diff --git a/src/MnemeLogger.cpp b/src/MnemeLogger.cpp index b0a4c1a1..1ad40b66 100644 --- a/src/MnemeLogger.cpp +++ b/src/MnemeLogger.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "mneme/MnemeLogger.hpp" #ifdef MNEME_ENABLE_LOGGER diff --git a/src/MnemePageManager.cpp b/src/MnemePageManager.cpp index e2ebd6bf..5ba7278c 100644 --- a/src/MnemePageManager.cpp +++ b/src/MnemePageManager.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "mneme/MnemePageManager.hpp" #include "mneme/MnemeUtils.hpp" #include diff --git a/src/MnemeRecordPreloadCUDA.cpp b/src/MnemeRecordPreloadCUDA.cpp index dfe92572..897fa83d 100644 --- a/src/MnemeRecordPreloadCUDA.cpp +++ b/src/MnemeRecordPreloadCUDA.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "mneme/MnemeLLVMUtils.hpp" #include "mneme/MnemeLogger.hpp" #include "mneme/MnemeRecord.hpp" diff --git a/src/MnemeRecordPreloadHIP.cpp b/src/MnemeRecordPreloadHIP.cpp index 1c4c40b0..b26c4853 100644 --- a/src/MnemeRecordPreloadHIP.cpp +++ b/src/MnemeRecordPreloadHIP.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "mneme/DeviceTraits.hpp" #include "mneme/MnemeLLVMUtils.hpp" #include "mneme/MnemeLogger.hpp" diff --git a/src/MnemeReplay.cpp b/src/MnemeReplay.cpp index 954e2fc4..74b8762c 100644 --- a/src/MnemeReplay.cpp +++ b/src/MnemeReplay.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #ifdef ICMP_NE #undef ICMP_NE #endif diff --git a/src/python/device.cpp b/src/python/device.cpp index 85374b2d..bc13741c 100644 --- a/src/python/device.cpp +++ b/src/python/device.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "llvm/core.h" #include #include diff --git a/src/python/llvm/assembly.cpp b/src/python/llvm/assembly.cpp index 2710e835..7e42d7f3 100644 --- a/src/python/llvm/assembly.cpp +++ b/src/python/llvm/assembly.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "llvm/AsmParser/Parser.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" diff --git a/src/python/llvm/attribute.cpp b/src/python/llvm/attribute.cpp index 930b6d69..07fa104b 100644 --- a/src/python/llvm/attribute.cpp +++ b/src/python/llvm/attribute.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "core.h" #include "llvm-c/Core.h" #include diff --git a/src/python/llvm/bitcode.cpp b/src/python/llvm/bitcode.cpp index c1cf1eb4..048a7e80 100644 --- a/src/python/llvm/bitcode.cpp +++ b/src/python/llvm/bitcode.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "llvm-c/BitReader.h" #include #include diff --git a/src/python/llvm/buffer.cpp b/src/python/llvm/buffer.cpp index c6e9e6ff..90a40f78 100644 --- a/src/python/llvm/buffer.cpp +++ b/src/python/llvm/buffer.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "core.h" #include "llvm-c/Types.h" #include diff --git a/src/python/llvm/core.cpp b/src/python/llvm/core.cpp index 5d8fc5d5..46eb213b 100644 --- a/src/python/llvm/core.cpp +++ b/src/python/llvm/core.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "core.h" #include "llvm-c/Support.h" diff --git a/src/python/llvm/executionengine.cpp b/src/python/llvm/executionengine.cpp index 777efa5e..83a075bf 100644 --- a/src/python/llvm/executionengine.cpp +++ b/src/python/llvm/executionengine.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "llvm-c/ExecutionEngine.h" #include diff --git a/src/python/llvm/initfini.cpp b/src/python/llvm/initfini.cpp index 19fa3f26..11a26c45 100644 --- a/src/python/llvm/initfini.cpp +++ b/src/python/llvm/initfini.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "core.h" #include "llvm/Config/llvm-config.h" #include diff --git a/src/python/llvm/module.cpp b/src/python/llvm/module.cpp index afff3a4d..b5429104 100644 --- a/src/python/llvm/module.cpp +++ b/src/python/llvm/module.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "llvm/IR/Module.h" #include "core.h" #include "llvm-c/Analysis.h" diff --git a/src/python/llvm/targets.cpp b/src/python/llvm/targets.cpp index 91df3ab2..9ca5e045 100644 --- a/src/python/llvm/targets.cpp +++ b/src/python/llvm/targets.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "core.h" #include "llvm-c/TargetMachine.h" #include "llvm/Analysis/TargetLibraryInfo.h" diff --git a/src/python/llvm/type.cpp b/src/python/llvm/type.cpp index 1a037172..d67883ed 100644 --- a/src/python/llvm/type.cpp +++ b/src/python/llvm/type.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "core.h" #include "llvm-c/Core.h" #include "llvm/IR/Module.h" diff --git a/src/python/llvm/value.cpp b/src/python/llvm/value.cpp index e7146270..2796bcb5 100644 --- a/src/python/llvm/value.cpp +++ b/src/python/llvm/value.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "core.h" #include "llvm-c/Core.h" #include diff --git a/src/python/mem_state.cpp b/src/python/mem_state.cpp index 24771672..03e93479 100644 --- a/src/python/mem_state.cpp +++ b/src/python/mem_state.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "llvm/core.h" #include #include diff --git a/src/python/page_manager.cpp b/src/python/page_manager.cpp index e0d8d0c4..fac31a91 100644 --- a/src/python/page_manager.cpp +++ b/src/python/page_manager.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "llvm/core.h" #include #include diff --git a/src/python/profile/rocr_profile.cpp b/src/python/profile/rocr_profile.cpp index 2c358232..ba42b7b7 100644 --- a/src/python/profile/rocr_profile.cpp +++ b/src/python/profile/rocr_profile.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include #include #include diff --git a/src/python/proteus/jit.cpp b/src/python/proteus/jit.cpp index 505ff386..363638a8 100644 --- a/src/python/proteus/jit.cpp +++ b/src/python/proteus/jit.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include "../llvm/core.h" #include "mneme/MnemeUtils.hpp" #include "llvm-c/Core.h" diff --git a/src/python/transforms/purge_autoinit.cpp b/src/python/transforms/purge_autoinit.cpp index f473f675..3486cfbe 100644 --- a/src/python/transforms/purge_autoinit.cpp +++ b/src/python/transforms/purge_autoinit.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2021-2024. LLNL-CODE-2000766 and Mneme Contributors +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + // ZeroInitAllocas.cpp #include "../llvm/core.h"