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
Commits
4746e11b
Commit
4746e11b
authored
Jun 02, 2022
by
Chao Liu
Browse files
add contraction example
parent
68f8ecdb
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1077 additions
and
101 deletions
+1077
-101
example/23_contraction/contraction_xdl_fp32.cpp
example/23_contraction/contraction_xdl_fp32.cpp
+233
-92
include/ck/tensor_operation/gpu/device/device_contraction.hpp
...ude/ck/tensor_operation/gpu/device/device_contraction.hpp
+39
-0
include/ck/tensor_operation/gpu/device/device_contraction_xdl_cshuffle.hpp
..._operation/gpu/device/device_contraction_xdl_cshuffle.hpp
+802
-0
include/ck/utility/sequence_helper.hpp
include/ck/utility/sequence_helper.hpp
+1
-3
include/ck/utility/tuple.hpp
include/ck/utility/tuple.hpp
+1
-3
include/ck/utility/tuple_helper.hpp
include/ck/utility/tuple_helper.hpp
+1
-3
No files found.
example/23_contraction/contraction_xdl_fp32.cpp
View file @
4746e11b
This diff is collapsed.
Click to expand it.
include/ck/tensor_operation/gpu/device/device_contraction.hpp
0 → 100644
View file @
4746e11b
#pragma once
#include <iostream>
#include <vector>
#include "device_base.hpp"
namespace
ck
{
namespace
tensor_operation
{
namespace
device
{
template
<
index_t
NumDimM
,
index_t
NumDimN
,
index_t
NumDimK
,
typename
AElementwiseOperation
,
typename
BElementwiseOperation
,
typename
CElementwiseOperation
>
struct
DeviceContraction
:
public
BaseOperator
{
virtual
std
::
unique_ptr
<
BaseArgument
>
MakeArgumentPointer
(
const
void
*
p_a
,
const
void
*
p_b
,
void
*
p_c
,
std
::
vector
<
index_t
>
a_lengths
,
std
::
vector
<
index_t
>
a_strides
,
std
::
vector
<
index_t
>
b_lengths
,
std
::
vector
<
index_t
>
b_strides
,
std
::
vector
<
index_t
>
c_lengths
,
std
::
vector
<
index_t
>
c_strides
,
AElementwiseOperation
a_element_op
,
BElementwiseOperation
b_element_op
,
CElementwiseOperation
c_element_op
)
=
0
;
virtual
std
::
unique_ptr
<
BaseInvoker
>
MakeInvokerPointer
()
=
0
;
};
}
// namespace device
}
// namespace tensor_operation
}
// namespace ck
include/ck/tensor_operation/gpu/device/device_contraction_xdl_cshuffle.hpp
0 → 100644
View file @
4746e11b
This diff is collapsed.
Click to expand it.
include/ck/utility/sequence_helper.hpp
View file @
4746e11b
#ifndef CK_SEQUENCE_HELPER_HPP
#pragma once
#define CK_SEQUENCE_HELPER_HPP
#include "tuple.hpp"
#include "tuple.hpp"
...
@@ -33,4 +32,3 @@ __host__ __device__ constexpr auto to_sequence(Tuple<Number<Is>...>)
...
@@ -33,4 +32,3 @@ __host__ __device__ constexpr auto to_sequence(Tuple<Number<Is>...>)
}
}
}
// namespace ck
}
// namespace ck
#endif
include/ck/utility/tuple.hpp
View file @
4746e11b
#ifndef CK_TUPLE_HPP
#pragma once
#define CK_TUPLE_HPP
#include "integral_constant.hpp"
#include "integral_constant.hpp"
#include "sequence.hpp"
#include "sequence.hpp"
...
@@ -173,4 +172,3 @@ constexpr Tuple<Args&...> tie(Args&... args) noexcept
...
@@ -173,4 +172,3 @@ constexpr Tuple<Args&...> tie(Args&... args) noexcept
}
}
}
// namespace ck
}
// namespace ck
#endif
include/ck/utility/tuple_helper.hpp
View file @
4746e11b
#ifndef CK_TUPLE_HELPER_HPP
#pragma once
#define CK_TUPLE_HELPER_HPP
#include "functional4.hpp"
#include "functional4.hpp"
#include "tuple.hpp"
#include "tuple.hpp"
...
@@ -66,4 +65,3 @@ __host__ __device__ constexpr auto transform_tuples(F f, const X& x, const Y& y,
...
@@ -66,4 +65,3 @@ __host__ __device__ constexpr auto transform_tuples(F f, const X& x, const Y& y,
}
}
}
// namespace ck
}
// namespace ck
#endif
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