class dlstreamer::MemoryMapperCache#

Overview#

#include <memory_mapper_factory.h>

class MemoryMapperCache: public dlstreamer::MemoryMapper {
public:
    // construction

    MemoryMapperCache(MemoryMapperPtr mapper);

    // methods

    virtual TensorPtr map(TensorPtr src, dlstreamer::AccessMode mode);
    virtual FramePtr map(FramePtr src, dlstreamer::AccessMode mode);
    virtual ContextPtr input_context() const;
    virtual ContextPtr output_context() const;
};

Inherited Members#

public:
    // methods

    virtual TensorPtr map(TensorPtr src, AccessMode mode = AccessMode::ReadWrite) = 0;
    virtual FramePtr map(FramePtr src, AccessMode mode = AccessMode::ReadWrite) = 0;
    virtual ContextPtr input_context() const = 0;
    virtual ContextPtr output_context() const = 0;

Detailed Documentation#

Methods#

virtual TensorPtr map(TensorPtr src, dlstreamer::AccessMode mode)

Map tensor into another context. The function returns mapped tensor, so that the parent() on output tensor returns original tensor and context() on output tensor returns input_context().

Parameters:

src

Tensor to map

mode

Access mode - read or write or read+write

virtual FramePtr map(FramePtr src, dlstreamer::AccessMode mode)

Map frame into another context. The function returns mapped frame, so that the parent() on output frame returns original frame and context() on output frame returns input_context().

Parameters:

src

Frame to map

mode

Access mode - read or write or read+write

virtual ContextPtr input_context() const

Returns context specified as input context on mapper object creation.

virtual ContextPtr output_context() const

Returns context specified as output context on mapper object creation.