コード例 #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);