![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
CUDA学习日记
博天影帝
这个作者很懒,什么都没留下…
展开
-
CUDA学习日记(二):共享内存的使用
近日在编写程序时,需要使用到共享内存,因此写下这篇博文,用尽可能简化的程序解释在二维数组中共享内存的使用方式。#include <cuda_runtime.h>#include <iostream>//自定义核函数__global__ void lapalace_kernal(int* src, int cnt){ int x = blockIdx.x * 2 - 1 + threadIdx.x; int y = blockIdx.y * 2 - 1 + threa原创 2021-04-23 13:43:35 · 395 阅读 · 1 评论 -
CUDA学习日记(一):thrust::device_pointer_cast(pnt* p)
CUDA学习日记(一):thrust::device_pointer_cast(pnt* p)thrust::device_pointer_cast(pnt* p)是thrust库中的一个指针类型转换函数,可将其他类型指针转换为thrust::device_ptr指针,其作用与thrust::raw_pointer_cast(pnt* p)刚好相反。经过类型转换,就可以很方便的使用thrust...原创 2019-12-10 15:01:29 · 1282 阅读 · 1 评论