/// <summary> /// allocates new matrix data unless the matrix already has specified size and type. /// </summary> /// <param name="rows">Number of rows in a 2D array.</param> /// <param name="cols">Number of columns in a 2D array.</param> /// <param name="type">Array type. </param> /// <param name="allocType"></param> public void Create( int rows, int cols, MatType type, CudaMemAllocType allocType = CudaMemAllocType.Locked) { ThrowIfDisposed(); NativeMethods.gpu_CudaMem_create(ptr, rows, cols, type, (int)allocType); }
/// <summary> /// /// </summary> /// <param name="size">2D array size: Size(cols, rows) </param> /// <param name="type">Array type. </param> /// <param name="allocType"></param> public CudaMem(Size size, MatType type, CudaMemAllocType allocType = CudaMemAllocType.Locked) : this(size.Height, size.Width, type, allocType) { }
/// <summary> /// /// </summary> /// <param name="rows">Number of rows in a 2D array.</param> /// <param name="cols">Number of columns in a 2D array.</param> /// <param name="type">Array type. </param> /// <param name="allocType"></param> public CudaMem(int rows, int cols, MatType type, CudaMemAllocType allocType = CudaMemAllocType.Locked) { ThrowIfNotAvailable(); ptr = NativeMethods.gpu_CudaMem_new3(rows, cols, type, (int)allocType); }