mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-07-18 01:28:27 +00:00
20 lines
469 B
C++
20 lines
469 B
C++
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "ck/ck.hpp"
|
|
#include "ck/utility/enable_if.hpp"
|
|
|
|
namespace ck {
|
|
|
|
template <typename Y, typename X, typename enable_if<sizeof(X) == sizeof(Y), bool>::type = false>
|
|
__host__ __device__ constexpr Y bit_cast(const X& x)
|
|
{
|
|
static_assert(__has_builtin(__builtin_bit_cast), "");
|
|
|
|
return __builtin_bit_cast(Y, x);
|
|
}
|
|
|
|
} // namespace ck
|