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
55cb3bde
Commit
55cb3bde
authored
Nov 05, 2024
by
aska-0096
Browse files
clean the flush_cache api
parent
7a0ad60e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
24 deletions
+6
-24
include/ck/host_utility/flush_cache.hpp
include/ck/host_utility/flush_cache.hpp
+6
-24
No files found.
include/ck/host_utility/flush_cache.hpp
View file @
55cb3bde
...
@@ -262,18 +262,13 @@ inline void flush_icache()
...
@@ -262,18 +262,13 @@ inline void flush_icache()
HIP_CHECK_ERROR
(
hipGetLastError
());
HIP_CHECK_ERROR
(
hipGetLastError
());
}
}
// if TimePrePress == false, return time does not include preprocess's time
// if TimePrePress == false, return time does not include preprocess's time
template
<
bool
TimePreprocess
,
template
<
bool
TimePreprocess
,
typename
...
Args
,
typename
F
,
typename
PreProcessFunc
>
typename
GemmArgs
,
typename
...
Args
,
typename
F
,
typename
PreProcessFunc
>
float
launch_and_time_kernel_with_preprocess
(
const
StreamConfig
&
stream_config
,
float
launch_and_time_kernel_with_preprocess
(
const
StreamConfig
&
stream_config
,
PreProcessFunc
preprocess
,
PreProcessFunc
preprocess
,
F
kernel
,
F
kernel
,
dim3
grid_dim
,
dim3
grid_dim
,
dim3
block_dim
,
dim3
block_dim
,
std
::
size_t
lds_byte
,
std
::
size_t
lds_byte
,
GemmArgs
&
gemm_args
,
Args
...
args
)
Args
...
args
)
{
{
#if CK_TIME_KERNEL
#if CK_TIME_KERNEL
...
@@ -296,7 +291,7 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
...
@@ -296,7 +291,7 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
// warm up
// warm up
for
(
int
i
=
0
;
i
<
stream_config
.
cold_niters_
;
++
i
)
for
(
int
i
=
0
;
i
<
stream_config
.
cold_niters_
;
++
i
)
{
{
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
gemm_args
,
args
...);
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
args
...);
HIP_CHECK_ERROR
(
hipGetLastError
());
HIP_CHECK_ERROR
(
hipGetLastError
());
}
}
...
@@ -333,7 +328,7 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
...
@@ -333,7 +328,7 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
start
,
start
,
stop
,
stop
,
0
,
0
,
gemm_
args
);
args
...
);
HIP_CHECK_ERROR
(
hipGetLastError
());
HIP_CHECK_ERROR
(
hipGetLastError
());
// end real kernel
// end real kernel
...
@@ -347,15 +342,6 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
...
@@ -347,15 +342,6 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
#else
#else
total_time
+=
cur_time
;
total_time
+=
cur_time
;
#endif
#endif
if
(
ck
::
EnvIsEnabled
(
CK_ENV
(
CK_LOGGING
)))
{
// std::cout << "i: " << i << " cur_time: " << cur_time << std::endl;
printf
(
"gemm_args.p_a_grid: %p, gemm_args.p_b_grid:%p
\n
"
,
static_cast
<
const
void
*>
(
gemm_args
.
p_a_grid
),
static_cast
<
const
void
*>
(
gemm_args
.
p_b_grid
));
}
}
}
hip_check_error
(
hipEventRecord
(
stop
,
stream_config
.
stream_id_
));
hip_check_error
(
hipEventRecord
(
stop
,
stream_config
.
stream_id_
));
hip_check_error
(
hipEventSynchronize
(
stop
));
hip_check_error
(
hipEventSynchronize
(
stop
));
...
@@ -381,23 +367,19 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
...
@@ -381,23 +367,19 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
return
(
*
mid
+
*
mid_next
)
/
2
;
return
(
*
mid
+
*
mid_next
)
/
2
;
}
}
#else
#else
// return total_time / nrepeat;
return
total_time
/
nrepeat
;
hipDeviceProp_t
deviceProps
;
hip_check_error
(
hipGetDeviceProperties
(
&
deviceProps
,
0
));
float
preprocess_offset
=
deviceProps
.
multiProcessorCount
==
80
?
0.005
:
0.01
;
return
(
total_time
-
preprocess_offset
*
nrepeat
)
/
nrepeat
;
#endif
#endif
}
}
else
else
{
{
preprocess
();
preprocess
();
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
gemm_args
,
args
...);
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
args
...);
HIP_CHECK_ERROR
(
hipGetLastError
());
HIP_CHECK_ERROR
(
hipGetLastError
());
return
0
;
return
0
;
}
}
#else
#else
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
gemm_args
,
args
...);
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
args
...);
HIP_CHECK_ERROR
(
hipGetLastError
());
HIP_CHECK_ERROR
(
hipGetLastError
());
return
0
;
return
0
;
...
...
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