Exemplo n.º 1
0
        /// <summary cref="MemoryBuffer.MemSetToZero(AcceleratorStream)"/>
        public override void MemSetToZero(AcceleratorStream stream)
        {
            var binding = Accelerator.BindScoped();

            CudaException.ThrowIfFailed(
                CurrentAPI.Memset(
                    NativePtr,
                    0,
                    new IntPtr(LengthInBytes),
                    stream));

            binding.Recover();
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        protected internal override unsafe void MemSetInternal(
            AcceleratorStream stream,
            byte value,
            long offsetInBytes,
            long lengthInBytes)
        {
            var binding = Accelerator.BindScoped();

            CudaException.ThrowIfFailed(
                CurrentAPI.Memset(
                    new IntPtr(NativePtr.ToInt64() + offsetInBytes),
                    value,
                    new IntPtr(lengthInBytes),
                    stream));

            binding.Recover();
        }