• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# BasicTypes.SizeT类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ManagedCuda.BasicTypes.SizeT的典型用法代码示例。如果您正苦于以下问题:C# SizeT类的具体用法?C# SizeT怎么用?C# SizeT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SizeT类属于ManagedCuda.BasicTypes命名空间,在下文中一共展示了SizeT类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CudaSurface

		/// <summary>
		/// Creates a new surface from array memory. Allocates new array.
		/// </summary>
		/// <param name="kernel"></param>
		/// <param name="surfName"></param>
		/// <param name="flags"></param>
		/// <param name="format"></param>
		/// <param name="width">In elements</param>
		/// <param name="height">In elements</param>
		/// <param name="depth">In elements</param>
		/// <param name="numChannels"></param>
		/// <param name="arrayFlags"></param>
		public CudaSurface(CudaKernel kernel, string surfName, CUSurfRefSetFlags flags, CUArrayFormat format, SizeT width, SizeT height, SizeT depth, CudaArray3DNumChannels numChannels, CUDAArray3DFlags arrayFlags)
		{
			_surfref = new CUsurfref();
			res = DriverAPINativeMethods.ModuleManagement.cuModuleGetSurfRef(ref _surfref, kernel.CUModule, surfName);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}, Surface name: {3}", DateTime.Now, "cuModuleGetSurfRef", res, surfName));
			if (res != CUResult.Success) throw new CudaException(res);

			_flags = flags;
			_format = format;
			_height = height;
			_width = width;
			_depth = depth;
			_numChannels = (int)numChannels;
			_name = surfName;
			_module = kernel.CUModule;
			_cufunction = kernel.CUFunction;

			_channelSize = CudaHelperMethods.GetChannelSize(format);
			_dataSize = height * width * depth * _numChannels * _channelSize;
			_array = new CudaArray3D(format, width, height, depth, numChannels, arrayFlags);

			res = DriverAPINativeMethods.SurfaceReferenceManagement.cuSurfRefSetArray(_surfref, _array.CUArray, flags);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuSurfRefSetArray", res));
			if (res != CUResult.Success) throw new CudaException(res);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:37,代码来源:CudaSurface.cs


示例2: CudaRegisteredHostMemory_byte

		/// <summary>
		/// Creates a new CudaRegisteredHostMemory_byte from an existing IntPtr. IntPtr must be page size aligned (4KBytes)!
		/// </summary>
		/// <param name="hostPointer">must be page size aligned (4KBytes)</param>
		/// <param name="size">In elements</param>
		public CudaRegisteredHostMemory_byte(IntPtr hostPointer, SizeT size)
		{
			_intPtr = hostPointer;
			_size = size;
			_typeSize = (SizeT)Marshal.SizeOf(typeof(byte));
			_ptr = (byte*)_intPtr;
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:CudaRegisteredHostMemoryFixedTypes.cs


示例3: MyInputLayer

        public MyInputLayer(MyAbstractFeedForwardNode network, MyMemoryBlock<float> input, SizeT offset, SizeT nb, SizeT width, SizeT height, SizeT nbSamplesPerStep)
            : base(network)
        {
            m_inputBlock = input;
            m_inputOffset = offset;

            m_output.Nb = nb;
            m_output.Width = width;
            m_output.Height = height;

            m_nbSamplesPerStep = nbSamplesPerStep;
        }
开发者ID:Jlaird,项目名称:BrainSimulator,代码行数:12,代码来源:MyInputLayer.cs


示例4: CudaTextureArray2D

        /// <summary>
        /// Creates a new 2D texture from array memory. Allocates a new 2D array.
        /// </summary>
        /// <param name="kernel"></param>
        /// <param name="texName"></param>
        /// <param name="addressMode0"></param>
        /// <param name="addressMode1"></param>
        /// <param name="filterMode"></param>
        /// <param name="flags"></param>
        /// <param name="format"></param>
        /// <param name="height">In elements</param>
        /// <param name="width">In elements</param>
        /// <param name="numChannels">1,2 or 4</param>
        public CudaTextureArray2D(CudaKernel kernel, string texName, CUAddressMode addressMode0, CUAddressMode addressMode1, CUFilterMode filterMode, CUTexRefSetFlags flags, CUArrayFormat format, SizeT width, SizeT height, CudaArray2DNumChannels numChannels)
        {
            _texref = new CUtexref();
            res = DriverAPINativeMethods.ModuleManagement.cuModuleGetTexRef(ref _texref, kernel.CUModule, texName);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}, Texture name: {3}", DateTime.Now, "cuModuleGetTexRef", res, texName));
            if (res != CUResult.Success) throw new CudaException(res);

            res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetAddressMode(_texref, 0, addressMode0);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetAddressMode", res));
            if (res != CUResult.Success) throw new CudaException(res);
            res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetAddressMode(_texref, 1, addressMode1);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetAddressMode", res));
            if (res != CUResult.Success) throw new CudaException(res);
            res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetFilterMode(_texref, filterMode);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetFilterMode", res));
            if (res != CUResult.Success) throw new CudaException(res);
            res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetFlags(_texref, flags);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetFlags", res));
            if (res != CUResult.Success) throw new CudaException(res);
            res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetFormat(_texref, format, (int)numChannels);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetFormat", res));
            if (res != CUResult.Success) throw new CudaException(res);

            _filtermode = filterMode;
            _flags = flags;
            _addressMode0 = addressMode0;
            _addressMode1 = addressMode1;
            _format = format;
            _height = height;
            _width = width;
            _numChannels = (int)numChannels;
            _name = texName;
            _module = kernel.CUModule;
            _cufunction = kernel.CUFunction;

            _channelSize = CudaHelperMethods.GetChannelSize(format);
            _dataSize = height * width * _numChannels * _channelSize;
            _array = new CudaArray2D(format, width, height, numChannels);

            res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetArray(_texref, _array.CUArray, CUTexRefSetArrayFlags.OverrideFormat);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetArray", res));
            if (res != CUResult.Success) throw new CudaException(res);
            //res = DriverAPINativeMethods.ParameterManagement.cuParamSetTexRef(kernel.CUFunction, CUParameterTexRef.Default, _texref);
            //Debug.WriteLine("{0:G}, {1}: {2}", DateTime.Now, "cuParamSetTexRef", res);
            //if (res != CUResult.Success) throw new CudaException(res);
        }
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:59,代码来源:CudaTextureArray2D.cs


