We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, a function specifier is determined by its return type, that __global__ for void type and __device__ for not void type.
__global__
void
__device__
For example,
(defkernel foo (void ()) (return))
is compiled into:
__global__ void foo () { return; }
Because of this rule, a __device__ kernel function that returns void type can't be defined.
To solve this problem, following syntaxes may be given:
(defdevicekernel foo (void ()) ... (defkernel (foo :device) (void ()) ... (defkernel foo :device (void ()) ... (defkernel foo ((void :device) ()) ... (defkernel foo (void :device ()) ...
I think of choosing the second one. Function specifiers can be omitted and the current rule is applied in such case.
:global is specified:
:global
(defkernel (foo :global) (void ()) (return)) ;; compiled into: __global__ void foo () { ... }
:device is specified:
:device
(defkernel (bar :device) (void ()) (return)) ;; compiled into: __device__ void bar () { ... }
__global__ is complemented because return type is void:
(defkernel foofoo (void ()) (return)) ;; compiled into: __global__ void foofoo () { ... }
__device__ is complemented because return type is int:
int
(defkernel baz (int ()) (return 1)) ;; compiled into: __device__ int baz () { ... }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, a function specifier is determined by its return type, that
__global__
forvoid
type and__device__
for notvoid
type.For example,
is compiled into:
Because of this rule, a
__device__
kernel function that returnsvoid
type can't be defined.To solve this problem, following syntaxes may be given:
I think of choosing the second one. Function specifiers can be omitted and the current rule is applied in such case.
:global
is specified::device
is specified:__global__
is complemented because return type isvoid
:__device__
is complemented because return type isint
:The text was updated successfully, but these errors were encountered: