* An interface that provides backend-specific memory management functions, * typically calling a dedicated backend-specific native API. Stored, wrapped, * and called by a MemoryManagerBase, from which calls to its interface are * delegated. */
| 25 | * delegated. |
| 26 | */ |
| 27 | class AllocatorInterface { |
| 28 | public: |
| 29 | AllocatorInterface() = default; |
| 30 | virtual ~AllocatorInterface() {} |
| 31 | virtual void shutdown() = 0; |
| 32 | virtual int getActiveDeviceId() = 0; |
| 33 | virtual size_t getMaxMemorySize(int id) = 0; |
| 34 | virtual void *nativeAlloc(const size_t bytes) = 0; |
| 35 | virtual void nativeFree(void *ptr) = 0; |
| 36 | virtual spdlog::logger *getLogger() final { return this->logger.get(); } |
| 37 | |
| 38 | protected: |
| 39 | std::shared_ptr<spdlog::logger> logger; |
| 40 | }; |
| 41 | |
| 42 | } // namespace common |
| 43 | } // namespace arrayfire |
nothing calls this directly
no outgoing calls
no test coverage detected