Class TransferOptions
- Namespace
- DotCompute.Memory.Types
- Assembly
- DotCompute.Memory.dll
Configuration options for memory transfer operations.
public class TransferOptions
- Inheritance
-
TransferOptions
- Derived
- Inherited Members
Remarks
This class provides comprehensive configuration for memory transfers, including performance optimizations, data integrity options, and resource constraints.
Properties
BufferPoolSize
Gets or sets the buffer pool size for reusable buffers.
public int BufferPoolSize { get; set; }
Property Value
- int
The maximum number of buffers to pool. Default is 10.
ChunkSize
Gets or sets the chunk size for streaming transfers.
public int ChunkSize { get; set; }
Property Value
- int
The size of each chunk in bytes. Default is 64MB.
CompressionLevel
Gets or sets the compression level when compression is enabled.
public int CompressionLevel { get; set; }
Property Value
- int
The compression level (0 = no compression, 9 = maximum compression). Default is 6.
Default
Gets a default set of transfer options optimized for general use.
public static TransferOptions Default { get; }
Property Value
- TransferOptions
Default transfer options.
EnableCompression
Gets or sets a value indicating whether to enable compression.
public bool EnableCompression { get; set; }
Property Value
- bool
True to compress data during transfer; otherwise, false.
EnableMemoryMapping
Gets or sets a value indicating whether to use memory mapping for large transfers.
public bool EnableMemoryMapping { get; set; }
Property Value
- bool
True to use memory-mapped files for large datasets; otherwise, false.
EnableProgressReporting
Gets or sets a value indicating whether to enable progress reporting.
public bool EnableProgressReporting { get; set; }
Property Value
- bool
True to report transfer progress; otherwise, false.
IntegritySampleRate
Gets or sets the sample rate for integrity verification.
public double IntegritySampleRate { get; set; }
Property Value
- double
The fraction of data to sample for verification (0.0 to 1.0). Default is 0.01 (1%).
IntegritySampleSize
Gets or sets the sample size for integrity verification.
public int IntegritySampleSize { get; set; }
Property Value
- int
The number of bytes to sample for verification. Default is 1000 bytes.
LargeTransfer
Gets transfer options optimized for large transfers.
public static TransferOptions LargeTransfer { get; }
Property Value
- TransferOptions
Options optimized for transfers over 100MB.
MaxRetryAttempts
Gets or sets the maximum number of retry attempts for failed transfers.
public int MaxRetryAttempts { get; set; }
Property Value
- int
The maximum number of retries. Default is 3.
MemoryMappingThreshold
Gets or sets the threshold for using memory mapping.
public long MemoryMappingThreshold { get; set; }
Property Value
- long
The minimum size in bytes for which memory mapping is considered. Default is 256MB.
MemoryOptions
Gets or sets the memory options for allocation.
public MemoryOptions MemoryOptions { get; set; }
Property Value
- MemoryOptions
The memory allocation options.
OptimizeForThroughput
Gets or sets a value indicating whether to optimize for throughput.
public bool OptimizeForThroughput { get; set; }
Property Value
- bool
True to optimize for maximum throughput; false to optimize for latency.
PinMemory
Gets or sets a value indicating whether to pin memory during transfer.
public bool PinMemory { get; set; }
Property Value
- bool
True to pin memory to prevent GC movement; otherwise, false.
Priority
Gets or sets the priority of the transfer operation.
public int Priority { get; set; }
Property Value
- int
The transfer priority (0 = lowest, 10 = highest). Default is 5.
ProgressReportInterval
Gets or sets the progress reporting interval.
public TimeSpan ProgressReportInterval { get; set; }
Property Value
- TimeSpan
The interval between progress reports. Default is 100ms.
RetryDelay
Gets or sets the delay between retry attempts.
public TimeSpan RetryDelay { get; set; }
Property Value
- TimeSpan
The time to wait between retries. Default is 1 second.
SmallTransfer
Gets transfer options optimized for small transfers.
public static TransferOptions SmallTransfer { get; }
Property Value
- TransferOptions
Options optimized for transfers under 1MB.
Streaming
Gets transfer options optimized for streaming.
public static TransferOptions Streaming { get; }
Property Value
- TransferOptions
Options optimized for continuous streaming transfers.
Timeout
Gets or sets the timeout for individual transfer operations.
public TimeSpan Timeout { get; set; }
Property Value
- TimeSpan
The timeout duration. Default is 5 minutes.
UseAsyncIO
Gets or sets a value indicating whether to use asynchronous I/O.
public bool UseAsyncIO { get; set; }
Property Value
- bool
True to use async I/O operations; otherwise, false. Default is true.
UseExponentialBackoff
Gets or sets a value indicating whether to use exponential backoff for retries.
public bool UseExponentialBackoff { get; set; }
Property Value
- bool
True to use exponential backoff; otherwise, false.
VerifyIntegrity
Gets or sets a value indicating whether to verify data integrity after transfer.
public bool VerifyIntegrity { get; set; }
Property Value
- bool
True to perform integrity verification; otherwise, false.
Methods
Clone()
Creates a copy of these transfer options.
public TransferOptions Clone()
Returns
- TransferOptions
A new TransferOptions instance with the same values.