18 #include "scanner/util/common.h" 24 static const i64 DEFAULT_POOL_SIZE = 2L * 1024L * 1024L * 1024L;
30 std::string call_file;
34 void init_memory_allocators(MemoryPoolConfig config,
35 std::vector<i32> gpu_device_ids);
37 void destroy_memory_allocators();
39 u8* new_buffer_(
DeviceHandle device,
size_t size, std::string call_file,
42 #define new_buffer(device__, size__) \ 43 new_buffer_(device__, size__, __FILE__, __LINE__) 45 u8* new_block_buffer_(
DeviceHandle device,
size_t size, i32 refs,
46 std::string call_file, i32 call_line);
48 #define new_block_buffer(device__, size__, refs__) \ 49 new_block_buffer_(device__, size__, refs__, __FILE__, __LINE__) 51 u8* new_block_buffer_sizes_(
DeviceHandle device,
const std::vector<size_t>& sizes,
52 std::string call_file, i32 call_line);
54 #define new_block_buffer_sizes(device__, sizes__) \ 55 new_block_buffer_sizes_(device__, sizes__, __FILE__, __LINE__) 57 u8* new_block_buffer_size_(
DeviceHandle device,
size_t size, i32 copies,
58 std::string call_file, i32 call_line);
60 #define new_block_buffer_size(device__, size__, copies__) \ 61 new_block_buffer_size_(device__, size__, copies__, __FILE__, __LINE__) 65 void add_buffer_refs(
DeviceHandle device, u8* buffer, i32 refs);
69 void memcpy_buffer(u8* dest_buffer,
DeviceHandle dest_device,
70 const u8* src_buffer,
DeviceHandle src_device,
size_t size);
72 void memcpy_vec(std::vector<u8*>& dest_buffers,
DeviceHandle dest_device,
73 const std::vector<u8*>& src_buffers,
DeviceHandle src_device,
74 const std::vector<size_t>& sizes);
76 void copy_or_ref_buffers(std::vector<u8*>& dest_buffers,
78 const std::vector<u8*>& src_buffers,
80 const std::vector<size_t>& sizes);
86 const std::vector<Allocation> allocator_allocations(
DeviceHandle device);
Definition: database.cpp:36