Debian Codegraph @

src/asahi/libagx/copy.cl

raw
1 /*
2 * Copyright 2024 Valve Corporation
3 * SPDX-License-Identifier: MIT
4 */
5 #include "compiler/libcl/libcl.h"
6
7 KERNEL(32)
8 libagx_fill(global uint32_t *address, uint32_t value)
9 {
10 assert((((uintptr_t)address) & 0x3) == 0);
11
12 address[cl_global_id.x] = value;
13 }
14
15 KERNEL(32)
16 libagx_copy_uint4(global uint4 *dest, global uint4 *src)
17 {
18 assert((((uintptr_t)dest) & 0xf) == 0);
19 assert((((uintptr_t)src) & 0xf) == 0);
20
21 dest[cl_global_id.x] = src[cl_global_id.x];
22 }
23
24 KERNEL(16)
25 libagx_copy_uchar(global uint8_t *dest, global uint8_t *src)
26 {
27 dest[cl_global_id.x] = src[cl_global_id.x];
28 }
29
30 KERNEL(32)
31 libagx_fill_uint4(global uint4 *address, uint layer_stride_uint4, uint a,
32 uint b, uint c, uint d)
33 {
34 uint offs = cl_global_id.x + cl_global_id.y * layer_stride_uint4;
35 address[offs] = (uint4)(a, b, c, d);
36 }