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
ffde5d16
Commit
ffde5d16
authored
Mar 24, 2023
by
Rosty Geyyer
Browse files
Add utility functions
parent
8a659a2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
include/ck/utility/amd_gemm_dpp.hpp
include/ck/utility/amd_gemm_dpp.hpp
+54
-0
No files found.
include/ck/utility/amd_gemm_dpp.hpp
0 → 100644
View file @
ffde5d16
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
#ifndef CK_AMD_GEMM_DPP_HPP
#define CK_AMD_GEMM_DPP_HPP
#include "data_type.hpp"
namespace
ck
{
// src: fp16, dst: fp32
template
<
index_t
MPerWave
,
index_t
NPerWave
,
index_t
KPerWave
>
struct
intrin_dpp_f32_8x8x8_f16
;
template
<
>
struct
intrin_dpp_f32_8x8x8_f16
<
8
,
8
,
8
>
{
template
<
class
FloatC
>
__device__
static
void
Run
(
const
half8_t
&
reg_a
,
const
half8_t
&
reg_b
,
FloatC
&
reg_c
)
{
#if defined(__gfx1030__) || defined(__gfx1100__) || defined(__gfx1101__) || defined(__gfx1102__)
reg_c
.
template
AsType
<
float8_t
>()(
Number
<
0
>
{})
=
__builtin_amdgcn_update_dpp
(
reg_a
,
reg_b
,
reg_c
.
template
AsType
<
float8_t
>()[
Number
<
0
>
{}]);
#else
ignore
=
reg_a
;
ignore
=
reg_b
;
ignore
=
reg_c
;
#endif
}
};
// src: int8, dst: int32
template
<
index_t
MPerWave
,
index_t
NPerWave
,
index_t
KPerWave
>
struct
intrin_dpp_i32_8x8x8_i8
;
template
<
>
struct
intrin_dpp_i32_8x8x8_i8
<
8
,
8
,
8
>
{
template
<
class
IntC
>
__device__
static
void
Run
(
const
int8_t
&
reg_a
,
const
int8_t
&
reg_b
,
IntC
&
reg_c
)
{
#if defined(__gfx1030__) || defined(__gfx1100__) || defined(__gfx1101__) || defined(__gfx1102__)
reg_c
.
template
AsType
<
int32x8_t
>()(
Number
<
0
>
{})
=
__builtin_amdgcn_update_dpp
(
reg_a
,
reg_b
,
reg_c
.
template
AsType
<
int32x8_t
>()[
Number
<
0
>
{}]);
#else
ignore
=
reg_a
;
ignore
=
reg_b
;
ignore
=
reg_c
;
#endif
}
};
}
// 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