public Mem CreateBuffer(MemFlags flags, long size, void *pHost) { IntPtr memID; ErrorCode result; memID = (IntPtr)OpenCL.CreateBuffer(ContextID, (ulong)flags, new IntPtr(size), pHost, out result); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("CreateBuffer failed with error code " + result, result); } return(new Mem(this, memID)); }
public Mem CreateBuffer(MemFlags flags, long size, void *pHost) { Mem mem; IntPtr memID; ErrorCode result; memID = (IntPtr)OpenCL.CreateBuffer(ContextID, (ulong)flags, new IntPtr(size), pHost, out result); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("CreateBuffer failed with error code " + result, result); } mem = new Mem(this, memID); OpenCLObjectList[memID] = new WeakReference(mem); return(mem); }