CUDA:在内核中使用realloc [英] CUDA: Using realloc inside kernel

查看:504
本文介绍了CUDA:在内核中使用realloc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以在内核中使用 malloc 在GPU的全局内存上分配内存。是否也可以使用 realloc

I know that it is possible to use malloc inside the kernel to allocate memory on GPU's global memory. Is it also possible to use realloc?

推荐答案

当它们引入 malloc free 函数时,没有提到 realloc 。我假设它不存在。

In the Cuda Programming Guide, when they introduce malloc and free functions, there is no mention of realloc. I would assume that it does not exist.

如果你想知道它肯定,为什么不写一个简单的内核,并尝试使用它?

If you want to know it for sure, why don't you write a simple kernel and try using it?

这篇关于CUDA:在内核中使用realloc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