feature: add built-in copy kernels for 1D_BUFFER images

Resolves: NEO-14782, HSD-18042093957

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
Igor Venevtsev
2025-05-01 00:48:10 +00:00
committed by Compute-Runtime-Automation
parent 0c3b765942
commit 42efb3d204
12 changed files with 232 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -8,7 +8,7 @@
R"===(
#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
__kernel void CopyImageToImage3d(
__kernel void CopyImage3dToImage3d(
__read_only image3d_t input,
__write_only image3d_t output,
int4 srcOffset,
@@ -22,4 +22,49 @@ __kernel void CopyImageToImage3d(
const uint4 c = read_imageui(input, srcCoord);
write_imageui(output, dstCoord, c);
}
__kernel void CopyImage1dBufferToImage3d(
__read_only image1d_buffer_t input,
__write_only image3d_t output,
int4 srcOffset,
int4 dstOffset) {
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
const int4 srcCoord = (int4)(x, y, z, 0) + srcOffset;
const int4 dstCoord = (int4)(x, y, z, 0) + dstOffset;
const uint4 c = read_imageui(input, srcCoord.x);
write_imageui(output, dstCoord, c);
}
__kernel void CopyImage3dToImage1dBuffer(
__read_only image3d_t input,
__write_only image1d_buffer_t output,
int4 srcOffset,
int4 dstOffset) {
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
const int4 srcCoord = (int4)(x, y, z, 0) + srcOffset;
const int4 dstCoord = (int4)(x, y, z, 0) + dstOffset;
const uint4 c = read_imageui(input, srcCoord);
write_imageui(output, dstCoord.x, c);
}
__kernel void CopyImage1dBufferToImage1dBuffer(
__read_only image1d_buffer_t input,
__write_only image1d_buffer_t output,
int4 srcOffset,
int4 dstOffset) {
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
const int4 srcCoord = (int4)(x, y, z, 0) + srcOffset;
const int4 dstCoord = (int4)(x, y, z, 0) + dstOffset;
const uint4 c = read_imageui(input, srcCoord.x);
write_imageui(output, dstCoord.x, c);
}
)==="

View File

@@ -8,4 +8,4 @@
#include "shared/test/common/helpers/kernel_binary_helper.h"
const std::string KernelBinaryHelper::BUILT_INS("15672580764041246108");
const std::string KernelBinaryHelper::BUILT_INS_WITH_IMAGES("10604557797565794273_images");
const std::string KernelBinaryHelper::BUILT_INS_WITH_IMAGES("2205520382307710565_images");

View File

@@ -1,8 +0,0 @@
/*
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
-cl-fast-relaxed-math

View File

@@ -473,7 +473,7 @@ __kernel void CopyImageToImage2d(
#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
__kernel void CopyImageToImage3d(
__kernel void CopyImage3dToImage3d(
__read_only image3d_t input,
__write_only image3d_t output,
int4 srcOffset,
@@ -488,6 +488,51 @@ __kernel void CopyImageToImage3d(
write_imageui(output, dstCoord, c);
}
__kernel void CopyImage1dBufferToImage3d(
__read_only image1d_buffer_t input,
__write_only image3d_t output,
int4 srcOffset,
int4 dstOffset) {
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
const int4 srcCoord = (int4)(x, y, z, 0) + srcOffset;
const int4 dstCoord = (int4)(x, y, z, 0) + dstOffset;
const uint4 c = read_imageui(input, srcCoord.x);
write_imageui(output, dstCoord, c);
}
__kernel void CopyImage3dToImage1dBuffer(
__read_only image3d_t input,
__write_only image1d_buffer_t output,
int4 srcOffset,
int4 dstOffset) {
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
const int4 srcCoord = (int4)(x, y, z, 0) + srcOffset;
const int4 dstCoord = (int4)(x, y, z, 0) + dstOffset;
const uint4 c = read_imageui(input, srcCoord);
write_imageui(output, dstCoord.x, c);
}
__kernel void CopyImage1dBufferToImage1dBuffer(
__read_only image1d_buffer_t input,
__write_only image1d_buffer_t output,
int4 srcOffset,
int4 dstOffset) {
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
const int4 srcCoord = (int4)(x, y, z, 0) + srcOffset;
const int4 dstCoord = (int4)(x, y, z, 0) + dstOffset;
const uint4 c = read_imageui(input, srcCoord.x);
write_imageui(output, dstCoord.x, c);
}
#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
__kernel void CopyBufferToImage3dBytes(__global uchar *src,

View File

@@ -0,0 +1,8 @@
/*
* Copyright (C) 2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
-cl-fast-relaxed-math

View File

@@ -428,7 +428,7 @@ __kernel void CopyImageToImage2d(
#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
__kernel void CopyImageToImage3d(
__kernel void CopyImage3dToImage3d(
__read_only image3d_t input,
__write_only image3d_t output,
int4 srcOffset,
@@ -443,6 +443,51 @@ __kernel void CopyImageToImage3d(
write_imageui(output, dstCoord, c);
}
__kernel void CopyImage1dBufferToImage3d(
__read_only image1d_buffer_t input,
__write_only image3d_t output,
int4 srcOffset,
int4 dstOffset) {
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
const int4 srcCoord = (int4)(x, y, z, 0) + srcOffset;
const int4 dstCoord = (int4)(x, y, z, 0) + dstOffset;
const uint4 c = read_imageui(input, srcCoord.x);
write_imageui(output, dstCoord, c);
}
__kernel void CopyImage3dToImage1dBuffer(
__read_only image3d_t input,
__write_only image1d_buffer_t output,
int4 srcOffset,
int4 dstOffset) {
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
const int4 srcCoord = (int4)(x, y, z, 0) + srcOffset;
const int4 dstCoord = (int4)(x, y, z, 0) + dstOffset;
const uint4 c = read_imageui(input, srcCoord);
write_imageui(output, dstCoord.x, c);
}
__kernel void CopyImage1dBufferToImage1dBuffer(
__read_only image1d_buffer_t input,
__write_only image1d_buffer_t output,
int4 srcOffset,
int4 dstOffset) {
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
const int4 srcCoord = (int4)(x, y, z, 0) + srcOffset;
const int4 dstCoord = (int4)(x, y, z, 0) + dstOffset;
const uint4 c = read_imageui(input, srcCoord.x);
write_imageui(output, dstCoord.x, c);
}
#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
__kernel void CopyBufferToImage3dBytes(__global uchar *src,