diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 000000000..dbac85d15 --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,26 @@ +name: clang-format + +on: + pull_request: + push: + branches: + - master + schedule: + - cron: '0 0 * * *' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Lint with clang-format + run: | + find -name '*.cpp' -o -name '*.h' -o -name '*.cu' -o -name '*.cuh' | xargs clang-format -i + GIT_DIFF=$(git diff) + if [[ -z $GIT_DIFF ]]; then + exit 0 + fi + echo $GIT_DIFF + exit 1 diff --git a/torchani/cuaev/delete-me.cu b/torchani/cuaev/delete-me.cu new file mode 100644 index 000000000..3d2fd10da --- /dev/null +++ b/torchani/cuaev/delete-me.cu @@ -0,0 +1,19 @@ +// This file only exists temporarily for validating the clang-format CI +// This file should be deleted when https://github.com/aiqm/torchani/pull/516 +// or https://github.com/aiqm/torchani/pull/521 is merged. + +#include +#include + +__global__ void print_from_gpu(void) { + printf("Hello World! from thread [%d,%d] \ + From device\n", + threadIdx.x, blockIdx.x); +} + +int main(void) { + printf("Hello World from host!\n"); + print_from_gpu<<<1, 1>>>(); + cudaDeviceSynchronize(); + return 0; +}