Thanks for using Compiler Explorer
Sponsors
C++
Ada
Analysis
Assembly
C
C++ (Circle)
Clean
CMake
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Crystal
C#
CUDA C++
D
Dart
Erlang
Fortran
F#
Go
Haskell
ispc
Java
Kotlin
LLVM IR
Nim
OCaml
OpenCL C
Pascal
Python
Ruby
Rust
Scala
Solidity
Swift
Toit
TypeScript Native
Visual Basic
Zig
cpp_for_opencl source #1
Output
Compile to binary
Execute the code
Intel asm syntax
Demangle identifiers
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Compiler
armv7-a clang (trunk)
armv7-a clang (trunk, SPIR-V asm)
armv7-a clang (trunk, assertions)
armv7-a clang (trunk, assertions, SPIR-V asm)
armv7-a clang 10.0.0
armv7-a clang 10.0.1
armv7-a clang 11.0.0
armv7-a clang 11.0.1
armv7-a clang 12.0.0
armv7-a clang 13.0.0
armv8-a clang (trunk)
armv8-a clang (trunk, SPIR-V asm)
armv8-a clang (trunk, all architectural features)
armv8-a clang (trunk, assertions)
armv8-a clang (trunk, assertions, SPIR-V asm)
armv8-a clang 10.0.0
armv8-a clang 10.0.1
armv8-a clang 11.0.0
armv8-a clang 11.0.1
armv8-a clang 12.0.0
armv8-a clang 13.0.0
Options
Source code
template<typename T> T add(T a, T b) { return a + b; } kernel void k(global int* in1, global int* in2, global int* out) { auto index = get_global_id(0); out[index] = add(in1[index], in2[index]); }
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