]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgomp/doc/openacc-library-and-environment-variables.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / libgomp / doc / openacc-library-and-environment-variables.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6OpenACC library and environment variables
7*****************************************
8
9There are two environment variables associated with the OpenACC library
10that may be used to control the device type and device number:
11:envvar:`ACC_DEVICE_TYPE` and :envvar:`ACC_DEVICE_NUM`, respectively. These two
12environment variables can be used as an alternative to calling
13``acc_set_device_num()``. As seen in the second use case, the device
14type and device number were specified using ``acc_set_device_num()``.
15If however, the aforementioned environment variables were set, then the
16call to ``acc_set_device_num()`` would not be required.
17
18The use of the environment variables is only relevant when an OpenACC function
19is called prior to a call to ``cudaCreate()``. If ``cudaCreate()``
20is called prior to a call to an OpenACC function, then you must call
21``acc_set_device_num()`` [#f1]_.
22
23.. -
24 OpenACC Profiling Interface
25 -
26
27.. [#f1] More complete information
28 about :envvar:`ACC_DEVICE_TYPE` and :envvar:`ACC_DEVICE_NUM` can be found in
29 sections 4.1 and 4.2 of the `OpenACC <https://www.openacc.org>`_
3ed1b4ce 30 Application Programming Interfaceā€¯, Version 2.6.