You can only use __restrict__
on a pointer type. That is also the only context in which __restrict__
makes sense.
Why am I getting the error message: "restrict" not allowed?
-
29-08-2022 - |
Domanda
I'm writing a CUDA kernel and want to __restrict__
some of my parameters. I'm getting the error message:
"restrict" is not allowed
Is it not allowed for some variable types? For some combinations of parameters? Because of some compiler flags? Because I've been naughty?
Simplified kernel signature:
template <typename T> foo(
const T a[],
__restrict__ SomeType b[],
const T c
) {
/* etc. */
}
Soluzione
Altri suggerimenti
This can also happen if you used __restrict__
on a pointer parameter to a function, but got the order wrong, e.g.:
__device__ int bar(float * __restrict__ x);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow