Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/EnzymeAD/Enzyme into herbie
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrantq committed Jan 14, 2025
2 parents 882cd35 + 5651636 commit 4c051bb
Show file tree
Hide file tree
Showing 80 changed files with 2,586 additions and 713 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
llvm: ["16", "17", "18"]
build: ["Release"] #, "Debug" "RelWithDebInfo"
os: [openstack22]
os: [] # [openstack22]
timeout-minutes: 120
steps:
- name: add llvm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enzyme-mlir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: 'llvm/llvm-project'
ref: 'eaa7b385368fa7e3dad9b95411d04be55e71494e'
ref: 'ff24e9a19e3db330dd6412aac9d1d6c0b416697f'
path: 'llvm-project'

- name: Get MLIR commit hash
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ enzyme/benchmarks/ReverseMode/*/*.exe
enzyme/benchmarks/ReverseMode/*/results.txt
enzyme/benchmarks/ReverseMode/*/results.json
.cache
CMakeUserPresets.json
/out
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ brew install enzyme
```
spack install enzyme
```
[Nix](https://nixos.org/)
```
nix-shell -p enzyme
```
To get involved or if you have questions, please join our [mailing list](https://groups.google.com/d/forum/enzyme-dev).
Expand Down
1 change: 1 addition & 0 deletions enzyme/.bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.5.0
3 changes: 3 additions & 0 deletions enzyme/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,12 @@ td_library(
srcs = [
"Enzyme/MLIR/Dialect/Dialect.td",
],
includes = ["."],
deps = [
"@llvm-project//mlir:ControlFlowInterfacesTdFiles",
"@llvm-project//mlir:FunctionInterfacesTdFiles",
"@llvm-project//mlir:LoopLikeInterfaceTdFiles",
"@llvm-project//mlir:MemorySlotInterfacesTdFiles",
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:SideEffectInterfacesTdFiles",
"@llvm-project//mlir:ViewLikeInterfaceTdFiles",
Expand Down Expand Up @@ -604,6 +606,7 @@ cc_library(
"@llvm-project//mlir:LinalgStructuredOpsIncGen",
"@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:MathDialect",
"@llvm-project//mlir:MemorySlotInterfaces",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:NVVMDialect",
"@llvm-project//mlir:OpenMPDialect",
Expand Down
10 changes: 6 additions & 4 deletions enzyme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ add_definitions(-DENZYME_VERSION_PATCH=${ENZYME_PATCH_VERSION})

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(CMAKE_CXX_FLAGS "-Wall -fno-rtti ${CMAKE_CXX_FLAGS} -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder -Werror=switch")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "-O2")

SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb -fno-omit-frame-pointer")
if (NOT DEFINED ENZYME_CONFIGURED_WITH_PRESETS)
set(CMAKE_CXX_FLAGS "-Wall -fno-rtti ${CMAKE_CXX_FLAGS} -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder -Werror=switch")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb -fno-omit-frame-pointer")
endif()

#SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fno-omit-frame-pointer -fsanitize=address")
#SET(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
Expand Down
222 changes: 222 additions & 0 deletions enzyme/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
{
"version": 3,
"configurePresets": [
{
"name": "config-base",
"description": "Base configure preset.",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_CXX_STANDARD_REQUIRED": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"ENZYME_CONFIGURED_WITH_PRESETS": "ON"
}
},
{
"name": "config-base-linux",
"description": "Base configure preset for Linux.",
"inherits": "config-base",
"hidden": true,
"cacheVariables": {
"CMAKE_POSITION_INDEPENDENT_CODE": "ON"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
},
{
"name": "config-base-x64",
"description": "Base preset for x64 platforms.",
"hidden": true,
"architecture": {
"value": "x64",
"strategy": "external"
}
},
{
"name": "x64-linux-clang",
"description": "Base preset for Linux development using Clang compilers.",
"hidden": true,
"inherits": [
"config-base-x64",
"config-base-linux"
],
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS": "-Wall -fno-rtti -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder -Werror=switch"
}
},
{
"name": "x64-linux-clang-debug",
"displayName": "Clang x64 Linux Debug",
"inherits": "x64-linux-clang",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "-O0 -g -ggdb -fno-omit-frame-pointer"
}
},
{
"name": "x64-linux-clang-release",
"displayName": "Clang x64 Linux Release",
"inherits": "x64-linux-clang",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "-O2"
}
},
{
"name": "x64-linux-clang-release-with-debug-info",
"displayName": "Clang x64 Linux Release with Debug Info",
"inherits": "x64-linux-clang",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-O2 -g -ggdb"
}
},
{
"name": "x64-linux-gcc",
"description": "Base preset for Linux development using GNU compilers.",
"hidden": true,
"inherits": [
"config-base-x64",
"config-base-linux"
],
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_CXX_FLAGS": "-Wall -fno-rtti -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder -Werror=switch -Wno-comment"
}
},
{
"name": "x64-linux-gcc-debug",
"displayName": "GCC x64 Linux Debug",
"inherits": "x64-linux-gcc",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "-O0 -g -ggdb -fno-omit-frame-pointer"
}
},
{
"name": "x64-linux-gcc-release",
"displayName": "GCC x64 Linux Release",
"inherits": "x64-linux-gcc",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "-O2"
}
},
{
"name": "x64-linux-gcc-release-with-debug-info",
"displayName": "GCC x64 Linux Release with Debug Info",
"inherits": "x64-linux-gcc",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-O2 -g -ggdb"
}
},
{
"name": "x64-linux-intel",
"description": "Base preset for Linux development using Intel oneAPI compilers.",
"hidden": true,
"inherits": [
"config-base-x64",
"config-base-linux"
],
"cacheVariables": {
"CMAKE_C_COMPILER": "icx",
"CMAKE_CXX_COMPILER": "icpx",
"CMAKE_CXX_FLAGS": "-Wall -fno-rtti -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder -Werror=switch",
"CMAKE_BUILD_WITH_INSTALL_RPATH": "ON"
}
},
{
"name": "x64-linux-intel-debug",
"displayName": "Intel x64 Linux Debug",
"inherits": "x64-linux-intel",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "-O0 -g -ggdb -fno-omit-frame-pointer"
}
},
{
"name": "x64-linux-intel-release",
"displayName": "Intel x64 Linux Release",
"inherits": "x64-linux-intel",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "-O2"
}
},
{
"name": "x64-linux-intel-release-with-debug-info",
"displayName": "Intel x64 Linux Release with Debug Info",
"inherits": "x64-linux-intel",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-O2 -g -ggdb"
}
}
],
"buildPresets": [
{
"name": "x64-linux-clang-debug",
"displayName": "Clang x64 Linux Debug",
"description": "Builds the project using Clang on Linux in Debug configuration.",
"configurePreset": "x64-linux-clang-debug"
},
{
"name": "x64-linux-clang-release",
"displayName": "Clang x64 Linux Release",
"description": "Builds the project using Clang on Linux in Release configuration.",
"configurePreset": "x64-linux-clang-release"
},
{
"name": "x64-linux-clang-release-with-debug-info",
"displayName": "Clang x64 Linux Release with Debug Info",
"description": "Builds the project using Clang on Linux in Release configuration with debug info.",
"configurePreset": "x64-linux-clang-release-with-debug-info"
},
{
"name": "x64-linux-gcc-debug",
"displayName": "GCC x64 Linux Debug",
"description": "Builds the project using GCC on Linux in Debug configuration.",
"configurePreset": "x64-linux-gcc-debug"
},
{
"name": "x64-linux-gcc-release",
"displayName": "GCC x64 Linux Release",
"description": "Builds the project using GCC on Linux in Release configuration.",
"configurePreset": "x64-linux-gcc-release"
},
{
"name": "x64-linux-gcc-release-with-debug-info",
"displayName": "GCC x64 Linux Release with Debug Info",
"description": "Builds the project using GCC on Linux in Release configuration with debug info.",
"configurePreset": "x64-linux-gcc-release-with-debug-info"
},
{
"name": "x64-linux-intel-debug",
"displayName": "Intel x64 Linux Debug",
"description": "Builds the project using Intel oneAPI compilers on Linux in Debug configuration.",
"configurePreset": "x64-linux-intel-debug"
},
{
"name": "x64-linux-intel-release",
"displayName": "Intel x64 Linux Release",
"description": "Builds the project using Intel oneAPI compilers on Linux in Release configuration.",
"configurePreset": "x64-linux-intel-release"
},
{
"name": "x64-linux-intel-release-with-debug-info",
"displayName": "Intel x64 Linux Release with Debug Info",
"description": "Builds the project using Intel oneAPI compilers on Linux in Release configuration with debug info.",
"configurePreset": "x64-linux-intel-release-with-debug-info"
}
]
}
Loading

0 comments on commit 4c051bb

Please sign in to comment.