Skip to content

Commit

Permalink
Merge branch 'main' into reloc
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Jul 19, 2024
2 parents f640849 + 2ff83a2 commit ad08331
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 76 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/build-rapids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ name: Build all RAPIDS repositories
on:
workflow_call:
inputs:
slack_token:
description: "The Slack token to use for notifications. No notifications will be sent if not provided."
enable_slack_alerts:
description: "If true, a message will be posted to the CCCL GHA CI Alert channel if the workflow fails."
required: false
type: string
slack_alert:
description: "Slack channel ID for alert notifications."
required: false
type: string
default: false
type: boolean

jobs:
check-event:
Expand All @@ -25,6 +22,7 @@ jobs:
run: |
[[ '${{ github.event_name }}' == 'push' && '${{ github.repository }}' == 'NVIDIA/cccl' ]] || \
[[ '${{ github.event_name }}' == 'schedule' && '${{ github.repository }}' == 'NVIDIA/cccl' ]] || \
[[ '${{ github.event_name }}' == 'workflow_dispatch' && '${{ github.repository }}' == 'NVIDIA/cccl' ]] || \
[[ '${{ github.event_name }}' == 'pull_request' && '${{ github.repository }}' != 'NVIDIA/cccl' ]] \
&& echo "ok=true" | tee -a $GITHUB_OUTPUT \
|| echo "ok=false" | tee -a $GITHUB_OUTPUT;
Expand Down Expand Up @@ -168,18 +166,18 @@ jobs:
notify-failure:
name: Notify Slack of RAPIDS failure
if: ${{ failure() && inputs.slack_token != '' && inputs.slack_alert != '' }}
if: ${{ failure() && inputs.enable_slack_alerts }}
needs: build-rapids
runs-on: ubuntu-latest
steps:
- name: Notify
uses: slackapi/[email protected]
env:
SLACK_BOT_TOKEN: ${{ inputs.slack_token }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }}
WORKFLOW_TYPE: ${{ github.workflow }}
SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
with:
channel-id: ${{ inputs.slack_alert }}
channel-id: ${{ secrets.SLACK_CHANNEL_CI_ALERT }}
slack-message: |
RAPIDS build in workflow '${{ env.WORKFLOW_TYPE }}' failed.
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci-workflow-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,4 @@ jobs:
pull-requests: read
uses: ./.github/workflows/build-rapids.yml
with:
slack_token: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }}
slack_alert: ${{ secrets.SLACK_CHANNEL_CI_ALERT }}
enable_slack_alerts: true
65 changes: 1 addition & 64 deletions thrust/thrust/detail/complex/complex.inl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2021 NVIDIA Corporation
* Copyright 2008-2024 NVIDIA Corporation
* Copyright 2013 Filipe RNC Maia
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -26,97 +26,44 @@ THRUST_NAMESPACE_BEGIN

/* --- Constructors --- */

#if THRUST_CPP_DIALECT < 2011
template <typename T>
_CCCL_HOST_DEVICE complex<T>::complex()
{
real(T());
imag(T());
}
#endif

template <typename T>
_CCCL_HOST_DEVICE complex<T>::complex(const T& re)
#if THRUST_CPP_DIALECT >= 2011
// Initialize the storage in the member initializer list using C++ unicorn
// initialization. This allows `complex<T const>` to work.
: data{re, T()}
{}
#else
{
real(re);
imag(T());
}
#endif

template <typename T>
_CCCL_HOST_DEVICE complex<T>::complex(const T& re, const T& im)
#if THRUST_CPP_DIALECT >= 2011
// Initialize the storage in the member initializer list using C++ unicorn
// initialization. This allows `complex<T const>` to work.
: data{re, im}
{}
#else
{
real(re);
imag(im);
}
#endif

#if THRUST_CPP_DIALECT < 2011
template <typename T>
_CCCL_HOST_DEVICE complex<T>::complex(const complex<T>& z)
{
real(z.real());
imag(z.imag());
}
#endif

template <typename T>
template <typename U>
_CCCL_HOST_DEVICE complex<T>::complex(const complex<U>& z)
#if THRUST_CPP_DIALECT >= 2011
// Initialize the storage in the member initializer list using C++ unicorn
// initialization. This allows `complex<T const>` to work.
// We do a functional-style cast here to suppress conversion warnings.
: data{T(z.real()), T(z.imag())}
{}
#else
{
real(T(z.real()));
imag(T(z.imag()));
}
#endif

template <typename T>
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>::complex(const std::complex<T>& z)
#if THRUST_CPP_DIALECT >= 2011
// Initialize the storage in the member initializer list using C++ unicorn
// initialization. This allows `complex<T const>` to work.
: data{THRUST_STD_COMPLEX_REAL(z), THRUST_STD_COMPLEX_IMAG(z)}
{}
#else
{
real(THRUST_STD_COMPLEX_REAL(z));
imag(THRUST_STD_COMPLEX_IMAG(z));
}
#endif

template <typename T>
template <typename U>
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>::complex(const std::complex<U>& z)
#if THRUST_CPP_DIALECT >= 2011
// Initialize the storage in the member initializer list using C++ unicorn
// initialization. This allows `complex<T const>` to work.
// We do a functional-style cast here to suppress conversion warnings.
: data{T(THRUST_STD_COMPLEX_REAL(z)), T(THRUST_STD_COMPLEX_IMAG(z))}
{}
#else
{
real(T(THRUST_STD_COMPLEX_REAL(z)));
imag(T(THRUST_STD_COMPLEX_IMAG(z)));
}
#endif

/* --- Assignment Operators --- */

Expand All @@ -128,16 +75,6 @@ _CCCL_HOST_DEVICE complex<T>& complex<T>::operator=(const T& re)
return *this;
}

#if THRUST_CPP_DIALECT < 2011
template <typename T>
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator=(const complex<T>& z)
{
real(z.real());
imag(z.imag());
return *this;
}
#endif

template <typename T>
template <typename U>
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator=(const complex<U>& z)
Expand Down

0 comments on commit ad08331

Please sign in to comment.