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:
Aaron Gokaslan
2022-12-28 11:12:22 +00:00
committed by PyTorch MergeBot
parent c470ad4f4a
commit 700941f683
12 changed files with 27 additions and 23 deletions

View File

@ -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