/// <summary> /// Create an opencl kernel /// </summary> /// <param name="kernelName">The name of the kernel</param> /// <param name="programSource">The program source code</param> /// <param name="buildOps">The build options</param> /// <param name="errMsg">Option error message container that can be passed to this function</param> /// <returns>True if the kernel can be created</returns> public bool Create(String kernelName, OclProgramSource programSource, String buildOps = null, CvString errMsg = null) { using (CvString cs = new CvString(kernelName)) using (CvString buildOptStr = new CvString(buildOps)) { return(OclInvoke.oclKernelCreate(_ptr, cs, programSource, buildOptStr, errMsg)); } }
/// <summary> /// Release all the unmanaged memory associated with this OclInfo /// </summary> protected override void DisposeObject() { if (_needDispose) { if (_ptr != IntPtr.Zero) { OclInvoke.oclDeviceRelease(ref _ptr); } } }
/// <summary> /// Create a empty OclDevice object /// </summary> public OclDevice() : this(OclInvoke.oclDeviceCreate(), true) { }
/// <summary> /// Create an opencl kernel /// </summary> public OclKernel() { _ptr = OclInvoke.oclKernelCreateDefault(); }
/// <summary> /// Get all the platform info as a vector /// </summary> /// <returns>The vector of Platfom info</returns> public static Util.VectorOfOclPlatformInfo GetPlatformInfo() { Util.VectorOfOclPlatformInfo result = new Util.VectorOfOclPlatformInfo(); OclInvoke.oclGetPlatformsInfo(result); return(result); }
/// <summary> /// Set the native device pointer /// </summary> /// <param name="nativeDevicePointer"></param> public void Set(IntPtr nativeDevicePointer) { OclInvoke.oclDeviceSet(_ptr, nativeDevicePointer); }
protected override void DisposeObject() { OclInvoke.oclProgramSourceRelease(ref _ptr); _programSource.Dispose(); }
public OclProgramSource(String source) { _programSource = new CvString(source); _ptr = OclInvoke.oclProgramSourceCreate(_programSource); }