cc_staff
229
edits
(add subsections, information on linking) |
(Marked this version for translation) |
||
Line 11: | Line 11: | ||
== Quick start guide == <!--T:39--> | == Quick start guide == <!--T:39--> | ||
===Compiling=== | ===Compiling=== <!--T:40--> | ||
<!--T:40--> | |||
Here we show a simple example of how to use the CUDA C/C++ language compiler, <code>nvcc</code>, and run code created with it. For a longer tutorial in CUDA programming, see [[CUDA tutorial]]. | Here we show a simple example of how to use the CUDA C/C++ language compiler, <code>nvcc</code>, and run code created with it. For a longer tutorial in CUDA programming, see [[CUDA tutorial]]. | ||
Line 69: | Line 68: | ||
</source> | </source> | ||
=== Submitting jobs=== | === Submitting jobs=== <!--T:44--> | ||
<!--T:44--> | |||
To run the program, create a Slurm job script as shown below. Be sure to replace <code>def-someuser</code> with your specific account (see [[Running_jobs#Accounts_and_projects|accounts and projects]]). For options relating to scheduling jobs with GPUs see [[Using GPUs with Slurm]]. | To run the program, create a Slurm job script as shown below. Be sure to replace <code>def-someuser</code> with your specific account (see [[Running_jobs#Accounts_and_projects|accounts and projects]]). For options relating to scheduling jobs with GPUs see [[Using GPUs with Slurm]]. | ||
{{File | {{File | ||
Line 99: | Line 97: | ||
If you run this without a GPU present you might see output like <code>2+7=0</code>. | If you run this without a GPU present you might see output like <code>2+7=0</code>. | ||
=== Linking libraries === | === Linking libraries === <!--T:48--> | ||
If you have a program that needs to link some libraries included with CUDA, for example [https://developer.nvidia.com/cublas cuBLAS], compile with the following flags | If you have a program that needs to link some libraries included with CUDA, for example [https://developer.nvidia.com/cublas cuBLAS], compile with the following flags | ||
<source lang="console"> | <source lang="console"> |