MCPcopy Create free account
hub / github.com/RenderKit/embree / alignedSYCLMalloc

Function alignedSYCLMalloc

common/sys/alloc.cpp:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#if defined(EMBREE_SYCL_SUPPORT)
35
36 void* alignedSYCLMalloc(sycl::context* context, sycl::device* device, size_t size, size_t align, EmbreeUSMMode mode)
37 {
38 assert(context);
39 assert(device);
40
41 if (size == 0)
42 return nullptr;
43
44 assert((align & (align-1)) == 0);
45
46 void* ptr = nullptr;
47 if (mode == EmbreeUSMMode::DEVICE_READ_ONLY)
48 ptr = sycl::aligned_alloc_shared(align,size,*device,*context,sycl::ext::oneapi::property::usm::device_read_only());
49 else
50 ptr = sycl::aligned_alloc_shared(align,size,*device,*context);
51
52 if (size != 0 && ptr == nullptr)
53 throw std::bad_alloc();
54
55 return ptr;
56 }
57
58 void* alignedSYCLMalloc(sycl::context* context, sycl::device* device, size_t size, size_t align, EmbreeUSMMode mode, EmbreeMemoryType type)
59 {

Callers 2

mallocMethod · 0.85
alignedUSMMallocFunction · 0.85

Calls 1

alignedMallocFunction · 0.85

Tested by

no test coverage detected