24 template<USMKindTarget target>
26 size_t sz, std::shared_ptr<DeviceScheduler> dev_sched, std::optional<size_t> alignment) {
28 sycl::context &sycl_ctx = dev_sched->ctx->ctx;
29 sycl::device &dev = dev_sched->ctx->device->dev;
30 void *usm_ptr = details::internal_alloc<target>(sz, dev_sched, alignment);
35 template<USMKindTarget target>
37 std::shared_ptr<DeviceScheduler> dev_sched) {
39 sycl::context &sycl_ctx = dev_sched->ctx->ctx;
40 sycl::device &dev = dev_sched->ctx->device->dev;
41 void *usm_ptr =
nullptr;
46 template<USMKindTarget target>
48 if (usm_ptr !=
nullptr) {
49 details::internal_free<target>(usm_ptr, get_bytesize(), dev_sched);
54 template<USMKindTarget target>
This file contains the declaration of the USMPtrHolder class.
Class for holding a USM pointer.
void free_ptr()
Free the held pointer.
~USMPtrHolder()
USM pointer holder destructor.
static USMPtrHolder create(size_t sz, std::shared_ptr< DeviceScheduler > dev_sched, std::optional< size_t > alignment=std::nullopt)
Create a USM pointer holder.
This file contains the methods to actually allocate memory.
namespace for backends this one is named only sham since shambackends is too long to write