|
Ginkgo
Generated from pipelines/1554403166 branch based on develop. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
|
5 #ifndef GKO_PUBLIC_CORE_BASE_MEMORY_HPP_
6 #define GKO_PUBLIC_CORE_BASE_MEMORY_HPP_
9 #include <ginkgo/core/base/fwd_decls.hpp>
10 #include <ginkgo/core/base/types.hpp>
24 virtual void* allocate(
size_type num_bytes) = 0;
26 virtual void deallocate(
void* ptr) = 0;
55 virtual bool check_environment(
int device_id, CUstream_st* stream)
const
80 virtual bool check_environment(
int device_id,
81 GKO_HIP_STREAM_STRUCT* stream)
const
93 void* allocate(
size_type num_bytes)
override;
95 void deallocate(
void* ptr)
override;
104 void* allocate(
size_type num_bytes)
override;
106 void deallocate(
void* ptr)
override;
115 void* allocate(
size_type num_bytes)
override;
117 void deallocate(
void* ptr)
override;
124 CUstream_st* stream_;
133 void* allocate(
size_type num_bytes)
override;
135 void deallocate(
void* ptr)
override;
142 bool check_environment(
int device_id, CUstream_st* stream)
const override;
155 void* allocate(
size_type num_bytes)
override;
157 void deallocate(
void* ptr)
override;
162 bool check_environment(
int device_id, CUstream_st* stream)
const override;
174 void* allocate(
size_type num_bytes)
override;
176 void deallocate(
void* ptr)
override;
185 void* allocate(
size_type num_bytes)
override;
187 void deallocate(
void* ptr)
override;
192 bool check_environment(
int device_id,
193 GKO_HIP_STREAM_STRUCT* stream)
const override;
196 GKO_HIP_STREAM_STRUCT* stream_;
205 void* allocate(
size_type num_bytes)
override;
207 void deallocate(
void* ptr)
override;
214 bool check_environment(
int device_id,
215 GKO_HIP_STREAM_STRUCT* stream)
const override;
228 void* allocate(
size_type num_bytes)
override;
230 void deallocate(
void* ptr)
override;
235 bool check_environment(
int device_id,
236 GKO_HIP_STREAM_STRUCT* stream)
const override;
246 #endif // GKO_PUBLIC_CORE_BASE_MEMORY_HPP_
std::size_t size_type
Integral type used for allocation quantities.
Definition: types.hpp:86
bool check_environment(int device_id, CUstream_st *stream) const override
Checks if the allocator can be used safely with the provided device ID and stream.
This is the Executor subclass which represents the HIP enhanced device.
Definition: executor.hpp:1777
Definition: memory.hpp:172
This is the Executor subclass which represents the CUDA device.
Definition: executor.hpp:1540
The Ginkgo namespace.
Definition: abstract_factory.hpp:20
Implement this interface to provide an allocator for OmpExecutor or ReferenceExecutor.
Definition: memory.hpp:34
Definition: memory.hpp:131
Definition: memory.hpp:203
Definition: memory.hpp:153
Implement this interface to provide an allocator for HipExecutor.
Definition: memory.hpp:65
Allocator using cudaMalloc.
Definition: memory.hpp:102
Allocator using new/delete.
Definition: memory.hpp:91
Provides generic allocation and deallocation functionality to be used by an Executor.
Definition: memory.hpp:20
Definition: memory.hpp:183
Implement this interface to provide an allocator for CudaExecutor.
Definition: memory.hpp:40
Definition: memory.hpp:226
Definition: memory.hpp:113