#ifndef GRAPH_UTILS_ALLOC_HPP
#define GRAPH_UTILS_ALLOC_HPP
#include "graph/interface/c_types_map.hpp"
#include "graph/utils/utils.hpp"
#ifdef DNNL_WITH_SYCL
#include "oneapi/dnnl/dnnl_sycl.hpp"
#endif
#if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
#include "graph/utils/ocl_check.hpp"
#endif
namespace dnnl {
namespace impl {
namespace graph {
namespace utils {
class cpu_allocator_t {
public:
constexpr static size_t DEFAULT_ALIGNMENT = 64;
static void *malloc(size_t size, size_t alignment);
static void free(void *p);
};
#ifdef DNNL_WITH_SYCL
class sycl_allocator_t {
public:
constexpr static size_t DEFAULT_ALIGNMENT = 64;
static void *malloc(
size_t size, size_t alignment, const void *dev, const void *ctx);
static void free(void *ptr, const void *dev, const void *ctx, void *event);
};
#endif
#if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
class ocl_allocator_t {
public:
static void *malloc(
size_t size, size_t alignment, cl_device_id dev, cl_context ctx);
static void free(
void *ptr, cl_device_id dev, cl_context ctx, cl_event event);
};
#endif
} } } } #endif