Ejemplo n.º 1
0
        public Image CreateImage2D(MemFlags flags, ImageFormat imageFormat, IntPtr imageWidth, IntPtr imageHeight, IntPtr imageRowPitch, IntPtr pHost)
        {
            IntPtr    memID;
            ErrorCode result;

            memID = (IntPtr)OpenCL.CreateImage2D(ContextID, (ulong)flags, imageFormat, imageWidth, imageHeight, imageRowPitch, pHost.ToPointer(), out result);
            if (result != ErrorCode.SUCCESS)
            {
                throw new OpenCLException("CreateImage2D failed with error code " + result, result);
            }
            return(new Image(this, memID));
        }
Ejemplo n.º 2
0
        public CLImage CreateImage2D(MemFlags flags, CLImageFormat imageFormat, IntPtr imageWidth, IntPtr imageHeight, IntPtr imageRowPitch, IntPtr pHost)
        {
            CLImage   mem;
            IntPtr    memID;
            ErrorCode result;

            memID = (IntPtr)OpenCL.CreateImage2D(ContextID, (ulong)flags, imageFormat, imageWidth, imageHeight, imageRowPitch, pHost.ToPointer(), out result);
            if (result != ErrorCode.SUCCESS)
            {
                throw new OpenCLException("CreateImage2D failed with error code " + result, result);
            }
            mem = new CLImage(this, memID);
            OpenCLObjectList[memID] = new WeakReference(mem);
            return(mem);
        }