Exemple #1
0
 /// <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));
         }
 }
Exemple #2
0
 /// <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);
         }
     }
 }
Exemple #3
0
 /// <summary>
 /// Create a empty OclDevice object
 /// </summary>
 public OclDevice()
     : this(OclInvoke.oclDeviceCreate(), true)
 {
 }
Exemple #4
0
 /// <summary>
 /// Create an opencl kernel
 /// </summary>
 public OclKernel()
 {
     _ptr = OclInvoke.oclKernelCreateDefault();
 }
Exemple #5
0
 /// <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);
 }
Exemple #6
0
 /// <summary>
 /// Set the native device pointer
 /// </summary>
 /// <param name="nativeDevicePointer"></param>
 public void Set(IntPtr nativeDevicePointer)
 {
     OclInvoke.oclDeviceSet(_ptr, nativeDevicePointer);
 }
Exemple #7
0
 protected override void DisposeObject()
 {
     OclInvoke.oclProgramSourceRelease(ref _ptr);
     _programSource.Dispose();
 }
Exemple #8
0
 public OclProgramSource(String source)
 {
     _programSource = new CvString(source);
     _ptr           = OclInvoke.oclProgramSourceCreate(_programSource);
 }