-
Notifications
You must be signed in to change notification settings - Fork 611
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
Compile DALI with Clang #2416
Compile DALI with Clang #2416
Conversation
CI MESSAGE: [1746115]: BUILD STARTED |
CI MESSAGE: [1746115]: BUILD FAILED |
#if defined(__clang__) && defined(__CUDA__) | ||
|
||
template <typename T> | ||
__host__ const T& hostdev_max(const T& l, const T& r) { | ||
return std::max(l, r); | ||
} | ||
|
||
template <typename T> | ||
__device__ const T hostdev_max(const T& l, const T& r) { | ||
return ::max(l, r); | ||
} | ||
|
||
#else | ||
|
||
template <typename T> | ||
__host__ __device__ const T hostdev_max(const T& l, const T& r) { | ||
return ::max(l, r); | ||
} | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have cuda_min/cuda_max. Currently they return reference, but that could be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last time we didn't want to do that.
template <int N> | ||
__device__ vec<N> floor(const vec<N> &a) { | ||
constexpr DALI_DEVICE vec<N> floor(const vec<N> &a) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no particular benefit of using DALI_DEVICE over device. It's compiled only in CUDA and therefore the keyword will always be available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I guess DALI_HOST_DEV was introduced just to save several characters?
Maybe we should just go one way or the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see the point now, we need DALI_HOST_DEV and DALI_HOST (or provide __host__
and __device__
without CUDA headers on our own). So the DALI_DEVICE
is more or less for completeness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the DALI_DEVICE is more or less for completeness.
That's right.
CI MESSAGE: [1749225]: BUILD STARTED |
CI MESSAGE: [1749293]: BUILD STARTED |
CI MESSAGE: [1749445]: BUILD STARTED |
CI MESSAGE: [1749293]: BUILD FAILED |
CI MESSAGE: [1749531]: BUILD STARTED |
CI MESSAGE: [1749532]: BUILD STARTED |
CI MESSAGE: [1749559]: BUILD STARTED |
CI MESSAGE: [1749565]: BUILD STARTED |
CI MESSAGE: [1749580]: BUILD STARTED |
CI MESSAGE: [1749752]: BUILD STARTED |
CI MESSAGE: [1749757]: BUILD STARTED |
CI MESSAGE: [1749565]: BUILD FAILED |
CI MESSAGE: [1749580]: BUILD PASSED |
CI MESSAGE: [1749752]: BUILD PASSED |
CI MESSAGE: [1749757]: BUILD PASSED |
a6d69dd
to
ae6b800
Compare
!build |
CI MESSAGE: [1784829]: BUILD STARTED |
CI MESSAGE: [1784829]: BUILD PASSED |
CI MESSAGE: [1802731]: BUILD FAILED |
df1f75f
to
0126862
Compare
CI MESSAGE: [1802800]: BUILD STARTED |
b02a113
to
bb18bc8
Compare
CI MESSAGE: [1810423]: BUILD STARTED |
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
64e5824
to
930cd63
Compare
CI MESSAGE: [1839388]: BUILD STARTED |
CI MESSAGE: [1839388]: BUILD FAILED |
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
CI MESSAGE: [1839662]: BUILD STARTED |
CI MESSAGE: [1839736]: BUILD STARTED |
CI MESSAGE: [1839872]: BUILD STARTED |
CI MESSAGE: [1839872]: BUILD FAILED |
CI MESSAGE: [1839902]: BUILD STARTED |
CI MESSAGE: [1839912]: BUILD STARTED |
CI MESSAGE: [1839912]: BUILD FAILED |
CI MESSAGE: [1840012]: BUILD STARTED |
CI MESSAGE: [1840012]: BUILD FAILED |
CI MESSAGE: [1843855]: BUILD STARTED |
CI MESSAGE: [1843855]: BUILD FAILED |
CI MESSAGE: [1845099]: BUILD STARTED |
CI MESSAGE: [1845099]: BUILD PASSED |
For developement purposes, allow DALI to be compiled only
with CLANG.
CMake adjustments: .cu files marked as CXX files to force
CMake to compile them with Clang. Clang compiles those files
as CUDA based on the .cu extension.
Some additional host/device attributes and overloads
for Clang.
Enable support for CMAKE_CUDA_ARCHITECTURES.
Why we need this PR?
Additional development tools
What happened in this PR?
CMake adjustments: .cu files marked as CXX files to force
CMake to compile them with Clang. Clang compiles those files
as CUDA based on the .cu extension.
Some additional host/device attributes and overloads
for Clang.
Affected modules and functionalities:
Key points relevant for the review:
[ Describe here what is the most important part that reviewers should focus on. ]
Validation and testing:
[ Describe here if and how this PR is tested. ]
Documentation (including examples):
[ Describe here if documentation and examples were updated. ]
JIRA TASK: [Use DALI-XXXX or NA]