Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Algol68
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C with Coccinelle
C++ with Coccinelle
C++ (Circle)
CIRCT
Clean
Clojure
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Helion
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Mojo
Nim
Numba
Nix
Objective-C
Objective-C++
OCaml
Odin
OpenCL C
Pascal
Pony
PTX
Python
Racket
Raku
Ruby
Rust
Sail
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
Triton
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Yul (Solidity IR)
Zig
Javascript
GIMPLE
Ygen
sway
hlsl source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
AMD RGA 2.10
AMD RGA 2.11
AMD RGA 2.12
AMD RGA 2.13
AMD RGA 2.9.1
Clang (assertions trunk)
Clang (trunk)
DXC (trunk)
DXC 1.6.2112
DXC 1.7.2207
DXC 1.7.2212
DXC 1.7.2308
DXC 1.8.2306-preview
DXC 1.8.2403
DXC 1.8.2403.1
DXC 1.8.2403.2
DXC 1.8.2405
DXC 1.8.2407
DXC 1.8.2502
DXC 1.8.2505
DXC 1.8.2505.1
RGA 2.6.1 (DXC 1.6.2112)
RGA 2.6.1 (DXC 1.7.2207)
RGA 2.6.2 (DXC 1.6.2112)
RGA 2.6.2 (DXC 1.7.2207)
RGA 2.6.2 (DXC trunk)
RGA 2.9.0 (DXC trunk)
Options
Source code
template<class> struct make_void { using type = void; }; template<typename T> using make_void_t = typename make_void<T>::type; template<class T> struct type_identity { using type = T; }; template<bool B, class T = void> struct enable_if {}; template<class T> struct enable_if<true, T> : type_identity<T> {}; template<bool B, class T = void> using enable_if_t = typename enable_if<B,T>::type; template<class T, T val> struct integral_constant { static const T value = val; using value_type = T; }; template<bool val> struct bool_constant : integral_constant<bool, val> {}; template<class A, class B> struct is_same : bool_constant<false> {}; template<class A> struct is_same<A,A> : bool_constant<true> {}; template<typename T> T declval(); #ifdef NO_BUG namespace ns { #endif // our real intrinsic has more complex require clause template<typename T, typename U, enable_if_t<is_same<U,bool>::value,bool> = true > [[vk::ext_instruction(/*spv::OpSelect*/4545)]] T select(U a, T x, T y); #ifdef NO_BUG } #endif [shader("compute")] [numthreads(1,1,256)] void computeMain(uint3 threadId : SV_DispatchThreadID) { const float result = #ifdef NO_BUG ns:: #endif select<float,float>(1,2,3); vk::RawBufferStore(0xdeadbeefu,result); }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Compiler Explorer Shop
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
Statistics
Changelog
Version tree