随笔分类 -  cuda

摘要:懒得自己写了,就使用了thrust的api算了。还挺不错。cuda程序#include #include #include int main(){ float* deviceArray; float max, test; int length = 1025; ... 阅读全文
posted @ 2018-04-26 14:52 开往春天的拖拉机 阅读(297) 评论(0) 推荐(0)
摘要:cuda可以用kernal调用kernal但是必须在计算能力sm35以上#include #include #include #include // 定义一个 4*4 的矩阵来做 加法和减法#define WIDTH 4 // 定义 子内核// 子内核 对 矩阵中... 阅读全文
posted @ 2018-01-02 19:50 开往春天的拖拉机 阅读(153) 评论(0) 推荐(0)
摘要:通过sample的例子自己改编的一个例子#include #define BLOCK_DIM 5// Transpose kernel (see transpose CUDA Sample for details)__global__ void d_transpose... 阅读全文
posted @ 2017-05-25 17:02 开往春天的拖拉机 阅读(170) 评论(0) 推荐(0)
摘要:加法代码参考了别人的博客#include #include //#include "kmeans.h" using namespace std; const int count = 1000; void generate_data(int *... 阅读全文
posted @ 2017-05-10 15:10 开往春天的拖拉机 阅读(115) 评论(0) 推荐(0)