/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/docs-6.4.3/include/ck/utility/c_style_pointer_cast.hpp Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/docs-6.4.3/include/ck/utility/c_style_pointer_cast.hpp Source File#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/docs-6.4.3/include/ck/utility/c_style_pointer_cast.hpp Source File
c_style_pointer_cast.hpp
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
2 // Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
3 
4 #ifndef CK_C_STYLE_POINTER_CAST_HPP
5 #define CK_C_STYLE_POINTER_CAST_HPP
6 
7 #include "type.hpp"
8 #include "enable_if.hpp"
9 
10 namespace ck {
11 
12 template <typename PY,
13  typename PX,
14  typename enable_if<is_pointer_v<PY> && is_pointer_v<PX>, bool>::type = false>
15 __host__ __device__ PY c_style_pointer_cast(PX p_x)
16 {
17 #pragma clang diagnostic push
18 #pragma clang diagnostic ignored "-Wold-style-cast"
19 #pragma clang diagnostic ignored "-Wcast-align"
20  return (PY)p_x; // NOLINT(old-style-cast, cast-align)
21 #pragma clang diagnostic pop
22 }
23 
24 } // namespace ck
25 #endif
Definition: ck.hpp:264
__host__ __device__ PY c_style_pointer_cast(PX p_x)
Definition: c_style_pointer_cast.hpp:15