bit_cast.hpp Source File

bit_cast.hpp Source File#

Composable Kernel: bit_cast.hpp Source File
bit_cast.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved.
3
4#pragma once
5
7
8namespace ck_tile {
9
10template <typename Y, typename X>
11CK_TILE_HOST_DEVICE constexpr Y bit_cast(const X& x)
12{
13 static_assert(__has_builtin(__builtin_bit_cast), "");
14 static_assert(sizeof(X) == sizeof(Y), "Do not support cast between different size of type");
15
16 return __builtin_bit_cast(Y, x);
17}
18
19} // namespace ck_tile
#define CK_TILE_HOST_DEVICE
Definition config.hpp:42
Definition tile/core/algorithm/cluster_descriptor.hpp:13
CK_TILE_HOST_DEVICE constexpr Y bit_cast(const X &x)
Definition bit_cast.hpp:11