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
e8490111
"tests/vscode:/vscode.git/clone" did not exist on "35358a2decad0c1e2972a8311ff49bfc14a326e1"
Commit
e8490111
authored
May 30, 2023
by
carlushuang
Browse files
fix something in example
parent
b753bbc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
example/01_gemm/run_gemm_example.inc
example/01_gemm/run_gemm_example.inc
+23
-0
No files found.
example/01_gemm/run_gemm_example.inc
View file @
e8490111
...
@@ -99,6 +99,7 @@ bool run_gemm(const ProblemType& problem_size, const ExecutionConfig& config)
...
@@ -99,6 +99,7 @@ bool run_gemm(const ProblemType& problem_size, const ExecutionConfig& config)
a_m_k_device_buf
.
ToDevice
(
a_m_k
.
mData
.
data
());
a_m_k_device_buf
.
ToDevice
(
a_m_k
.
mData
.
data
());
b_k_n_device_buf
.
ToDevice
(
b_k_n
.
mData
.
data
());
b_k_n_device_buf
.
ToDevice
(
b_k_n
.
mData
.
data
());
#endif
#endif
DeviceMem
workspace
;
auto
a_element_op
=
AElementOp
{};
auto
a_element_op
=
AElementOp
{};
auto
b_element_op
=
BElementOp
{};
auto
b_element_op
=
BElementOp
{};
...
@@ -182,7 +183,29 @@ bool run_gemm(const ProblemType& problem_size, const ExecutionConfig& config)
...
@@ -182,7 +183,29 @@ bool run_gemm(const ProblemType& problem_size, const ExecutionConfig& config)
return
true
;
return
true
;
}
}
std
::
size_t
workspace_size
=
gemm
.
GetWorkSpaceSize
(
&
argument
);
if
(
workspace_size
!=
0
)
{
workspace
.
Realloc
(
workspace_size
);
gemm
.
SetWorkSpacePointer
(
&
argument
,
workspace
.
GetDeviceBuffer
());
}
ave_time
=
invoker
.
Run
(
argument
,
StreamConfig
{
nullptr
,
config
.
time_kernel
});
ave_time
=
invoker
.
Run
(
argument
,
StreamConfig
{
nullptr
,
config
.
time_kernel
});
#if 0
// TODO!!!!!
if
(
workspace_size
!=
0
){
float
*
ws_ptr
=
reinterpret_cast
<
float
*>
(
malloc
(
workspace_size
));
size_t
ws_dwords
=
workspace_size
/
sizeof
(
float
);
workspace
.
FromDevice
(
ws_ptr
);
for
(
size_t
i
=
0
;
i
<
ws_dwords
;
i
++
)
{
uint32_t
rere
=
reinterpret_cast
<
uint32_t
*>
(
ws_ptr
)[
i
];
printf
(
"%4lu : %f(0x%08x)
\n
"
,
i
,
ws_ptr
[
i
],
rere
);
}
free
(
ws_ptr
);
}
#endif
}
}
std
::
size_t
flop
=
2_
uz
*
M
*
N
*
K
;
std
::
size_t
flop
=
2_
uz
*
M
*
N
*
K
;
...
...
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