#pragma once
#include "platform.h"
#include <vector>
#include <set>
namespace embree
{
#if defined(EMBREE_SYCL_SUPPORT)
void enableUSMAllocEmbree(sycl::context* context, sycl::device* device);
void enableUSMAllocTutorial(sycl::context* context, sycl::device* device);
void disableUSMAllocEmbree();
void disableUSMAllocTutorial();
#endif
#define ALIGNED_STRUCT_(align) …
#define ALIGNED_STRUCT_USM_(align) …
#define ALIGNED_CLASS_(align) …
#define ALIGNED_CLASS_USM_(align) …
enum EmbreeUSMMode { … };
void* alignedMalloc(size_t size, size_t align);
void alignedFree(void* ptr);
void* alignedUSMMalloc(size_t size, size_t align = 16, EmbreeUSMMode mode = EMBREE_USM_SHARED_DEVICE_READ_ONLY);
void alignedUSMFree(void* ptr);
#if defined(EMBREE_SYCL_SUPPORT)
void* alignedSYCLMalloc(sycl::context* context, sycl::device* device, size_t size, size_t align, EmbreeUSMMode mode);
void alignedSYCLFree(sycl::context* context, void* ptr);
template<typename T>
struct sycl_deleter
{
void operator()(T const* ptr)
{
alignedUSMFree((void*)ptr);
}
};
#endif
template<typename T, size_t alignment>
struct aligned_allocator
{ … };
bool win_enable_selockmemoryprivilege(bool verbose);
bool os_init(bool hugepages, bool verbose);
void* os_malloc (size_t bytes, bool& hugepages);
size_t os_shrink (void* ptr, size_t bytesNew, size_t bytesOld, bool hugepages);
void os_free (void* ptr, size_t bytes, bool hugepages);
void os_advise (void* ptr, size_t bytes);
template<typename T>
struct os_allocator
{ … };
template<typename T>
struct no_allocator
{ … };
template<typename T, size_t max_id>
struct IDPool
{ … };
}