mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fixup c10 headers with clang-tidy (#91407)
Clang-tidy was not applied properly to headers in c10 as documented #91406. These are the easy automated fixes that came out of applying clang-tidy to the c10 part of the code base. cc @ezyang Pull Request resolved: https://github.com/pytorch/pytorch/pull/91407 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
c470ad4f4a
commit
700941f683
@ -27,14 +27,16 @@ namespace c10 {
|
||||
|
||||
/// Constructors
|
||||
|
||||
inline C10_HOST_DEVICE Half::Half(float value) {
|
||||
inline C10_HOST_DEVICE Half::Half(float value)
|
||||
:
|
||||
#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__)
|
||||
x = __half_as_short(__float2half(value));
|
||||
x(__half_as_short(__float2half(value)))
|
||||
#elif defined(__SYCL_DEVICE_ONLY__)
|
||||
x = sycl::bit_cast<uint16_t>(sycl::half(value));
|
||||
x(sycl::bit_cast<uint16_t>(sycl::half(value)))
|
||||
#else
|
||||
x = detail::fp16_ieee_from_fp32_value(value);
|
||||
x(detail::fp16_ieee_from_fp32_value(value))
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
/// Implicit conversions
|
||||
|
Reference in New Issue
Block a user