
cuda学习
文章平均质量分 51
摆渡人001124
拼搏决定人生
展开
-
cuda卷积
一D卷积#include<cuda_runtime.h>#include<device_launch_parameters.h>#include<iostream>using namespace std;__global__ void juan(int* a, int* b, int* c, int m, int n) { int id = blockIdx.x * blockDim.x + threadIdx.x; int sum = 0; int k原创 2020-09-15 20:17:19 · 769 阅读 · 0 评论 -
cuda矩阵相乘(优化)
原始#include<cuda_runtime.h>#include<device_launch_parameters.h>#include<iostream>using namespace std;__global__ void jia(int a[2][2], int b[2][2], int c[2][2],int n) { int idx = threadIdx.x + blockIdx.x * blockDim.x; int idy原创 2020-09-15 18:54:12 · 614 阅读 · 0 评论 -
cuda简单内积算法
#include<cuda_runtime_api.h>#include<cuda_runtime.h>#include<device_launch_parameters.h>#include<iostream>#include<Windows.h>#include<time.h>#include<math.h>#include<device_functions.h>using namespace原创 2020-09-13 17:14:56 · 187 阅读 · 0 评论 -
cuda并行归约算法(不断优化过程)
归约原创 2020-09-13 12:52:59 · 1303 阅读 · 3 评论 -
cuda学习
什么是cudacuda是带有并行内核的串行代码,全部由c/c++编写,串行代码在host端串行执行,并行内核代码在device短的多线程中执行。cuda是用于在英伟达gpu上编程的编译器和工具支持gpu的异构计算cuda API扩展了c/c++编程语言快速SIMD并行性从硬件上提供了高级别的抽象cuda编程流程从host端将数据拷贝到device端呼叫gpu告诉gpu启动在gpu上运行计算将计算完后的device上的数据拷贝到host端kernel是CUDA中一个重要的概念原创 2020-09-11 20:08:56 · 748 阅读 · 0 评论