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
253f942b
Commit
253f942b
authored
Sep 22, 2023
by
Umang Yadav
Browse files
changes to make it compile
parent
8f9c0243
Changes
275
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
342 additions
and
22 deletions
+342
-22
include/ck/utility/reduction_common.hpp
include/ck/utility/reduction_common.hpp
+5
-0
include/ck/utility/reduction_enums.hpp
include/ck/utility/reduction_enums.hpp
+5
-0
include/ck/utility/reduction_functions_accumulate.hpp
include/ck/utility/reduction_functions_accumulate.hpp
+5
-0
include/ck/utility/reduction_operator.hpp
include/ck/utility/reduction_operator.hpp
+5
-0
include/ck/utility/sequence.hpp
include/ck/utility/sequence.hpp
+5
-0
include/ck/utility/sequence_helper.hpp
include/ck/utility/sequence_helper.hpp
+5
-0
include/ck/utility/static_buffer.hpp
include/ck/utility/static_buffer.hpp
+5
-0
include/ck/utility/statically_indexed_array.hpp
include/ck/utility/statically_indexed_array.hpp
+5
-0
include/ck/utility/statically_indexed_array_multi_index.hpp
include/ck/utility/statically_indexed_array_multi_index.hpp
+5
-0
include/ck/utility/synchronization.hpp
include/ck/utility/synchronization.hpp
+5
-0
include/ck/utility/thread_group.hpp
include/ck/utility/thread_group.hpp
+5
-0
include/ck/utility/transpose_vectors.hpp
include/ck/utility/transpose_vectors.hpp
+5
-0
include/ck/utility/tuple.hpp
include/ck/utility/tuple.hpp
+5
-0
include/ck/utility/tuple_helper.hpp
include/ck/utility/tuple_helper.hpp
+5
-0
include/ck/utility/type.hpp
include/ck/utility/type.hpp
+272
-22
No files found.
include/ck/utility/reduction_common.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -26,3 +29,5 @@ struct float_equal_zero
};
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/reduction_enums.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -39,3 +42,5 @@ enum struct IndicesType
};
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/reduction_functions_accumulate.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -113,3 +116,5 @@ struct AccumulateWithIndexAndNanCheck<true, ReduceOperation, AccDataType, IndexD
}
// namespace detail
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/reduction_operator.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -291,3 +294,5 @@ struct InMemoryDataOperationSupportedOnDataType<InMemoryDataOperationEnum::Add,
}
// namespace reduce
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/sequence.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -897,3 +900,5 @@ template <index_t NSize, index_t I>
using
uniform_sequence_gen_t
=
typename
uniform_sequence_gen
<
NSize
,
I
>::
type
;
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/sequence_helper.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -35,3 +38,5 @@ __host__ __device__ constexpr auto to_sequence(Tuple<Number<Is>...>)
}
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/static_buffer.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -193,3 +196,5 @@ __host__ __device__ constexpr auto make_static_buffer(LongNumber<N>)
}
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/statically_indexed_array.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -103,3 +106,5 @@ struct StaticallyIndexedArray_v2
}
// namespace ck
#endif
#pragma clang diagnostic pop
include/ck/utility/statically_indexed_array_multi_index.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -160,3 +163,5 @@ __host__ __device__ void print_multi_index(const Tuple<Xs...>& x)
}
// namespace ck
#endif
#pragma clang diagnostic pop
include/ck/utility/synchronization.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -31,3 +34,5 @@ __device__ void s_nop()
}
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/thread_group.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -20,3 +23,5 @@ struct ThisThreadBlock
};
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/transpose_vectors.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -163,3 +166,5 @@ struct transpose_vectors<int8_t, NX, NY>
};
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/tuple.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -219,3 +222,5 @@ constexpr Tuple<Args&...> tie(Args&... args) noexcept
}
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/tuple_helper.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
...
@@ -79,3 +82,5 @@ __host__ __device__ constexpr auto transform_tuples(F f, const X& x, const Y& y,
}
}
// namespace ck
#pragma clang diagnostic pop
include/ck/utility/type.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
#pragma once
#include "ck/ck.hpp"
#include "ck/utility/integral_constant.hpp"
#include "ck/utility/enable_if.hpp"
#include "ck/utility/integral_constant.hpp"
#ifdef __HIPCC_RTC__
namespace
std
{
// NOLINTNEXTLINE
#define MIGRAPHX_BUILTIN_TYPE_TRAIT1(name) \
template <class T> struct name : bool_constant<__##name(T)> {}
// NOLINTNEXTLINE
#define MIGRAPHX_BUILTIN_TYPE_TRAIT2(name) \
template <class T, class U> struct name : bool_constant<__##name(T, U)> {}
// NOLINTNEXTLINE
#define MIGRAPHX_BUILTIN_TYPE_TRAITN(name) \
template <class... Ts> struct name : bool_constant<__##name(Ts...)> {}
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_arithmetic);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_destructible);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_nothrow_destructible);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_pointer);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_scalar);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_signed);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_void);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_abstract
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_aggregate
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_array
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_class
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_compound
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_const
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_empty
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_enum
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_final
);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_floating_point);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_function
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_fundamental
);
// MIGRAPHX_BUILTIN_TYPE_TRAIT1(is_integral);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_literal_type
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_lvalue_reference
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_member_function_pointer
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_member_object_pointer
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_member_pointer
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_object
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_pod
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_polymorphic
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_reference
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_rvalue_reference
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_standard_layout
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_trivial
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_trivially_copyable
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_trivially_destructible
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_union
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_unsigned
);
MIGRAPHX_BUILTIN_TYPE_TRAIT1
(
is_volatile
);
MIGRAPHX_BUILTIN_TYPE_TRAIT2
(
is_assignable
);
MIGRAPHX_BUILTIN_TYPE_TRAIT2
(
is_base_of
);
// MIGRAPHX_BUILTIN_TYPE_TRAIT2(is_convertible);
MIGRAPHX_BUILTIN_TYPE_TRAIT2
(
is_nothrow_assignable
);
// MIGRAPHX_BUILTIN_TYPE_TRAIT2(is_same);
MIGRAPHX_BUILTIN_TYPE_TRAIT2
(
is_trivially_assignable
);
MIGRAPHX_BUILTIN_TYPE_TRAITN
(
is_constructible
);
MIGRAPHX_BUILTIN_TYPE_TRAITN
(
is_nothrow_constructible
);
MIGRAPHX_BUILTIN_TYPE_TRAITN
(
is_trivially_constructible
);
template
<
class
T
>
struct
remove_reference
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_reference
<
T
&>
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_reference
<
T
&&>
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_const
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_const
<
const
T
>
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_volatile
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_volatile
<
volatile
T
>
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_cv
{
typedef
typename
remove_volatile
<
typename
remove_const
<
T
>::
type
>::
type
type
;
};
template
<
class
T
>
struct
remove_pointer
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_pointer
<
T
*>
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_pointer
<
T
*
const
>
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_pointer
<
T
*
volatile
>
{
typedef
T
type
;
};
template
<
class
T
>
struct
remove_pointer
<
T
*
const
volatile
>
{
typedef
T
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
:
is_pointer_helper
<
typename
std
::
remove_cv
<
T
>::
type
>
{};
template
<
typename
T
>
constexpr
T
&&
forward
(
typename
remove_reference
<
T
>::
type
&
t_
)
noexcept
{
return
static_cast
<
T
&&>
(
t_
);
}
template
<
typename
T
>
constexpr
T
&&
forward
(
typename
remove_reference
<
T
>::
type
&&
t_
)
noexcept
{
return
static_cast
<
T
&&>
(
t_
);
}
template
<
typename
T
>
inline
constexpr
bool
is_reference_v
=
is_reference
<
T
>::
value
;
/// Default deleter
template
<
typename
T
>
struct
default_delete
{
void
operator
()(
T
*
ptr
)
const
{
delete
ptr
;
}
};
/// Partial specialization for deleting array types
template
<
typename
T
>
struct
default_delete
<
T
[]
>
{
void
operator
()(
T
*
ptr
)
const
{
delete
[]
ptr
;
}
};
/// std::unique_ptr
template
<
class
T
,
class
Deleter
=
default_delete
<
T
>
>
class
unique_ptr
{
public:
typedef
T
*
pointer
;
typedef
T
element_type
;
typedef
Deleter
deleter_type
;
private:
/// Pointer to memory
pointer
_ptr
;
/// Deleter
deleter_type
_deleter
;
public:
unique_ptr
()
:
_ptr
(
nullptr
)
{}
unique_ptr
(
pointer
p
)
:
_ptr
(
p
)
{}
~
unique_ptr
()
{
if
(
_ptr
)
{
_deleter
(
_ptr
);
}
}
/// Returns a pointer to the managed object or nullptr if no object is owned.
pointer
get
()
const
noexcept
{
return
_ptr
;
}
/// Releases ownership of the managed object, if any
pointer
release
()
noexcept
{
pointer
p
(
_ptr
);
_ptr
=
nullptr
;
return
p
;
}
/// Replaces the managed object, deleting the old object.
void
reset
(
pointer
p
=
pointer
())
noexcept
{
pointer
old_ptr
=
_ptr
;
_ptr
=
p
;
if
(
old_ptr
!=
nullptr
)
{
get_deleter
()(
old_ptr
);
}
}
/// Swaps the managed objects with *this and another unique_ptr
void
swap
(
unique_ptr
&
other
)
noexcept
{
swap
(
_ptr
,
other
.
_ptr
);
}
/// Returns the deleter object
Deleter
&
get_deleter
()
noexcept
{
return
_deleter
;
}
/// Returns the deleter object
Deleter
const
&
get_deleter
()
const
noexcept
{
return
_deleter
;
}
/// Checks whether an object is owned
operator
bool
()
const
noexcept
{
return
_ptr
!=
nullptr
;
}
/// Dereferences the unique_ptr
T
&
operator
*
()
const
{
return
*
_ptr
;
}
/// Returns a pointer to the managed object
pointer
operator
->
()
const
noexcept
{
return
_ptr
;
}
/// Array access to managed object
T
&
operator
[](
size_t
i
)
const
{
return
_ptr
[
i
];
}
};
/// Specializes the swap algorithm
template
<
typename
T
,
typename
Deleter
>
void
swap
(
unique_ptr
<
T
,
Deleter
>&
lhs
,
unique_ptr
<
T
,
Deleter
>&
rhs
)
noexcept
{
lhs
.
swap
(
rhs
);
}
template
<
class
T
>
struct
remove_extent
{
using
type
=
T
;
};
template
<
class
T
>
struct
remove_extent
<
T
[]
>
{
using
type
=
T
;
};
template
<
class
T
,
std
::
size_t
N
>
struct
remove_extent
<
T
[
N
]
>
{
using
type
=
T
;
};
template
<
class
T
>
using
remove_extent_t
=
typename
remove_extent
<
T
>::
type
;
namespace
detail
{
template
<
class
>
constexpr
bool
is_unbounded_array_v
=
false
;
template
<
class
T
>
constexpr
bool
is_unbounded_array_v
<
T
[]
>
=
true
;
template
<
class
>
constexpr
bool
is_bounded_array_v
=
false
;
template
<
class
T
,
std
::
size_t
N
>
constexpr
bool
is_bounded_array_v
<
T
[
N
]
>
=
true
;
}
// namespace detail
template
<
class
T
,
class
...
Args
>
enable_if_t
<!
is_array
<
T
>::
value
,
unique_ptr
<
T
>>
make_unique
(
Args
&&
...
args
)
{
return
unique_ptr
<
T
>
(
new
T
(
forward
<
Args
>
(
args
)...));
}
template
<
class
T
>
enable_if_t
<
detail
::
is_unbounded_array_v
<
T
>
,
unique_ptr
<
T
>>
make_unique
(
uint64_t
n
)
{
return
unique_ptr
<
T
>
(
new
remove_extent_t
<
T
>
[
n
]());
}
template
<
class
T
,
class
...
Args
>
enable_if_t
<
detail
::
is_bounded_array_v
<
T
>>
make_unique
(
Args
&&
...)
=
delete
;
}
// namespace std
#endif
namespace
ck
{
template
<
typename
X
,
typename
Y
>
struct
is_same
:
public
integral_constant
<
bool
,
false
>
{
};
struct
is_same
:
public
integral_constant
<
bool
,
false
>
{};
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
>
inline
constexpr
bool
is_same_v
=
is_same
<
X
,
Y
>::
value
;
...
...
@@ -26,10 +274,11 @@ template <typename T>
using
remove_reference_t
=
typename
std
::
remove_reference
<
T
>::
type
;
template
<
typename
T
>
using
remove_
cv
_t
=
typename
std
::
remove_
cv
<
T
>::
type
;
using
remove_
reference
_t
=
typename
std
::
remove_
reference
<
T
>::
type
;
template
<
typename
T
>
using
remove_cvref_t
=
remove_cv_t
<
std
::
remove_reference_t
<
T
>>
;
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_pointer_t
=
typename
std
::
remove_pointer
<
T
>::
type
;
...
...
@@ -37,24 +286,25 @@ using remove_pointer_t = typename std::remove_pointer<T>::type;
template
<
typename
T
>
inline
constexpr
bool
is_pointer_v
=
std
::
is_pointer
<
T
>::
value
;
template
<
typename
Y
,
typename
X
,
typename
enable_if
<
sizeof
(
X
)
==
sizeof
(
Y
),
bool
>
::
type
=
false
>
__host__
__device__
constexpr
Y
bit_cast
(
const
X
&
x
)
{
template
<
typename
Y
,
typename
X
,
typename
enable_if
<
sizeof
(
X
)
==
sizeof
(
Y
),
bool
>
::
type
=
false
>
__host__
__device__
constexpr
Y
bit_cast
(
const
X
&
x
)
{
#if CK_EXPERIMENTAL_USE_MEMCPY_FOR_BIT_CAST
Y
y
;
Y
y
;
__builtin_memcpy
(
&
y
,
&
x
,
sizeof
(
X
));
__builtin_memcpy
(
&
y
,
&
x
,
sizeof
(
X
));
return
y
;
return
y
;
#else
union
AsType
{
X
x
;
Y
y
;
};
union
AsType
{
X
x
;
Y
y
;
};
return
AsType
{
x
}.
y
;
return
AsType
{
x
}.
y
;
#endif
}
}
// namespace ck
#pragma clang diagnostic pop
Prev
1
…
10
11
12
13
14
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