Line data Source code
1 : // SPDX-License-Identifier: Apache-2.0
2 : /**
3 : * Copyright (C) 2025 Jijoong Moon <jijoong.moon@samsung.com>
4 : *
5 : * @file mem_allocator.h
6 : * @date 13 Jan 2025
7 : * @see https://github.com/nnstreamer/nntrainer
8 : * @author Jijoong Moon <jijoong.moon@samsung.com>
9 : * @bug No known bugs except for NYI items
10 : * @brief This is memory allocator for memory pool
11 : *
12 : */
13 : #ifndef __MEM_ALLOCATOR_H__
14 : #define __MEM_ALLOCATOR_H__
15 :
16 : #include <cstddef>
17 : #include <memory>
18 : #include <string>
19 :
20 : namespace nntrainer {
21 :
22 : /**
23 : * @brief MemAllocator, Memory allocator class
24 : */
25 : class MemAllocator {
26 : public:
27 27 : MemAllocator() = default;
28 27 : virtual ~MemAllocator() = default;
29 : virtual void alloc(void **ptr, size_t size, size_t alignment);
30 : virtual void free(void *ptr);
31 0 : virtual std::string getName() { return "cpu"; };
32 : };
33 : } // namespace nntrainer
34 :
35 : #endif
|