From 7960a4f31fb55a0d83c459a2a9931e326ff4c97c Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Wed, 8 May 2024 15:41:10 +0100 Subject: [PATCH 1/4] Add llvm 18 for osx to ci --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12157e756..da6861560 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,11 +48,11 @@ jobs: os: macos-14 compiler: clang clang-runtime: '17' - #Turn on once clang-18 available through Homebrew - #- name: osx14-arm-clang-runtime18 - # os: macos-14 - # compiler: clang - # clang-runtime: '18' + + - name: osx14-arm-clang-runtime18 + os: macos-14 + compiler: clang + clang-runtime: '18' - name: osx13-x86-clang-runtime12 os: macos-13 @@ -83,11 +83,11 @@ jobs: os: macos-13 compiler: clang clang-runtime: '17' - #Turn on once clang-18 available through Homebrew - #- name: osx13-x86-clang-runtime18 - # os: macos-13 - # compiler: clang - # clang-runtime: '18' + + - name: osx13-x86-clang-runtime18 + os: macos-13 + compiler: clang + clang-runtime: '18' - name: win2022-msvc-runtime14 os: windows-2022 From 66d39c90931a6c8c6eb6853bed2cb0f1a4eef1b1 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 9 May 2024 11:50:22 +0100 Subject: [PATCH 2/4] Attempt fix --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da6861560..d248eca8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -623,10 +623,12 @@ jobs: PATH_TO_LLVM_BUILD=/usr/local/opt/llvm@${{ matrix.clang-runtime }}/ pushd /usr/local/opt w="0" + q="0" [ '${{ matrix.clang-runtime }}' == '17' ] && w="6" - sudo curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang-runtime }}.0.$w/clang+llvm-${{ matrix.clang-runtime }}.0.$w-x86_64-apple-darwin.tar.xz | sudo xz -d -c | sudo tar -x + [ '${{ matrix.clang-runtime }}' == '18' ] && q="1" + sudo curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang-runtime }}.$q.$w/clang+llvm-${{ matrix.clang-runtime }}.$q.$w-x86_64-apple-darwin.tar.xz | sudo xz -d -c | sudo tar -x sudo rm -fr /usr/local/clang* - sudo mv clang+llvm-${{ matrix.clang-runtime }}.0.$w-x86_64-apple-darwin/ llvm@${{ matrix.clang-runtime }}/ + sudo mv clang+llvm-${{ matrix.clang-runtime }}.$q.$w-x86_64-apple-darwin/ llvm@${{ matrix.clang-runtime }}/ # Use llvm/llvm@10/llvm@6 Filecheck if [[ ! -f $PATH_TO_LLVM_BUILD/bin/FileCheck ]]; then if [[ -f /usr/local/opt/llvm/bin/FileCheck ]]; then From ff74e0c26fdddd445e608af35420a5079e022197 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 6 Jun 2024 18:40:26 +0100 Subject: [PATCH 3/4] Attempt fix --- .github/workflows/ci.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d248eca8b..3020c2de3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -607,6 +607,7 @@ jobs: { echo "Unsupported compiler - fix YAML file" } + - name: Setup LLVM/Clang on macOS if: runner.os == 'macOS' run: | @@ -619,14 +620,10 @@ jobs: # For now Package llvm@18 is unsuported on brew, llvm <=@11 are deprecated or deleted. # Install llvm from github releases. - if [[ '${{ matrix.clang-runtime }}' == '18' || ${{ matrix.clang-runtime }} -le 11 ]]; then + if [[ ${{ matrix.clang-runtime }} -le 11 ]]; then PATH_TO_LLVM_BUILD=/usr/local/opt/llvm@${{ matrix.clang-runtime }}/ pushd /usr/local/opt - w="0" q="0" - [ '${{ matrix.clang-runtime }}' == '17' ] && w="6" - [ '${{ matrix.clang-runtime }}' == '18' ] && q="1" - sudo curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang-runtime }}.$q.$w/clang+llvm-${{ matrix.clang-runtime }}.$q.$w-x86_64-apple-darwin.tar.xz | sudo xz -d -c | sudo tar -x sudo rm -fr /usr/local/clang* sudo mv clang+llvm-${{ matrix.clang-runtime }}.$q.$w-x86_64-apple-darwin/ llvm@${{ matrix.clang-runtime }}/ # Use llvm/llvm@10/llvm@6 Filecheck @@ -642,7 +639,7 @@ jobs: popd fi - if [[ '${{ matrix.clang-runtime }}' != '18' && ${{ matrix.clang-runtime }} -gt 11 ]]; then + if [[ ${{ matrix.clang-runtime }} -gt 11 ]]; then brew install llvm@${{ matrix.clang-runtime }} else # Remove the c++ headers that come with the llvm package from homebrew From be5679c5e82c3d2100633d52b26bf7851b7ae28f Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 4 Aug 2024 07:59:56 +0000 Subject: [PATCH 4/4] Add builtin_exp --- include/clad/Differentiator/BuiltinDerivatives.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/clad/Differentiator/BuiltinDerivatives.h b/include/clad/Differentiator/BuiltinDerivatives.h index 557274a56..c7acaa0bb 100644 --- a/include/clad/Differentiator/BuiltinDerivatives.h +++ b/include/clad/Differentiator/BuiltinDerivatives.h @@ -147,6 +147,11 @@ CUDA_HOST_DEVICE inline void __builtin_powf_pullback(float x, float exponent, *d_exponent += t.pushforward * d_y; } +CUDA_HOST_DEVICE ValueAndPushforward +inline __builtin_exp_pushforward(double x, double d_x) { + return {__builtin_exp(x), __builtin_exp(x) * d_x}; +} + // FIXME: Add the rest of the __builtin_ routines for log, sqrt, abs, etc. namespace std {