MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / AllocatorInterface

Class AllocatorInterface

src/backend/common/AllocatorInterface.hpp:27–40  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

25 * delegated.
26 */
27class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected