• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* Copyright © 2024 Intel Corporation
2 * SPDX-License-Identifier: MIT
3 */
4
5#include "libintel_shaders.h"
6
7/* Copy size from src_ptr to dst_ptr for using a single lane with size
8 * multiple of 4.
9 */
10void genX(copy_data)(global void *dst_ptr,
11                     global void *src_ptr,
12                     uint32_t size)
13{
14   for (uint32_t offset = 0; offset < size; offset += 16) {
15      if (offset + 16 <= size) {
16         *(global uint4 *)(dst_ptr + offset) = *(global uint4 *)(src_ptr + offset);
17      } else if (offset + 12 <= size) {
18         *(global uint3 *)(dst_ptr + offset) = *(global uint3 *)(src_ptr + offset);
19      } else if (offset + 8 <= size) {
20         *(global uint2 *)(dst_ptr + offset) = *(global uint2 *)(src_ptr + offset);
21      } else if (offset + 4 <= size) {
22         *(global uint *)(dst_ptr + offset) = *(global uint *)(src_ptr + offset);
23      }
24   }
25}
26