Thanks for using Compiler Explorer
Sponsors
C++
LLVM IR
Cppx
Cppx-Gold
Cppx-Blue
C
OpenCL C
C++ for OpenCL
Rust
D
Erlang
Go
ispc
Haskell
Java
Kotlin
Scala
OCaml
Python
Swift
Pascal
Fortran
Assembly
Analysis
CUDA C++
Zig
Clean
Ada
Nim
Crystal
C++ (Circle)
Ruby
CMake
C#
F#
Visual Basic
Dart
TypeScript
Solidity
cuda source #1
Output
Compile to binary
Execute the code
Intel asm syntax
Demangle identifiers
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Compiler
NVCC 10.0.130 sm_30
NVCC 10.1.105 sm_30
NVCC 10.1.168 sm_30
NVCC 10.1.243 sm_30
NVCC 10.2.89 sm_30
NVCC 11.0.2 sm_52
NVCC 11.0.3 sm_52
NVCC 11.1.0 sm_52
NVCC 11.1.1 sm_52
NVCC 11.2.0 sm_52
NVCC 11.2.1 sm_52
NVCC 11.2.2 sm_52
NVCC 11.3.0 sm_52
NVCC 11.3.1 sm_52
NVCC 11.4.0 sm_52
NVCC 11.4.1 sm_52
NVCC 11.5.0 sm_52
NVCC 9.1.85 sm_30
NVCC 9.2.88 sm_30
clang (HIP) trunk
clang 10.0.0 sm_75 CUDA-10.2
clang 10.0.1 sm_75 CUDA-10.2
clang 11.0.0 sm_75 CUDA-10.2
clang 7.0.0 sm_70 CUDA-9.1
clang 8.0.0 sm_75 CUDA-10.0
clang 9.0.0 sm_75 CUDA-10.1
clang trunk sm_86 CUDA-11.3
Options
Source code
// Type your code here, or load an example. __global__ void square(int* array, int n) { int tid = blockDim.x * blockIdx.x + threadIdx.x; if (tid < n) array[tid] = array[tid] * array[tid]; }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
About the author
Changelog
Version tree