示例5: CudaFFTPlanMany64

		/// <summary>
		/// Creates a FFT plan configuration of dimension rank, with sizes
		/// specified in the array <c>n</c>. The <c>batch</c> input parameter tells CUFFT how
		/// many transforms to configure in parallel. With this function, batched
		/// plans of any dimension may be created. (new API)
		/// </summary>
		/// <param name="handle">cufftHandle object</param>
		/// <param name="rank">Dimensionality of the transform (1, 2, or 3)</param>
		/// <param name="n">An array of size rank, describing the size of each dimension</param>
		/// <param name="batch">Batch size for this transform</param>
		/// <param name="type">Transform data type (e.g., C2C, as per other CUFFT calls)</param>
		/// <param name="size"></param>
		public CudaFFTPlanMany64(cufftHandle handle, int rank, long[] n, long batch, cufftType type, ref SizeT size)
		{
			_handle = handle;
			_rank = rank;
			_n = n;
			_batch = batch;
			_type = type;

			//optional:
			_inembed = null;
			_istride = 1;
			_idist = 0;
			_onembed = null;
			_ostride = 1;
			_odist = 0;
			res = CudaFFTNativeMethods.cufftMakePlanMany64(_handle, _rank, _n, _inembed, _istride, _idist, _onembed, _ostride, _odist, _type, _batch, ref size);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cufftMakePlanMany64", res));
			if (res != cufftResult.Success)
				throw new CudaFFTException(res);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:32,代码来源:CudaFFTPlanMany64.cs


示例6: cuGraphicsResourceGetMappedPointer_v2

 public static extern CUResult cuGraphicsResourceGetMappedPointer_v2(ref CUdeviceptr pDevPtr, ref SizeT pSize, CUgraphicsResource resource);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:1,代码来源:DriverAPI.cs


示例7: cuMemAlloc_v2

 public static extern CUResult cuMemAlloc_v2(ref CUdeviceptr dptr, SizeT bytesize);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:1,代码来源:DriverAPI.cs


示例8: cuMemGetInfo_v2

 public static extern CUResult cuMemGetInfo_v2(ref SizeT free, ref SizeT total);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:1,代码来源:DriverAPI.cs


示例9: cuLinkComplete

 public static extern CUResult cuLinkComplete(CUlinkState state, ref IntPtr cubinOut, ref SizeT sizeOut);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:1,代码来源:DriverAPI.cs


示例10: cusparseZbsrsv2_bufferSizeExt

		public static extern cusparseStatus cusparseZbsrsv2_bufferSizeExt(cusparseContext handle,
														cusparseDirection dirA,
														cusparseOperation transA,
														int mb,
														int nnzb,
														cusparseMatDescr descrA,
														CUdeviceptr bsrVal,
														CUdeviceptr bsrRowPtr,
														CUdeviceptr bsrColInd,
														int blockDim,
														bsrsv2Info info,
														ref SizeT pBufferSize);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:CudaSparseNativeMethods.cs


示例11: cusparseZcsru2csr_bufferSizeExt

		public static extern cusparseStatus cusparseZcsru2csr_bufferSizeExt(cusparseContext handle,
                                                             int m,
                                                             int n,
                                                             int nnz,
                                                             CUdeviceptr csrVal,
                                                             CUdeviceptr csrRowPtr,
                                                             CUdeviceptr csrColInd,
                                                             csru2csrInfo  info,
                                                             ref SizeT pBufferSizeInBytes);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:9,代码来源:CudaSparseNativeMethods.cs


示例12: cusparseXcoosort_bufferSizeExt

		public static extern cusparseStatus cusparseXcoosort_bufferSizeExt(cusparseContext handle,
                                                            int m,
                                                            int n,
                                                            int nnz,
                                                            CUdeviceptr cooRowsA,
                                                            CUdeviceptr cooColsA,
                                                            ref SizeT pBufferSizeInBytes);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:7,代码来源:CudaSparseNativeMethods.cs


示例13: cusparseZgebsr2gebsc_bufferSizeExt

		public static extern cusparseStatus cusparseZgebsr2gebsc_bufferSizeExt(cusparseContext handle,
															 int mb,
															 int nb,
															 int nnzb,
															 CUdeviceptr bsrVal,
															 CUdeviceptr bsrRowPtr,
															 CUdeviceptr bsrColInd,
															 int rowBlockDim,
															 int colBlockDim,
															 ref SizeT pBufferSize);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:10,代码来源:CudaSparseNativeMethods.cs


示例14: cusparseDcsrilu02_bufferSizeExt

		public static extern cusparseStatus cusparseDcsrilu02_bufferSizeExt(cusparseContext handle,
														  int m,
														  int nnz,
														  cusparseMatDescr descrA,
														  CUdeviceptr csrValA,
														  CUdeviceptr csrRowPtrA,
														  CUdeviceptr csrColIndA,
														  csrilu02Info info,
														  ref SizeT pBufferSize);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:9,代码来源:CudaSparseNativeMethods.cs


示例15: cuStreamAttachMemAsync

			public static extern CUResult cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, SizeT length, CUmemAttach_flags flags);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:1,代码来源:DriverAPI.cs


