CUDA
古路
这个作者很懒,什么都没留下…
展开
-
查看自己GPU参数
查看自己GPU参数0.引言1.Detect2.result0.引言了解自己的GPU参数很重要.1.Detect在sample里面编译deviceQuery查看。CMakeLists.txt添加(/usr/local/cuda-10.1/samples/common/inc/)不然有些头文件无法找到.CMakeLists.txtcmake_minimum_required(VERSIO...原创 2019-11-25 17:21:11 · 2265 阅读 · 0 评论 -
CUDA CMakeLists
CUDA CMakeLists0.引言1.CMakeLists.txt0.引言gcc:编译c文件g++:编译cpp文件nvcc:编译cu文件如何编译带有CUDA程序的*.cpp文件?1.CMakeLists.txtcmake_minimum_required(VERSION 2.8)project(tsdf)# packagesfind_package(CUDA)set...原创 2019-11-25 16:51:33 · 1691 阅读 · 0 评论 -
GPU直方图统计
GPU直方图统计0.引言1.code2.result0.引言1.code#include <stdio.h>#include <cuda_runtime.h>__global__ void histo(int *d_bins, const int *d_in, const int BIN_COUNT){ int idx = threadIdx.x;...原创 2019-11-21 23:00:23 · 398 阅读 · 0 评论 -
扫描算法
扫描算法0.引言1.code2.result0.引言1.code#include <stdio.h>__global__ void global_scan(float* d_out,float* d_in){ int idx = threadIdx.x; float out = 0.00f; d_out[idx] = d_in[idx]; __syncthre...原创 2019-11-21 23:03:19 · 2748 阅读 · 0 评论 -
规约算法.求内积
规约算法.求内积0.引言1.code2.result0.引言内积:d=⟨x,y⟩d=\langle x, y\rangled=⟨x,y⟩v1=(a1,a2,a3,…,an)\mathrm{v}_{1}=\left(\mathrm{a}_{1}, \mathrm{a}_{2}, \mathrm{a}_{3}, \ldots, \mathrm{a}_{\mathrm{n}}\right)v1...原创 2019-11-21 23:04:29 · 1022 阅读 · 5 评论 -
规约算法
规约算法0.引言1.reduction_12.reduction_2reduction_34.result0.引言/* asum: sum of all entries of a vector. * This code only calculates one block to show the usage of shared memory and synchronization */#i...原创 2019-11-21 23:04:09 · 1864 阅读 · 0 评论