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

Add llvm 18 for osx to ci #889

Closed
wants to merge 4 commits into from
Closed
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
31 changes: 15 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -607,6 +607,7 @@ jobs:
{
echo "Unsupported compiler - fix YAML file"
}

- name: Setup LLVM/Clang on macOS
if: runner.os == 'macOS'
run: |
Expand All @@ -619,14 +620,12 @@ 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"
[ '${{ 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
q="0"
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
Expand All @@ -640,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
Expand Down
5 changes: 5 additions & 0 deletions include/clad/Differentiator/BuiltinDerivatives.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<double, double>
inline __builtin_exp_pushforward(double x, double d_x) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: declaration uses identifier '__builtin_exp_pushforward', which is a reserved identifier [bugprone-reserved-identifier]

inline __builtin_exp_pushforward(double x, double d_x) {
       ^

this fix will not be applied because it overlaps with another fix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: invalid case style for function '__builtin_exp_pushforward' [readability-identifier-naming]

inline __builtin_exp_pushforward(double x, double d_x) {
       ^

this fix will not be applied because it overlaps with another fix

return {__builtin_exp(x), __builtin_exp(x) * d_x};
}

// FIXME: Add the rest of the __builtin_ routines for log, sqrt, abs, etc.

namespace std {
Expand Down
Loading