CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
CUDApp / om / apirest / tcperm.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | fn artcperm x view f32 * y edit ushort * to ulong |
| 3 | if ne len x len y |
| 4 | ret 1 |
| 5 | end |
| 6 | for i ulong 18446744073709551615 |
| 7 | if ge i len x |
| 8 | break |
| 9 | end |
| 10 | o = rem i 4 |
| 11 | if eq o 1 |
| 12 | o = 2 |
| 13 | else |
| 14 | if eq o 2 |
| 15 | o = 1 |
| 16 | end |
| 17 | end |
| 18 | p = add sub i rem i 4 o |
| 19 | v = mul get x p bitcast f32 uint 1602224128 |
| 20 | put y i ushort av_rne bitcast uint v |
| 21 | end |
| 22 | ret 0 |
| 23 | end |