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

查看:158
本文介绍了如何获得最大块在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 中的标题和详细信息中的标识是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天全站免登陆