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
yangql
composable_kernel-1
Commits
3c0646d4
Commit
3c0646d4
authored
Jun 17, 2019
by
Chao Liu
Browse files
bring back some inline asm
parent
9d59a39a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
15 deletions
+73
-15
composable_kernel/include/utility/amd_inline_asm.hpp
composable_kernel/include/utility/amd_inline_asm.hpp
+73
-0
composable_kernel/include/utility/config_amd.hpp.in
composable_kernel/include/utility/config_amd.hpp.in
+0
-15
No files found.
composable_kernel/include/utility/amd_inline_asm.hpp
View file @
3c0646d4
...
...
@@ -5,6 +5,79 @@
namespace
ck
{
// cast a pointer of LDS to its address
extern
"C"
__attribute__
((
address_space
(
3
)))
void
*
__to_local
(
void
*
p
)[[
hc
]];
__device__
void
vmcnt
(
index_t
cnt
)
{
if
(
cnt
==
0
)
{
asm
volatile
(
"
\n
\
s_waitcnt vmcnt(0)
\n
\
"
::
);
}
else
if
(
cnt
==
1
)
{
asm
volatile
(
"
\n
\
s_waitcnt vmcnt(1)
\n
\
"
::
);
}
else
if
(
cnt
==
2
)
{
asm
volatile
(
"
\n
\
s_waitcnt vmcnt(2)
\n
\
"
::
);
}
else
if
(
cnt
==
4
)
{
asm
volatile
(
"
\n
\
s_waitcnt vmcnt(2)
\n
\
"
::
);
}
else
{
assert
(
false
);
}
}
__device__
void
lgkmcnt
(
index_t
cnt
)
{
if
(
cnt
==
0
)
{
asm
volatile
(
"
\n
\
s_waitcnt lgkmcnt(0)
\n
\
"
::
);
}
else
if
(
cnt
==
1
)
{
asm
volatile
(
"
\n
\
s_waitcnt lgkmcnt(1)
\n
\
"
::
);
}
else
if
(
cnt
==
2
)
{
asm
volatile
(
"
\n
\
s_waitcnt lgkmcnt(2)
\n
\
"
::
);
}
else
if
(
cnt
==
3
)
{
asm
volatile
(
"
\n
\
s_waitcnt lgkmcnt(3)
\n
\
"
::
);
}
else
if
(
cnt
==
4
)
{
asm
volatile
(
"
\n
\
s_waitcnt lgkmcnt(4)
\n
\
"
::
);
}
else
{
assert
(
false
);
}
}
__device__
void
outerProduct1x4
(
const
float
*
a
,
const
float
*
b
,
float
*
c
)
{
asm
volatile
(
"
\n
\
...
...
composable_kernel/include/utility/config_amd.hpp.in
View file @
3c0646d4
...
...
@@ -24,21 +24,6 @@ __device__ void fused_multiply_accumulate(float& d, const float& s0, const float
d += s0 * s1;
}
#if 0
__device__ void fused_multiply_accumulate(half& d, const half& s0, const half& s1) { d += s0 * s1; }
__device__ void fused_multiply_accumulate(half& d, const half2& s0, const half2& s1)
{
d += s0.x * s1.x;
d += s0.y * s1.y;
}
__device__ void fused_multiply_accumulate(float& d, const half2& s0, const half2& s1)
{
d += s0.x * s1.x + s0.y * s1.y;
}
#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