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
27199ba5
Commit
27199ba5
authored
Oct 29, 2024
by
dummycoderfe
Browse files
debug add cache
parent
31bf253a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
include/ck_tile/host/device_memory.hpp
include/ck_tile/host/device_memory.hpp
+1
-0
include/ck_tile/host/kernel_launch.hpp
include/ck_tile/host/kernel_launch.hpp
+11
-5
include/ck_tile/host/stream_config.hpp
include/ck_tile/host/stream_config.hpp
+4
-0
No files found.
include/ck_tile/host/device_memory.hpp
View file @
27199ba5
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include <hip/hip_runtime.h>
#include <hip/hip_runtime.h>
#include <stdint.h>
#include <stdint.h>
#include <stdexcept>
#include <stdexcept>
#include <iostream>
#include "ck_tile/host/hip_check_error.hpp"
#include "ck_tile/host/hip_check_error.hpp"
namespace
ck_tile
{
namespace
ck_tile
{
...
...
include/ck_tile/host/kernel_launch.hpp
View file @
27199ba5
...
@@ -78,15 +78,21 @@ CK_TILE_HOST float launch_kernel(const stream_config& s, Callables... callables)
...
@@ -78,15 +78,21 @@ CK_TILE_HOST float launch_kernel(const stream_config& s, Callables... callables)
}
}
if
(
s
.
is_gpu_timer_
)
{
if
(
s
.
is_gpu_timer_
)
{
gpu_timer
timer
{};
gpu_timer
timer
{};
float
total_time
=
0
;
// warmup
// warmup
for
(
int
i
=
0
;
i
<
s
.
cold_niters_
;
i
++
)
{
(
callables
(
s
),...);
}
HIP_CHECK_ERROR
(
hipGetLastError
());
for
(
int
i
=
0
;
i
<
s
.
cold_niters_
;
i
++
)
{
(
callables
(
s
),...);
}
HIP_CHECK_ERROR
(
hipGetLastError
());
timer
.
start
(
s
.
stream_id_
);
for
(
int
i
=
0
;
i
<
s
.
nrepeat_
;
i
++
)
{
for
(
int
i
=
0
;
i
<
s
.
nrepeat_
;
i
++
)
{
(
callables
(
s
),...);
}
HIP_CHECK_ERROR
(
hipGetLastError
());
if
(
s
.
clear_cache
)
{
timer
.
stop
(
s
.
stream_id_
);
s
.
cache_buf
.
SetValue
<
int
>
(
i
);
}
timer
.
start
(
s
.
stream_id_
);
(
callables
(
s
),...);
timer
.
stop
(
s
.
stream_id_
);
total_time
+=
timer
.
duration
();
}
HIP_CHECK_ERROR
(
hipGetLastError
());
return
t
imer
.
duration
()
/
s
.
nrepeat_
;
return
t
otal_time
/
s
.
nrepeat_
;
}
}
else
{
else
{
cpu_timer
timer
{};
cpu_timer
timer
{};
...
...
include/ck_tile/host/stream_config.hpp
View file @
27199ba5
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#pragma once
#pragma once
#include <hip/hip_runtime.h>
#include <hip/hip_runtime.h>
#include "device_memory.hpp"
namespace
ck_tile
{
namespace
ck_tile
{
/*
/*
...
@@ -30,5 +31,8 @@ struct stream_config
...
@@ -30,5 +31,8 @@ struct stream_config
int
cold_niters_
=
3
;
int
cold_niters_
=
3
;
int
nrepeat_
=
10
;
int
nrepeat_
=
10
;
bool
is_gpu_timer_
=
true
;
// keep compatible
bool
is_gpu_timer_
=
true
;
// keep compatible
bool
clear_cache
=
false
;
size_t
buf_size
=
0
;
DeviceMem
cache_buf
{
buf_size
};
};
};
}
// namespace ck_tile
}
// namespace ck_tile
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