Backends/SiaNet.Backend.TensorSharp/Cuda/ContextState/BasicDeviceAllocator.cs
/// <summary>
/// Allocates the specified byte count.
/// </summary>
/// <param name="byteCount">The byte count.</param>
/// <returns>IDeviceMemory.</returns>
Allocates the specified byte count.
Allocates the specified byte count .
public IDeviceMemory Allocate(long byteCount)
        {
            var buffer = context.AllocateMemory(byteCount);
            return new BasicDeviceMemory(buffer, () => context.FreeMemory(buffer));
        }
public IDeviceMemory Allocate ( long byteCount ) { var buffer = context . AllocateMemory ( byteCount ) ; return new BasicDeviceMemory ( buffer , ( ) => context . FreeMemory ( buffer ) ) ; }
Allocates the specified byte count.
Allocates the specified byte count .
None
byteCount
long
The byte count.
The byte count .