Tag: cudafy.net

为什么在CUDA内核中z始终为零

我正在使用Cudafy在NVIDIA GPU上进行一些计算。 (Quadro K1100Mfunction3.0,如果重要的话) 我的问题是,当我使用以下内容时 cudaGpu.Launch(new dim3(44,8,num), new dim(8, 8)).MyKernel… 当我在内核中使用它时,为什么来自GThread实例的z索引总是为零? int z = thread.blockIdx.z * thread.blockDim.z + thread.threadIdx.z; 此外,如果我必须做类似的事情 cudaGpu.Launch(new dim3(44,8,num), new dim(8, 8, num)).MyKernel… z确实提供了不同的索引,但由于每个块的线程数限制,num不能很大。 有关如何解决这个问题的任何消息? 编辑 另一种表达方式。 当块大小仅为2D时,我可以在我的内核中使用thread.z(对于任何有用的东西)吗?

使用Cudafy时避免使用nvcc编译

我正在使用Cudafy并希望我的用户能够在不安装CUDA SDK的情况下使用CUDA,但他们可以使用Cudafy DLL。 为了避免在CudafyTranslator.Cudafy(types)自动完成nvcc编译,我使用以下方法: string directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string modulePath = Path.Combine(directory, myType.Name + “.cdfy”); CudafyModule km = CudafyModule.TryDeserialize(modulePath); if (ReferenceEquals(km, null) || !km.TryVerifyChecksums()) { km = CudafyTranslator.Cudafy(types); km.Serialize(modulePath); } GPU.LoadModule(km); 其中types是System.Type的数组。 问题出在第三行, TryDeserialize总是返回null 。 我已检查文件是否存在且modulePath是否正确且文件是否存在。 有人可以就这件事情说清楚吗? 如果它不意味着重写我的Cudafy模块,我准备改变我的方法。

CUDAfy.NET给出Win32Exception:系统找不到指定的文件

我通过NuGet添加了对CUDAfy.NET库的引用。 当我运行我的程序时,我遇到了Win32Exception : 该系统找不到指定的文件 这发生在程序的第一个实际行上: CudafyModule km = CudafyTranslator.Cudafy(); exception对象没有指示他们正在尝试加载哪个文件。 我怎样才能解决这个问题? 编辑 在使用.NET 4.0在VS2010中运行Codeplex下载的捆绑示例时,我看到了同样的exception。 Strack trace是: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at Cudafy.CudafyModule.Compile(eGPUCompiler mode, Boolean deleteGeneratedCode) at Cudafy.Translator.CudafyTranslator.Cudafy(ePlatform platform, eArchitecture arch, Version cudaVersion, Boolean compile, Type[] types) at Cudafy.Translator.CudafyTranslator.Cudafy(ePlatform platform, eArchitecture arch, Type[] types) at Cudafy.Translator.CudafyTranslator.Cudafy()