CIRCT 21.0.0git
|
#include <Services.h>
Classes | |
struct | HostMemRegion |
RAII memory region for host memory. More... | |
struct | Options |
Options for allocating host memory. More... | |
Public Member Functions | |
virtual | ~HostMem ()=default |
virtual std::string | getServiceSymbol () const override |
virtual void | start () |
In cases where necessary, enable host memory services. | |
virtual std::unique_ptr< HostMemRegion > | allocate (std::size_t size, Options opts) const =0 |
Allocate a region of host memory in accelerator accessible address space. | |
virtual bool | mapMemory (void *ptr, std::size_t size, Options opts) const |
Try to make a region of host memory accessible to the accelerator. | |
virtual void | unmapMemory (void *ptr) const |
Unmap memory which was previously mapped with 'mapMemory'. | |
Service (AcceleratorConnection &conn) | |
![]() | |
Service (AcceleratorConnection &conn) | |
virtual | ~Service ()=default |
virtual Service * | getChildService (Service::Type service, AppIDPath id={}, std::string implName={}, ServiceImplDetails details={}, HWClientDetails clients={}) |
Create a "child" service of this service. | |
virtual BundlePort * | getPort (AppIDPath id, const BundleType *type) const |
Get specialized port for this service to attach to the given appid path. | |
AcceleratorConnection & | getConnection () const |
Static Public Attributes | |
static constexpr std::string_view | StdName = "esi.service.std.hostmem" |
Additional Inherited Members | |
![]() | |
using | Type = const std::type_info & |
![]() | |
AcceleratorConnection & | conn |
Definition at line 198 of file Services.h.
|
virtualdefault |
|
pure virtual |
Allocate a region of host memory in accelerator accessible address space.
Implemented in TraceHostMem.
Referenced by PYBIND11_MODULE().
|
overridevirtual |
Implements esi::services::Service.
Definition at line 160 of file Services.cpp.
|
inlinevirtual |
Try to make a region of host memory accessible to the accelerator.
Returns 'false' on failure. It is optional for an accelerator backend to implement this, so client code needs to have a fallback for when this returns 'false'. On success, it is the client's responsibility to ensure that the memory eventually gets unmapped.
Reimplemented in TraceHostMem.
Definition at line 243 of file Services.h.
Referenced by PYBIND11_MODULE().
|
inline |
Definition at line 49 of file Services.h.
|
inlinevirtual |
In cases where necessary, enable host memory services.
Definition at line 232 of file Services.h.
Referenced by hostmemTest().
|
inlinevirtual |
Unmap memory which was previously mapped with 'mapMemory'.
Undefined behavior when called with a pointer which was not previously mapped.
Reimplemented in TraceHostMem.
Definition at line 248 of file Services.h.
Referenced by PYBIND11_MODULE().
|
staticconstexpr |
Definition at line 200 of file Services.h.
Referenced by esi::services::ServiceRegistry::lookupServiceType().