Skip to content

Dead runtime-device memory wrappers in memory_op #8039

Description

@Cstandardlib

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions