![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
cuda
Alfafar
成独游人了
展开
-
使用一个一维数组进行矩阵转置以及其并行化
直接上代码,思路全在纸上,写两下找规律就能写了#include<time.h>#include "cuda_runtime.h"#include "device_launch_parameters.h"#include<stdlib.h>#include <stdio.h>#define maxsize 2000#define INDEX(i, j, ldy) ((i)* (ldy)+(j))__global__ void Turn(int* data原创 2021-04-01 00:51:00 · 544 阅读 · 0 评论 -
CUDA使用结构体传输时出现写入位置的访问冲突
这是我的之前写的关于在CUDA中传输结构体的代码:CUDA结构体传输#include "cuda_runtime.h"#include "device_launch_parameters.h"#include <stdio.h>#include<stdlib.h>#define maxnumber 500typedef struct node { int piont[maxnumber][maxnumber];} Node;__global__ void原创 2021-03-22 19:50:09 · 783 阅读 · 0 评论 -
CUDA数据结构体在GPU和CPU之间的传输
参照《cuda c编程权威指南》上写出的,在CPU和GPU互相传输结构体。#include "cuda_runtime.h"#include "device_launch_parameters.h"#include <stdio.h>#include<stdlib.h>#define maxnumber 100typedef struct node { int x[maxnumber]; int y[maxnumber]; int test[maxnumbe原创 2021-03-21 15:00:37 · 1892 阅读 · 0 评论