Skip to content

Commit

Permalink
Add pre-commit and run on all files.
Browse files Browse the repository at this point in the history
  • Loading branch information
stellaraccident committed Jan 18, 2025
1 parent 96c0e49 commit d07577c
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 26 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build_linux_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,3 @@ jobs:
with:
path: ${{ env.CACHE_DIR }}
key: linux-build-packages-manylinux-v2-${{ github.sha }}


2 changes: 0 additions & 2 deletions .github/workflows/build_python_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,3 @@ jobs:
with:
path: ${{ env.CACHE_DIR }}
key: build-python-manylinux-v2-${{ github.sha }}


1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ jobs:
name: Build Python Packages
needs: setup
uses: ./.github/workflows/build_python_packages.yml

6 changes: 3 additions & 3 deletions .github/workflows/nightly_staging_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
tag_name: ${{ steps.compute_version.outputs.tag_name }}
release_id: ${{ steps.create_release.outputs.id }}
release_upload_url: ${{ steps.create_release.outputs.upload_url }}

steps:
- name: Checking out repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
ls -l linux-x86_64
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.setup.outputs.tag_name }} \
linux-x86_64/*
Expand Down Expand Up @@ -135,6 +135,6 @@ jobs:

- name: Mark Release Non Draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release edit ${{ needs.setup.outputs.tag_name }} --draft=false
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v18.1.4'
hooks:
- id: clang-format
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# TheRock
The HIP Environment and ROCm Kit - A lightweight open source build system for HIP and ROCm

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)

# Install Deps

## Common
Expand Down
2 changes: 1 addition & 1 deletion cmake/custom_install_amdgpu_compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ file(
foreach(_relpath ${LLVM_FILES} ${HIPCC_FILES})
cmake_path(GET _relpath PARENT_PATH _parent_rel_path)
file(
INSTALL ${STAGING_INSTALL_DIR}/${_relpath}
INSTALL ${STAGING_INSTALL_DIR}/${_relpath}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${_parent_rel_path}
USE_SOURCE_PERMISSIONS
)
Expand Down
6 changes: 3 additions & 3 deletions cmake/custom_install_amdgpu_runtime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ list(REMOVE_ITEM LIB_FILES
foreach(_relpath ${LIB_FILES})
cmake_path(GET _relpath PARENT_PATH _parent_rel_path)
file(
INSTALL ${STAGING_INSTALL_DIR}/${_relpath}
INSTALL ${STAGING_INSTALL_DIR}/${_relpath}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${_parent_rel_path}
USE_SOURCE_PERMISSIONS
USE_SOURCE_PERMISSIONS
)
endforeach()

Expand All @@ -58,6 +58,6 @@ foreach(_relpath ${LLVM_LIB_FILES})
file(
INSTALL ${STAGING_INSTALL_DIR}/llvm/${_relpath}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${_parent_rel_path}
USE_SOURCE_PERMISSIONS
USE_SOURCE_PERMISSIONS
)
endforeach()
2 changes: 1 addition & 1 deletion cmake/custom_install_amdgpu_runtime_dev.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ file(
foreach(_relpath ${DEV_FILES})
cmake_path(GET _relpath PARENT_PATH _parent_rel_path)
file(
INSTALL ${STAGING_INSTALL_DIR}/${_relpath}
INSTALL ${STAGING_INSTALL_DIR}/${_relpath}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${_parent_rel_path}
USE_SOURCE_PERMISSIONS
)
Expand Down
4 changes: 2 additions & 2 deletions cmake/extensions/clr_post.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ therock_set_install_rpath(
hiprtc
PATHS
.
llvm/lib
)
llvm/lib
)
4 changes: 2 additions & 2 deletions cmake/extensions/rocr_post.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ therock_set_install_rpath(
hsa-runtime64
PATHS
.
llvm/lib
)
llvm/lib
)
2 changes: 1 addition & 1 deletion cmake/therock_external_project_include.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cmake_language(DEFER CALL therock_post_external_project)
function(therock_post_external_project)
if(EXISTS "${THEROCK_SOURCE_DIR}/cmake/extensions/${CMAKE_PROJECT_NAME}_post.cmake")
message(STATUS "Including project extensions: ${CMAKE_PROJECT_NAME}_post.cmake")
# Note that because of the way defer processing works, we include in a
# Note that because of the way defer processing works, we include in a
# function scope, which usually wouldn't make sense. But since this will
# by definition be the last thing evaluated, there is nothing to observe
# the top level scope after this anyway, so it is ok to do here.
Expand Down
2 changes: 1 addition & 1 deletion cmake/therock_rpath.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ function(therock_set_install_rpath)
endforeach()
message(STATUS "Set RPATH ${_rpath} on ${ARG_TARGETS}")
set_target_properties(${ARG_TARGETS} PROPERTIES INSTALL_RPATH "${_rpath}")
endfunction()
endfunction()
12 changes: 6 additions & 6 deletions python_projects/runtime/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def finalize_options(self):
# Note that setuptools always builds into a "build" directory that
# is a sibling of setup.py, so we just colonize a sub-directory of that
# by default.
CMAKE_BUILD_DIR = Path(os.getenv(
"THEROCK_CMAKE_BUILD_DIR", SETUPPY_DIR / "build" / "cmake-build"
))
CMAKE_INSTALL_DIR = Path(os.getenv(
"THEROCK_CMAKE_INSTALL_DIR", SETUPPY_DIR / "build" / "dist-install"
))
CMAKE_BUILD_DIR = Path(
os.getenv("THEROCK_CMAKE_BUILD_DIR", SETUPPY_DIR / "build" / "cmake-build")
)
CMAKE_INSTALL_DIR = Path(
os.getenv("THEROCK_CMAKE_INSTALL_DIR", SETUPPY_DIR / "build" / "dist-install")
)

with open(SETUPPY_DIR / "README.md", "rt") as f:
README = f.read()
Expand Down
3 changes: 2 additions & 1 deletion tests/dlopen-hip.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ int main(int argc, char **argv) {
char *lib_path = argv[1];
int rc;
void *h = dlopen(lib_path, RTLD_NOW);
int(*hipRuntimeGetVersion)(int*) = (int(*)(int*))dlsym(h, "hipRuntimeGetVersion");
int (*hipRuntimeGetVersion)(int *) =
(int (*)(int *))dlsym(h, "hipRuntimeGetVersion");
if (!hipRuntimeGetVersion) {
fprintf(stderr, "ERROR: Could not resolve symbol hipRuntimeGetVersion\n");
return 1;
Expand Down

0 comments on commit d07577c

Please sign in to comment.