示例16: cuModuleGetGlobal_v2

 public static extern CUResult cuModuleGetGlobal_v2(ref CUdeviceptr dptr, ref SizeT bytes, CUmodule hmod, string name);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:1,代码来源:DriverAPI.cs


示例17: cuTexRefSetAddress2D_v2

 public static extern CUResult cuTexRefSetAddress2D_v2(CUtexref hTexRef, ref CUDAArrayDescriptor desc, CUdeviceptr dptr, SizeT Pitch);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:1,代码来源:DriverAPI.cs


示例18: cuTexRefSetAddress_v2

 public static extern CUResult cuTexRefSetAddress_v2(ref SizeT ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, SizeT bytes);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:1,代码来源:DriverAPI.cs


示例19: cusparseZcsrgemm2_bufferSizeExt

		public static extern cusparseStatus cusparseZcsrgemm2_bufferSizeExt(cusparseContext handle,
															 int m,
															 int n,
															 int k,
															 CUdeviceptr alpha,
															 cusparseMatDescr descrA,
															 int nnzA,
															 CUdeviceptr csrSortedRowPtrA,
															 CUdeviceptr csrSortedColIndA,
															 cusparseMatDescr descrB,
															 int nnzB,
															 CUdeviceptr csrSortedRowPtrB,
															 CUdeviceptr csrSortedColIndB,
															 CUdeviceptr beta,
															 cusparseMatDescr descrD,
															 int nnzD,
															 CUdeviceptr csrSortedRowPtrD,
															 CUdeviceptr csrSortedColIndD,
															 csrgemm2Info info,
															 ref SizeT pBufferSizeInBytes);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:20,代码来源:CudaSparseNativeMethods.cs


示例20: cuCtxSetLimit

 public static extern CUResult cuCtxSetLimit(CULimit limit, SizeT value);
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:1,代码来源:DriverAPI.cs



注:本文中的ManagedCuda.BasicTypes.SizeT类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CudaBlas.CudaBlasHandle类代码示例发布时间:2022-05-26
下一篇:
C# BasicTypes.CUstream类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap