Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel_ROCM
Commits
f000fe32
Commit
f000fe32
authored
Sep 26, 2023
by
Umang Yadav
Browse files
remove unnecesssary changes
parent
795bea35
Changes
46
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
210 additions
and
173 deletions
+210
-173
include/ck/utility/synchronization.hpp
include/ck/utility/synchronization.hpp
+0
-5
include/ck/utility/thread_group.hpp
include/ck/utility/thread_group.hpp
+0
-5
include/ck/utility/transpose_vectors.hpp
include/ck/utility/transpose_vectors.hpp
+0
-5
include/ck/utility/tuple.hpp
include/ck/utility/tuple.hpp
+0
-5
include/ck/utility/tuple_helper.hpp
include/ck/utility/tuple_helper.hpp
+0
-5
include/ck/utility/type.hpp
include/ck/utility/type.hpp
+210
-148
No files found.
include/ck/utility/synchronization.hpp
View file @
f000fe32
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -34,5 +31,3 @@ __device__ void s_nop()
...
@@ -34,5 +31,3 @@ __device__ void s_nop()
}
}
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/thread_group.hpp
View file @
f000fe32
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -23,5 +20,3 @@ struct ThisThreadBlock
...
@@ -23,5 +20,3 @@ struct ThisThreadBlock
};
};
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/transpose_vectors.hpp
View file @
f000fe32
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -166,5 +163,3 @@ struct transpose_vectors<int8_t, NX, NY>
...
@@ -166,5 +163,3 @@ struct transpose_vectors<int8_t, NX, NY>
};
};
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/tuple.hpp
View file @
f000fe32
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -222,5 +219,3 @@ constexpr Tuple<Args&...> tie(Args&... args) noexcept
...
@@ -222,5 +219,3 @@ constexpr Tuple<Args&...> tie(Args&... args) noexcept
}
}
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/tuple_helper.hpp
View file @
f000fe32
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -82,5 +79,3 @@ __host__ __device__ constexpr auto transform_tuples(F f, const X& x, const Y& y,
...
@@ -82,5 +79,3 @@ __host__ __device__ constexpr auto transform_tuples(F f, const X& x, const Y& y,
}
}
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/type.hpp
View file @
f000fe32
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -14,15 +11,24 @@
...
@@ -14,15 +11,24 @@
namespace
std
{
namespace
std
{
// NOLINTNEXTLINE
// NOLINTNEXTLINE
#define MIGRAPHX_BUILTIN_TYPE_TRAIT1(name) \
#define MIGRAPHX_BUILTIN_TYPE_TRAIT1(name) \
template <class T> struct name : bool_constant<__##name(T)> {}
template <class T> \
struct name : bool_constant<__##name(T)> \
{ \
}
// NOLINTNEXTLINE
// NOLINTNEXTLINE
#define MIGRAPHX_BUILTIN_TYPE_TRAIT2(name) \
#define MIGRAPHX_BUILTIN_TYPE_TRAIT2(name) \
template <class T, class U> struct name : bool_constant<__##name(T, U)> {}
template <class T, class U> \
struct name : bool_constant<__##name(T, U)> \
{ \
}
// NOLINTNEXTLINE
// NOLINTNEXTLINE
#define MIGRAPHX_BUILTIN_TYPE_TRAITN(name) \
#define MIGRAPHX_BUILTIN_TYPE_TRAITN(name) \
template <class... Ts> struct name : bool_constant<__##name(Ts...)> {}
template <class... Ts> \
struct name : bool_constant<__##name(Ts...)> \
{ \
}
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_arithmetic);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_arithmetic);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_destructible);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_destructible);
...
@@ -70,84 +76,123 @@ MIGRAPHX_BUILTIN_TYPE_TRAIT2(is_trivially_assignable);
...
@@ -70,84 +76,123 @@ MIGRAPHX_BUILTIN_TYPE_TRAIT2(is_trivially_assignable);
MIGRAPHX_BUILTIN_TYPE_TRAITN
(
is_constructible
);
MIGRAPHX_BUILTIN_TYPE_TRAITN
(
is_constructible
);
MIGRAPHX_BUILTIN_TYPE_TRAITN
(
is_nothrow_constructible
);
MIGRAPHX_BUILTIN_TYPE_TRAITN
(
is_nothrow_constructible
);
MIGRAPHX_BUILTIN_TYPE_TRAITN
(
is_trivially_constructible
);
MIGRAPHX_BUILTIN_TYPE_TRAITN
(
is_trivially_constructible
);
template
<
class
T
>
struct
remove_reference
{
template
<
class
T
>
struct
remove_reference
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_reference
<
T
&>
{
template
<
class
T
>
struct
remove_reference
<
T
&>
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_reference
<
T
&&>
{
template
<
class
T
>
struct
remove_reference
<
T
&&>
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_const
{
template
<
class
T
>
struct
remove_const
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_const
<
const
T
>
{
template
<
class
T
>
struct
remove_const
<
const
T
>
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_volatile
{
template
<
class
T
>
struct
remove_volatile
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_volatile
<
volatile
T
>
{
template
<
class
T
>
struct
remove_volatile
<
volatile
T
>
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_cv
{
template
<
class
T
>
struct
remove_cv
{
typedef
typename
remove_volatile
<
typename
remove_const
<
T
>::
type
>::
type
type
;
typedef
typename
remove_volatile
<
typename
remove_const
<
T
>::
type
>::
type
type
;
};
};
template
<
class
T
>
struct
remove_pointer
{
template
<
class
T
>
struct
remove_pointer
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_pointer
<
T
*>
{
template
<
class
T
>
struct
remove_pointer
<
T
*>
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_pointer
<
T
*
const
>
{
template
<
class
T
>
struct
remove_pointer
<
T
*
const
>
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_pointer
<
T
*
volatile
>
{
template
<
class
T
>
struct
remove_pointer
<
T
*
volatile
>
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
remove_pointer
<
T
*
const
volatile
>
{
template
<
class
T
>
struct
remove_pointer
<
T
*
const
volatile
>
{
typedef
T
type
;
typedef
T
type
;
};
};
template
<
class
T
>
struct
is_pointer_helper
:
std
::
false_type
{};
template
<
class
T
>
struct
is_pointer_helper
:
std
::
false_type
{
};
template
<
class
T
>
struct
is_pointer_helper
<
T
*>
:
std
::
true_type
{};
template
<
class
T
>
struct
is_pointer_helper
<
T
*>
:
std
::
true_type
{
};
template
<
class
T
>
template
<
class
T
>
struct
is_pointer
:
is_pointer_helper
<
typename
std
::
remove_cv
<
T
>::
type
>
{};
struct
is_pointer
:
is_pointer_helper
<
typename
std
::
remove_cv
<
T
>::
type
>
{
};
template
<
typename
T
>
template
<
typename
T
>
constexpr
T
&&
forward
(
typename
remove_reference
<
T
>::
type
&
t_
)
noexcept
{
constexpr
T
&&
forward
(
typename
remove_reference
<
T
>::
type
&
t_
)
noexcept
return
static_cast
<
T
&&>
(
t_
);
{
return
static_cast
<
T
&&>
(
t_
);
}
}
template
<
typename
T
>
template
<
typename
T
>
constexpr
T
&&
forward
(
typename
remove_reference
<
T
>::
type
&&
t_
)
noexcept
{
constexpr
T
&&
forward
(
typename
remove_reference
<
T
>::
type
&&
t_
)
noexcept
return
static_cast
<
T
&&>
(
t_
);
{
return
static_cast
<
T
&&>
(
t_
);
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
constexpr
bool
is_reference_v
=
is_reference
<
T
>::
value
;
inline
constexpr
bool
is_reference_v
=
is_reference
<
T
>::
value
;
/// Default deleter
/// Default deleter
template
<
typename
T
>
template
<
typename
T
>
struct
default_delete
{
struct
default_delete
{
void
operator
()(
T
*
ptr
)
const
{
delete
ptr
;
}
void
operator
()(
T
*
ptr
)
const
{
delete
ptr
;
}
};
};
/// Partial specialization for deleting array types
/// Partial specialization for deleting array types
template
<
typename
T
>
template
<
typename
T
>
struct
default_delete
<
T
[]
>
{
struct
default_delete
<
T
[]
>
{
void
operator
()(
T
*
ptr
)
const
{
delete
[]
ptr
;
}
void
operator
()(
T
*
ptr
)
const
{
delete
[]
ptr
;
}
};
};
/// std::unique_ptr
/// std::unique_ptr
template
<
class
T
,
class
Deleter
=
default_delete
<
T
>
>
template
<
class
T
,
class
Deleter
=
default_delete
<
T
>
>
class
unique_ptr
{
class
unique_ptr
{
public:
public:
typedef
T
*
pointer
;
typedef
T
*
pointer
;
typedef
T
element_type
;
typedef
T
element_type
;
...
@@ -164,8 +209,10 @@ class unique_ptr {
...
@@ -164,8 +209,10 @@ class unique_ptr {
unique_ptr
()
:
_ptr
(
nullptr
)
{}
unique_ptr
()
:
_ptr
(
nullptr
)
{}
unique_ptr
(
pointer
p
)
:
_ptr
(
p
)
{}
unique_ptr
(
pointer
p
)
:
_ptr
(
p
)
{}
~
unique_ptr
()
{
~
unique_ptr
()
if
(
_ptr
)
{
{
if
(
_ptr
)
{
_deleter
(
_ptr
);
_deleter
(
_ptr
);
}
}
}
}
...
@@ -173,17 +220,20 @@ class unique_ptr {
...
@@ -173,17 +220,20 @@ class unique_ptr {
pointer
get
()
const
noexcept
{
return
_ptr
;
}
pointer
get
()
const
noexcept
{
return
_ptr
;
}
/// Releases ownership of the managed object, if any
/// Releases ownership of the managed object, if any
pointer
release
()
noexcept
{
pointer
release
()
noexcept
{
pointer
p
(
_ptr
);
pointer
p
(
_ptr
);
_ptr
=
nullptr
;
_ptr
=
nullptr
;
return
p
;
return
p
;
}
}
/// Replaces the managed object, deleting the old object.
/// Replaces the managed object, deleting the old object.
void
reset
(
pointer
p
=
pointer
())
noexcept
{
void
reset
(
pointer
p
=
pointer
())
noexcept
{
pointer
old_ptr
=
_ptr
;
pointer
old_ptr
=
_ptr
;
_ptr
=
p
;
_ptr
=
p
;
if
(
old_ptr
!=
nullptr
)
{
if
(
old_ptr
!=
nullptr
)
{
get_deleter
()(
old_ptr
);
get_deleter
()(
old_ptr
);
}
}
}
}
...
@@ -212,60 +262,71 @@ class unique_ptr {
...
@@ -212,60 +262,71 @@ class unique_ptr {
/// Specializes the swap algorithm
/// Specializes the swap algorithm
template
<
typename
T
,
typename
Deleter
>
template
<
typename
T
,
typename
Deleter
>
void
swap
(
unique_ptr
<
T
,
Deleter
>&
lhs
,
unique_ptr
<
T
,
Deleter
>&
rhs
)
noexcept
{
void
swap
(
unique_ptr
<
T
,
Deleter
>&
lhs
,
unique_ptr
<
T
,
Deleter
>&
rhs
)
noexcept
{
lhs
.
swap
(
rhs
);
lhs
.
swap
(
rhs
);
}
}
template
<
class
T
>
template
<
class
T
>
struct
remove_extent
{
using
type
=
T
;
};
struct
remove_extent
{
using
type
=
T
;
};
template
<
class
T
>
template
<
class
T
>
struct
remove_extent
<
T
[]
>
{
using
type
=
T
;
};
struct
remove_extent
<
T
[]
>
{
using
type
=
T
;
};
template
<
class
T
,
std
::
size_t
N
>
template
<
class
T
,
std
::
size_t
N
>
struct
remove_extent
<
T
[
N
]
>
{
using
type
=
T
;
};
struct
remove_extent
<
T
[
N
]
>
{
using
type
=
T
;
};
template
<
class
T
>
template
<
class
T
>
using
remove_extent_t
=
typename
remove_extent
<
T
>::
type
;
using
remove_extent_t
=
typename
remove_extent
<
T
>::
type
;
namespace
detail
namespace
detail
{
{
template
<
class
>
template
<
class
>
constexpr
bool
is_unbounded_array_v
=
false
;
constexpr
bool
is_unbounded_array_v
=
false
;
template
<
class
T
>
template
<
class
T
>
constexpr
bool
is_unbounded_array_v
<
T
[]
>
=
true
;
constexpr
bool
is_unbounded_array_v
<
T
[]
>
=
true
;
template
<
class
>
template
<
class
>
constexpr
bool
is_bounded_array_v
=
false
;
constexpr
bool
is_bounded_array_v
=
false
;
template
<
class
T
,
std
::
size_t
N
>
template
<
class
T
,
std
::
size_t
N
>
constexpr
bool
is_bounded_array_v
<
T
[
N
]
>
=
true
;
constexpr
bool
is_bounded_array_v
<
T
[
N
]
>
=
true
;
}
// namespace detail
}
// namespace detail
template
<
class
T
,
class
...
Args
>
template
<
class
T
,
class
...
Args
>
enable_if_t
<!
is_array
<
T
>::
value
,
unique_ptr
<
T
>>
enable_if_t
<!
is_array
<
T
>::
value
,
unique_ptr
<
T
>>
make_unique
(
Args
&&
...
args
)
make_unique
(
Args
&&
...
args
)
{
{
return
unique_ptr
<
T
>
(
new
T
(
forward
<
Args
>
(
args
)...));
return
unique_ptr
<
T
>
(
new
T
(
forward
<
Args
>
(
args
)...));
}
}
template
<
class
T
>
template
<
class
T
>
enable_if_t
<
detail
::
is_unbounded_array_v
<
T
>
,
unique_ptr
<
T
>>
enable_if_t
<
detail
::
is_unbounded_array_v
<
T
>
,
unique_ptr
<
T
>>
make_unique
(
uint64_t
n
)
make_unique
(
uint64_t
n
)
{
{
return
unique_ptr
<
T
>
(
new
remove_extent_t
<
T
>
[
n
]());
return
unique_ptr
<
T
>
(
new
remove_extent_t
<
T
>
[
n
]());
}
}
template
<
class
T
,
class
...
Args
>
template
<
class
T
,
class
...
Args
>
enable_if_t
<
detail
::
is_bounded_array_v
<
T
>>
make_unique
(
Args
&&
...)
=
delete
;
enable_if_t
<
detail
::
is_bounded_array_v
<
T
>>
make_unique
(
Args
&&
...)
=
delete
;
}
// namespace std
}
// namespace std
#endif
#endif
namespace
ck
{
namespace
ck
{
template
<
typename
X
,
typename
Y
>
template
<
typename
X
,
typename
Y
>
struct
is_same
:
public
integral_constant
<
bool
,
false
>
{};
struct
is_same
:
public
integral_constant
<
bool
,
false
>
{
};
template
<
typename
X
>
template
<
typename
X
>
struct
is_same
<
X
,
X
>
:
public
integral_constant
<
bool
,
true
>
{};
struct
is_same
<
X
,
X
>
:
public
integral_constant
<
bool
,
true
>
{
};
template
<
typename
X
,
typename
Y
>
template
<
typename
X
,
typename
Y
>
inline
constexpr
bool
is_same_v
=
is_same
<
X
,
Y
>::
value
;
inline
constexpr
bool
is_same_v
=
is_same
<
X
,
Y
>::
value
;
...
@@ -276,9 +337,11 @@ using remove_reference_t = typename std::remove_reference<T>::type;
...
@@ -276,9 +337,11 @@ using remove_reference_t = typename std::remove_reference<T>::type;
template
<
typename
T
>
template
<
typename
T
>
using
remove_reference_t
=
typename
std
::
remove_reference
<
T
>::
type
;
using
remove_reference_t
=
typename
std
::
remove_reference
<
T
>::
type
;
template
<
typename
T
>
using
remove_cv_t
=
typename
std
::
remove_cv
<
T
>::
type
;
template
<
typename
T
>
using
remove_cv_t
=
typename
std
::
remove_cv
<
T
>::
type
;
template
<
typename
T
>
using
remove_cvref_t
=
remove_cv_t
<
remove_reference_t
<
T
>>
;
template
<
typename
T
>
using
remove_cvref_t
=
remove_cv_t
<
remove_reference_t
<
T
>>
;
template
<
typename
T
>
template
<
typename
T
>
using
remove_pointer_t
=
typename
std
::
remove_pointer
<
T
>::
type
;
using
remove_pointer_t
=
typename
std
::
remove_pointer
<
T
>::
type
;
...
@@ -286,9 +349,9 @@ using remove_pointer_t = typename std::remove_pointer<T>::type;
...
@@ -286,9 +349,9 @@ using remove_pointer_t = typename std::remove_pointer<T>::type;
template
<
typename
T
>
template
<
typename
T
>
inline
constexpr
bool
is_pointer_v
=
std
::
is_pointer
<
T
>::
value
;
inline
constexpr
bool
is_pointer_v
=
std
::
is_pointer
<
T
>::
value
;
template
<
typename
Y
,
typename
X
,
template
<
typename
Y
,
typename
X
,
typename
enable_if
<
sizeof
(
X
)
==
sizeof
(
Y
),
bool
>
::
type
=
false
>
typename
enable_if
<
sizeof
(
X
)
==
sizeof
(
Y
),
bool
>
::
type
=
false
>
__host__
__device__
constexpr
Y
bit_cast
(
const
X
&
x
)
__host__
__device__
constexpr
Y
bit_cast
(
const
X
&
x
)
{
{
#if CK_EXPERIMENTAL_USE_MEMCPY_FOR_BIT_CAST
#if CK_EXPERIMENTAL_USE_MEMCPY_FOR_BIT_CAST
Y
y
;
Y
y
;
...
@@ -296,7 +359,8 @@ __host__ __device__ constexpr Y bit_cast(const X &x) {
...
@@ -296,7 +359,8 @@ __host__ __device__ constexpr Y bit_cast(const X &x) {
return
y
;
return
y
;
#else
#else
union
AsType
{
union
AsType
{
X
x
;
X
x
;
Y
y
;
Y
y
;
};
};
...
@@ -306,5 +370,3 @@ __host__ __device__ constexpr Y bit_cast(const X &x) {
...
@@ -306,5 +370,3 @@ __host__ __device__ constexpr Y bit_cast(const X &x) {
}
}
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment