public readonly void ApplySyncInMainThread() { // Allocate the requested amount of elements var allocation = CPUMemoryBuffer.Create(Extent, Interop.SizeOf <T>()); // Publish the allocated shared memory source Parent.currentSharedMemorySource = allocation; Parent.sharedMemory.Add(allocation); }
public ArrayView <T> AllocateLocalMemory <T>(int extent) where T : unmanaged { var buffer = CPUMemoryBuffer.Create( Multiprocessor.Accelerator, extent, Interop.SizeOf <T>()); return(new ArrayView <T>(buffer, 0, extent)); }
/// <inheritdoc/> protected override MemoryBuffer AllocateRawInternal( long length, int elementSize) => CPUMemoryBuffer.Create(this, length, elementSize);