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
c9fb3672
Commit
c9fb3672
authored
Jan 20, 2025
by
Ville Pietilä
Browse files
Clean-up host side destructors.
parent
ca4d095b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
11 deletions
+2
-11
include/ck/utility/host_memory_allocator.hpp
include/ck/utility/host_memory_allocator.hpp
+2
-11
No files found.
include/ck/utility/host_memory_allocator.hpp
View file @
c9fb3672
...
...
@@ -286,7 +286,7 @@ namespace memory {
host_destruct_events_
.
insert
({
p
,
false
});
}
void
destruct_host
(
void
*
p
/*, std::function<void()>&& destructor*/
)
void
destruct_host
(
void
*
p
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
host_destruct_events_
[
p
]
=
true
;
...
...
@@ -330,7 +330,6 @@ namespace memory {
void
deallocate
(
void
*
p
)
{
//destructors_[p]();
host_destruct_events_
.
erase
(
p
);
auto
*
memory_pool
=
get_memory_pool
();
memory_pool
->
deallocate
(
p
,
allocated_memory_
[
p
]);
...
...
@@ -394,15 +393,7 @@ namespace memory {
void
deallocate
(
T
*
p
,
std
::
size_t
)
{
// auto destructor = [&]() {
// if constexpr (std::is_destructible_v<T>)
// {
// for (size_t i = 0; i < n; ++i) {
// p[i].~T();
// }
// }
// };
PinnedHostMemoryDeallocator
::
instance
().
destruct_host
(
p
/*, std::move(destructor)*/
);
PinnedHostMemoryDeallocator
::
instance
().
destruct_host
(
p
);
}
template
<
typename
U
,
typename
...
Args
>
...
...
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