public static OpenCLErrorCode GetImageInfo(IMemoryObject image,
                                      ImageInfo paramName,
                                      IntPtr paramValueSize,
                                      InfoBuffer paramValue,
                                      out IntPtr paramValueSizeRet)
 {
     return clGetImageInfo((image as IHandleData).Handle, paramName, paramValueSize, paramValue.Address, out paramValueSizeRet);
 }
        /// <summary>
        /// Determines whether the specified <see cref="NetScriptFramework.IMemoryObject" />, is equal to this instance. If the specified object
        /// is not a <see cref="NetScriptFramework.IMemoryObject" /> or is null then this method will return false!
        /// </summary>
        /// <param name="obj">The <see cref="NetScriptFramework.IMemoryObject" /> to compare with this instance.</param>
        /// <returns>
        ///   <c>true</c> if the specified <see cref="NetScriptFramework.IMemoryObject" /> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(IMemoryObject obj)
        {
            var mo = obj as MemoryObject;

            if (mo != null)
            {
                return(this.Address == mo.Address);
            }
            return(false);
        }
        public void Copy <T>(IMemoryObject <T> source, IMemoryObject <T> destination, uint destinationStart, uint length) where T : struct, IEquatable <T>
        {
            if (destination == null)
            {
                throw new ArgumentNullException("source is null");
            }
            if (destination == null)
            {
                throw new ArgumentNullException("destination is null");
            }
            if (destination.Length - destinationStart < length)
            {
                throw new IndexOutOfRangeException("The length exceeds the copy destination range");
            }
            if (source.Length - destinationStart < length)
            {
                throw new IndexOutOfRangeException("The length exceeds the copy source range");
            }

            var itemSize = (uint)source.ItemSize;

            Copy(source.Pointer, destination.Pointer, destinationStart * itemSize, length * itemSize);
        }
Beispiel #4
0
 public static IMemoryObject CreateRef(this IMemoryObject objectRef) =>
 ((IMemoryObject)objectRef.CreateRef(typeof(IMemoryObject)));
Beispiel #5
0
 public MemoryObjectStream(IMemoryObject <T> memory)
 {
     _Memory = memory;
 }
 public static OpenCLErrorCode RetainMemObject(IMemoryObject memObj)
 {
     return clRetainMemObject((memObj as IRefCountedHandle).Handle);
 }