diff mbox

[nvptx] document "kernel" function attribute

Message ID 568DECF9.6090309@codesourcery.com
State New
Headers show

Commit Message

Sandra Loosemore Jan. 7, 2016, 4:43 a.m. UTC
I've been trying to fill in missing documentation for target-specific 
attributes.  I'm not 100% sure I've got this one correct.  OK to commit?

-Sandra

Comments

Nathan Sidwell Jan. 7, 2016, 1:48 p.m. UTC | #1
On 01/06/16 23:43, Sandra Loosemore wrote:
> I've been trying to fill in missing documentation for target-specific
> attributes.  I'm not 100% sure I've got this one correct.  OK to commit?

thanks.


+as a kernel function, which is callable by host code.

It's not directly callable.  Perhaps ', which is invokable by the host via the 
CUDA RT library'?

+By default, functions are compiled as device functions instead,
+which are callable only by other device code.

what are 'device functions'?  Perhaps something like
'By default functions are only callable from other PTX functions'.

nathan
diff mbox

Patch

Index: gcc/doc/extend.texi
===================================================================
--- gcc/doc/extend.texi	(revision 232092)
+++ gcc/doc/extend.texi	(working copy)
@@ -2271,6 +2271,7 @@  GCC plugins may provide their own attrib
 * MSP430 Function Attributes::
 * NDS32 Function Attributes::
 * Nios II Function Attributes::
+* Nvidia PTX Function Attributes::
 * PowerPC Function Attributes::
 * RL78 Function Attributes::
 * RX Function Attributes::
@@ -4633,6 +4634,23 @@  named @var{name}.
 @end table
 @end table
 
+@node Nvidia PTX Function Attributes
+@subsection Nvidia PTX Function Attributes
+
+These function attributes are supported by the Nvidia PTX back end:
+
+@table @code
+@item kernel
+@cindex @code{kernel} attribute, Nvidia PTX
+This attribute indicates that the corresponding function should be compiled
+as a kernel function, which is callable by host code.  
+By default, functions are compiled as device functions instead, 
+which are callable only by other device code.
+
+Kernel functions must have @code{void} return type.
+@end table
+
+
 @node PowerPC Function Attributes
 @subsection PowerPC Function Attributes