我正在编写一个 CUDA 内核并且想要__restrict__
我的一些参数。我收到错误消息:
"restrict" is not allowed
某些变量类型是不允许的吗?对于某些参数组合?因为一些编译器标志?因为我一直很淘气?
简化的内核签名:
template <typename T> foo(
const T a[],
__restrict__ SomeType b[],
const T c
) {
/* etc. */
}
最佳答案
您只能在指针类型上使用 __restrict__
。这也是 __restrict__
有意义的唯一上下文。
关于c++ - 为什么我收到错误消息 : "restrict" not allowed?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20378528/