mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Change-Id: I6dac17090e499f013916b1ba2f2b6d0de47f51a3 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> Related-To: NEO-3314
49 lines
1.2 KiB
Plaintext
49 lines
1.2 KiB
Plaintext
/*
|
|
* Copyright (C) 2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
R"===(
|
|
// assumption is local work size = pattern size
|
|
__kernel void FillBufferBytes(
|
|
__global uchar* pDst,
|
|
ulong dstOffsetInBytes,
|
|
const __global uchar* pPattern )
|
|
{
|
|
size_t dstIndex = get_global_id(0) + dstOffsetInBytes;
|
|
size_t srcIndex = get_local_id(0);
|
|
pDst[dstIndex] = pPattern[srcIndex];
|
|
}
|
|
|
|
__kernel void FillBufferLeftLeftover(
|
|
__global uchar* pDst,
|
|
ulong dstOffsetInBytes,
|
|
const __global uchar* pPattern,
|
|
const size_t patternSizeInEls )
|
|
{
|
|
size_t gid = get_global_id(0);
|
|
pDst[ gid + dstOffsetInBytes ] = pPattern[ gid & (patternSizeInEls - 1) ];
|
|
}
|
|
|
|
__kernel void FillBufferMiddle(
|
|
__global uchar* pDst,
|
|
ulong dstOffsetInBytes,
|
|
const __global uint* pPattern,
|
|
const ulong patternSizeInEls )
|
|
{
|
|
size_t gid = get_global_id(0);
|
|
((__global uint*)(pDst + dstOffsetInBytes))[gid] = pPattern[ gid & (patternSizeInEls - 1) ];
|
|
}
|
|
|
|
__kernel void FillBufferRightLeftover(
|
|
__global uchar* pDst,
|
|
ulong dstOffsetInBytes,
|
|
const __global uchar* pPattern,
|
|
const ulong patternSizeInEls )
|
|
{
|
|
size_t gid = get_global_id(0);
|
|
pDst[ gid + dstOffsetInBytes ] = pPattern[ gid & (patternSizeInEls - 1) ];
|
|
}
|
|
)===" |