Summary
source/source_base/module_device/memory_op.h:123-136 declares five wrappers that dispatch memory operations on runtime base_device::AbacusDevice_t values:
resize_memory, set_memory, synchronize_memory, cast_memory, delete_memory.
None of them has ever had a call site.
Details
PR #7941 fixed synchronize_memory and cast_memory, but why do they never cause any bugs?
It turns out that these APIs are dead and never used. Moreover, it is confusing to have TWO sets of memory_ops in our code:
| wrapper |
declared |
defined |
explicitly instantiated |
call sites |
resize_memory |
memory_op.h:124 |
memory_op.cpp:530 |
no |
0 |
set_memory |
memory_op.h:127 |
memory_op.cpp:541 |
no |
0 |
synchronize_memory |
memory_op.h:130 |
memory_op.cpp:551 |
yes (:616-620) |
0 |
cast_memory |
memory_op.h:133 |
memory_op.cpp:578 |
yes (:622-629) |
0 |
delete_memory |
memory_op.h:136 |
memory_op.cpp:602 |
no |
0 |
// source/source_base/module_device/memory_op.h
struct cast_memory_op
struct delete_memory_op
...
void cast_memory
void delete_memory
where the *_ops are what's been actually used.
It should be totally removed from our codebase.
Summary
source/source_base/module_device/memory_op.h:123-136declares five wrappers that dispatch memory operations on runtimebase_device::AbacusDevice_tvalues:resize_memory,set_memory,synchronize_memory,cast_memory,delete_memory.None of them has ever had a call site.
Details
PR #7941 fixed
synchronize_memoryandcast_memory, but why do they never cause any bugs?It turns out that these APIs are dead and never used. Moreover, it is confusing to have TWO sets of memory_ops in our code:
resize_memorymemory_op.h:124memory_op.cpp:530set_memorymemory_op.h:127memory_op.cpp:541synchronize_memorymemory_op.h:130memory_op.cpp:551:616-620)cast_memorymemory_op.h:133memory_op.cpp:578:622-629)delete_memorymemory_op.h:136memory_op.cpp:602where the
*_ops are what's been actually used.It should be totally removed from our codebase.