Пример #1
0
            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);
            }
Пример #2
0
        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));
        }
Пример #3
0
 /// <inheritdoc/>
 protected override MemoryBuffer AllocateRawInternal(
     long length,
     int elementSize) =>
 CPUMemoryBuffer.Create(this, length, elementSize);