如何在 cuda 5.5 中获得最大推力块 [英] how to get max blocks in thrust in cuda 5.5

查看:34
本文介绍了如何在 cuda 5.5 中获得最大推力块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的 Thrust 函数可以获得 CUDA 启动 CUDA 5.0 的最大块数,该函数用于 CUSP 中的稀疏矩阵向量乘法 (SpMV),它是一种为持久线程设置执行的技术.第一行是头文件.

The Thrust function below can get the maximum blocks of for a CUDA launch CUDA 5.0, which is used by Sparse Matrix Vector multiplication(SpMV) in CUSP, and it is a technique for setting up execution for persistent threads. The first line is the header file.

#include <thrust/detail/backend/cuda/arch.h>

thrust::detail::backend::cuda::arch::max_active_blocks(kernel<float,int,VECTORS_PER_BLOCK,TH    READS_PER_VECTOR>,THREADS_PER_BLOCK,(size_t)0)

但 CUDA 5.5 不支持该功能.CUDA 5.5 是否不支持这种技术,还是应该使用其他功能?

But the function is not supported by CUDA 5.5. Was this technique not supported by CUDA 5.5, or should I use some other function instead?

推荐答案

在任何版本的 Thrust 中都没有任何支持的方式来执行此计算.thrust/detail 内的标头和 detail 命名空间内的标识符是 Thrust 实现的一部分——它们不是公共特性.使用它们会破坏您的代码.

There was never any supported way to perform this computation in any version of Thrust. Headers inside thrust/detail and identifiers inside a detail namespace are part of Thrust's implementation -- they are not public features. Using them will break your code.

也就是说,在这个存储库中有一些实现占用计算器的独立代码:

That said, there's some standalone code implementing the occupancy calculator in this repository:

https://github.com/jaredhoberock/cuda_launch_config

这篇关于如何在 cuda 5.5 中获得最大推力块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