refactor: remove cl pipe related logic

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-02-25 12:34:16 +00:00
committed by Compute-Runtime-Automation
parent a017025e67
commit 374863ba08
40 changed files with 40 additions and 1085 deletions

View File

@@ -43,7 +43,6 @@
#include "opencl/source/mem_obj/buffer.h" #include "opencl/source/mem_obj/buffer.h"
#include "opencl/source/mem_obj/image.h" #include "opencl/source/mem_obj/image.h"
#include "opencl/source/mem_obj/mem_obj_helper.h" #include "opencl/source/mem_obj/mem_obj_helper.h"
#include "opencl/source/mem_obj/pipe.h"
#include "opencl/source/platform/platform.h" #include "opencl/source/platform/platform.h"
#include "opencl/source/program/program.h" #include "opencl/source/program/program.h"
#include "opencl/source/sampler/sampler.h" #include "opencl/source/sampler/sampler.h"
@@ -5363,8 +5362,8 @@ cl_mem CL_API_CALL clCreatePipe(cl_context context,
const cl_pipe_properties *properties, const cl_pipe_properties *properties,
cl_int *errcodeRet) { cl_int *errcodeRet) {
TRACING_ENTER(ClCreatePipe, &context, &flags, &pipePacketSize, &pipeMaxPackets, &properties, &errcodeRet); TRACING_ENTER(ClCreatePipe, &context, &flags, &pipePacketSize, &pipeMaxPackets, &properties, &errcodeRet);
cl_int retVal = CL_INVALID_OPERATION;
cl_mem pipe = nullptr; cl_mem pipe = nullptr;
cl_int retVal = CL_SUCCESS;
API_ENTER(&retVal); API_ENTER(&retVal);
DBG_LOG_INPUTS("cl_context", context, DBG_LOG_INPUTS("cl_context", context,
@@ -5374,48 +5373,6 @@ cl_mem CL_API_CALL clCreatePipe(cl_context context,
"const cl_pipe_properties", properties, "const cl_pipe_properties", properties,
"cl_int", errcodeRet); "cl_int", errcodeRet);
Context *pContext = nullptr;
const cl_mem_flags allValidFlags =
CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS;
do {
if ((pipePacketSize == 0) || (pipeMaxPackets == 0)) {
retVal = CL_INVALID_PIPE_SIZE;
break;
}
/* Are there some invalid flag bits? */
if ((flags & (~allValidFlags)) != 0) {
retVal = CL_INVALID_VALUE;
break;
}
if (properties != nullptr) {
retVal = CL_INVALID_VALUE;
break;
}
retVal = validateObjects(withCastToInternal(context, &pContext));
if (retVal != CL_SUCCESS) {
break;
}
auto pDevice = pContext->getDevice(0);
if (pDevice->arePipesSupported() == false) {
retVal = CL_INVALID_OPERATION;
break;
}
if (pipePacketSize > pDevice->getDeviceInfo().pipeMaxPacketSize) {
retVal = CL_INVALID_PIPE_SIZE;
break;
}
// create the pipe
pipe = Pipe::create(pContext, flags, pipePacketSize, pipeMaxPackets, properties, retVal);
} while (false);
if (errcodeRet) { if (errcodeRet) {
*errcodeRet = retVal; *errcodeRet = retVal;
} }
@@ -5431,7 +5388,7 @@ cl_int CL_API_CALL clGetPipeInfo(cl_mem pipe,
size_t *paramValueSizeRet) { size_t *paramValueSizeRet) {
TRACING_ENTER(ClGetPipeInfo, &pipe, &paramName, &paramValueSize, &paramValue, &paramValueSizeRet); TRACING_ENTER(ClGetPipeInfo, &pipe, &paramName, &paramValueSize, &paramValue, &paramValueSizeRet);
cl_int retVal = CL_SUCCESS; cl_int retVal = CL_INVALID_MEM_OBJECT;
API_ENTER(&retVal); API_ENTER(&retVal);
DBG_LOG_INPUTS("cl_mem", pipe, DBG_LOG_INPUTS("cl_mem", pipe,
@@ -5440,21 +5397,6 @@ cl_int CL_API_CALL clGetPipeInfo(cl_mem pipe,
"void *", NEO::fileLoggerInstance().infoPointerToString(paramValue, paramValueSize), "void *", NEO::fileLoggerInstance().infoPointerToString(paramValue, paramValueSize),
"size_t*", paramValueSizeRet); "size_t*", paramValueSizeRet);
retVal = validateObjects(pipe);
if (CL_SUCCESS != retVal) {
TRACING_EXIT(ClGetPipeInfo, &retVal);
return retVal;
}
auto pPipeObj = castToObject<Pipe>(pipe);
if (pPipeObj == nullptr) {
retVal = CL_INVALID_MEM_OBJECT;
TRACING_EXIT(ClGetPipeInfo, &retVal);
return retVal;
}
retVal = pPipeObj->getPipeInfo(paramName, paramValueSize, paramValue, paramValueSizeRet);
TRACING_EXIT(ClGetPipeInfo, &retVal); TRACING_EXIT(ClGetPipeInfo, &retVal);
return retVal; return retVal;
} }

View File

@@ -178,13 +178,6 @@ DeviceBitfield ClDevice::getDeviceBitfield() const {
return device.getDeviceBitfield(); return device.getDeviceBitfield();
} }
bool ClDevice::arePipesSupported() const {
if (debugManager.flags.ForcePipeSupport.get() != -1) {
return debugManager.flags.ForcePipeSupport.get();
}
return device.getHardwareInfo().capabilityTable.supportsPipes;
}
void ClDevice::initGTPinHelper() { void ClDevice::initGTPinHelper() {
gtpinGfxCoreHelper = GTPinGfxCoreHelper::create(this->getRootDeviceEnvironment().getHardwareInfo()->platform.eRenderCoreFamily); gtpinGfxCoreHelper = GTPinGfxCoreHelper::create(this->getRootDeviceEnvironment().getHardwareInfo()->platform.eRenderCoreFamily);
} }

View File

@@ -124,7 +124,6 @@ class ClDevice : public BaseObject<_cl_device_id> {
const std::string &peekCompilerExtensions() const; const std::string &peekCompilerExtensions() const;
const std::string &peekCompilerExtensionsWithFeatures() const; const std::string &peekCompilerExtensionsWithFeatures() const;
DeviceBitfield getDeviceBitfield() const; DeviceBitfield getDeviceBitfield() const;
bool arePipesSupported() const;
bool isPciBusInfoValid() const; bool isPciBusInfoValid() const;
static cl_command_queue_capabilities_intel getQueueFamilyCapabilitiesAll(); static cl_command_queue_capabilities_intel getQueueFamilyCapabilitiesAll();

View File

@@ -295,16 +295,10 @@ void ClDevice::initializeCaps() {
deviceInfo.imageBaseAddressAlignment = 4; deviceInfo.imageBaseAddressAlignment = 4;
deviceInfo.queueOnHostProperties = CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; deviceInfo.queueOnHostProperties = CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
deviceInfo.pipeSupport = arePipesSupported(); deviceInfo.pipeSupport = false;
if (arePipesSupported()) { deviceInfo.maxPipeArgs = 0;
deviceInfo.maxPipeArgs = 16; deviceInfo.pipeMaxPacketSize = 0;
deviceInfo.pipeMaxPacketSize = 1024; deviceInfo.pipeMaxActiveReservations = 0;
deviceInfo.pipeMaxActiveReservations = 1;
} else {
deviceInfo.maxPipeArgs = 0;
deviceInfo.pipeMaxPacketSize = 0;
deviceInfo.pipeMaxActiveReservations = 0;
}
deviceInfo.atomicMemoryCapabilities = CL_DEVICE_ATOMIC_ORDER_RELAXED | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP; deviceInfo.atomicMemoryCapabilities = CL_DEVICE_ATOMIC_ORDER_RELAXED | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP;
if (ocl21FeaturesEnabled) { if (ocl21FeaturesEnabled) {

View File

@@ -59,7 +59,6 @@
#include "opencl/source/kernel/kernel_info_cl.h" #include "opencl/source/kernel/kernel_info_cl.h"
#include "opencl/source/mem_obj/buffer.h" #include "opencl/source/mem_obj/buffer.h"
#include "opencl/source/mem_obj/image.h" #include "opencl/source/mem_obj/image.h"
#include "opencl/source/mem_obj/pipe.h"
#include "opencl/source/memory_manager/mem_obj_surface.h" #include "opencl/source/memory_manager/mem_obj_surface.h"
#include "opencl/source/program/program.h" #include "opencl/source/program/program.h"
#include "opencl/source/sampler/sampler.h" #include "opencl/source/sampler/sampler.h"
@@ -1624,47 +1623,7 @@ cl_int Kernel::setArgPipe(uint32_t argIndex,
return CL_INVALID_ARG_SIZE; return CL_INVALID_ARG_SIZE;
} }
auto clMem = reinterpret_cast<const cl_mem *>(argVal); return CL_INVALID_MEM_OBJECT;
if (clMem && *clMem) {
auto clMemObj = *clMem;
DBG_LOG_INPUTS("setArgPipe cl_mem", clMemObj);
storeKernelArg(argIndex, PIPE_OBJ, clMemObj, argVal, argSize);
auto memObj = castToObject<MemObj>(clMemObj);
if (!memObj) {
return CL_INVALID_MEM_OBJECT;
}
auto pipe = castToObject<Pipe>(clMemObj);
if (!pipe) {
return CL_INVALID_ARG_VALUE;
}
if (memObj->getContext() != &(this->getContext())) {
return CL_INVALID_MEM_OBJECT;
}
auto rootDeviceIndex = getDevice().getRootDeviceIndex();
const auto &argAsPtr = kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[argIndex].as<ArgDescPointer>();
auto patchLocation = ptrOffset(getCrossThreadData(), argAsPtr.stateless);
pipe->setPipeArg(patchLocation, argAsPtr.pointerSize, rootDeviceIndex);
if (isValidOffset(argAsPtr.bindful)) {
auto graphicsAllocation = pipe->getGraphicsAllocation(rootDeviceIndex);
auto surfaceState = ptrOffset(getSurfaceStateHeap(), argAsPtr.bindful);
Buffer::setSurfaceState(&getDevice().getDevice(), surfaceState, false, false,
pipe->getSize(), pipe->getCpuAddress(), 0,
graphicsAllocation, 0, 0,
areMultipleSubDevicesInContext());
}
return CL_SUCCESS;
} else {
return CL_INVALID_MEM_OBJECT;
}
} }
cl_int Kernel::setArgImage(uint32_t argIndex, cl_int Kernel::setArgImage(uint32_t argIndex,

View File

@@ -1,5 +1,5 @@
# #
# Copyright (C) 2018-2024 Intel Corporation # Copyright (C) 2018-2025 Intel Corporation
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# #
@@ -22,8 +22,6 @@ set(RUNTIME_SRCS_MEM_OBJ
${CMAKE_CURRENT_SOURCE_DIR}/mem_obj.h ${CMAKE_CURRENT_SOURCE_DIR}/mem_obj.h
${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_helper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_helper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_helper.h
${CMAKE_CURRENT_SOURCE_DIR}/pipe.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pipe.h
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}buffer_ext.cpp ${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}buffer_ext.cpp
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}image_ext.inl ${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}image_ext.inl
) )

View File

@@ -1,133 +0,0 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/source/mem_obj/pipe.h"
#include "shared/source/helpers/get_info.h"
#include "shared/source/helpers/memory_properties_helpers.h"
#include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/context/context.h"
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
#include "opencl/source/helpers/get_info_status_mapper.h"
#include "opencl/source/mem_obj/mem_obj_helper.h"
namespace NEO {
Pipe::Pipe(Context *context,
cl_mem_flags flags,
cl_uint packetSize,
cl_uint maxPackets,
const cl_pipe_properties *properties,
void *memoryStorage,
MultiGraphicsAllocation multiGraphicsAllocation)
: MemObj(context,
CL_MEM_OBJECT_PIPE,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags,
0,
static_cast<size_t>(packetSize * (maxPackets + 1) + intelPipeHeaderReservedSpace),
memoryStorage,
nullptr,
std::move(multiGraphicsAllocation),
false,
false,
false),
pipePacketSize(packetSize),
pipeMaxPackets(maxPackets) {
magic = objectMagic;
}
Pipe *Pipe::create(Context *context,
cl_mem_flags flags,
cl_uint packetSize,
cl_uint maxPackets,
const cl_pipe_properties *properties,
cl_int &errcodeRet) {
Pipe *pPipe = nullptr;
errcodeRet = CL_SUCCESS;
MemoryManager *memoryManager = context->getMemoryManager();
DEBUG_BREAK_IF(!memoryManager);
MemoryProperties memoryProperties =
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice());
while (true) {
auto size = static_cast<size_t>(packetSize * (maxPackets + 1) + intelPipeHeaderReservedSpace);
auto rootDeviceIndex = context->getDevice(0)->getRootDeviceIndex();
AllocationProperties allocProperties =
MemoryPropertiesHelper::getAllocationProperties(rootDeviceIndex, memoryProperties,
true, // allocateMemory
size, AllocationType::pipe,
false, // isMultiStorageAllocation
context->getDevice(0)->getHardwareInfo(), context->getDeviceBitfieldForAllocation(rootDeviceIndex),
context->isSingleDeviceContext());
GraphicsAllocation *memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties);
if (!memory) {
errcodeRet = CL_OUT_OF_HOST_MEMORY;
break;
}
auto multiGraphicsAllocation = MultiGraphicsAllocation(rootDeviceIndex);
multiGraphicsAllocation.addAllocation(memory);
pPipe = new (std::nothrow) Pipe(context, flags, packetSize, maxPackets, properties, memory->getUnderlyingBuffer(), std::move(multiGraphicsAllocation));
if (!pPipe) {
memoryManager->freeGraphicsMemory(memory);
memory = nullptr;
errcodeRet = CL_OUT_OF_HOST_MEMORY;
break;
}
// Initialize pipe_control_intel_t structure located at the beginning of the surface
memset(memory->getUnderlyingBuffer(), 0, intelPipeHeaderReservedSpace);
*reinterpret_cast<unsigned int *>(memory->getUnderlyingBuffer()) = maxPackets + 1;
break;
}
return pPipe;
}
cl_int Pipe::getPipeInfo(cl_image_info paramName,
size_t paramValueSize,
void *paramValue,
size_t *paramValueSizeRet) {
cl_int retVal;
size_t srcParamSize = GetInfo::invalidSourceSize;
void *srcParam = nullptr;
switch (paramName) {
case CL_PIPE_PACKET_SIZE:
srcParamSize = sizeof(cl_uint);
srcParam = &(pipePacketSize);
break;
case CL_PIPE_MAX_PACKETS:
srcParamSize = sizeof(cl_uint);
srcParam = &(pipeMaxPackets);
break;
case CL_PIPE_PROPERTIES:
srcParamSize = 0;
break;
default:
break;
}
auto getInfoStatus = GetInfo::getInfo(paramValue, paramValueSize, srcParam, srcParamSize);
retVal = changeGetInfoStatusToCLResultType(getInfoStatus);
GetInfo::setParamValueReturnSize(paramValueSizeRet, srcParamSize, getInfoStatus);
return retVal;
}
void Pipe::setPipeArg(void *memory, uint32_t patchSize, uint32_t rootDeviceIndex) {
patchWithRequiredSize(memory, patchSize, multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex)->getGpuAddressToPatch());
}
Pipe::~Pipe() = default;
} // namespace NEO

View File

@@ -1,46 +0,0 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "opencl/source/mem_obj/mem_obj.h"
namespace NEO {
class Pipe : public MemObj {
public:
static const size_t intelPipeHeaderReservedSpace = 128;
static const cl_ulong maskMagic = 0xFFFFFFFFFFFFFFFFLL;
static const cl_ulong objectMagic = MemObj::objectMagic | 0x03;
static Pipe *create(
Context *context,
cl_mem_flags flags,
cl_uint packetSize,
cl_uint maxPackets,
const cl_pipe_properties *properties,
cl_int &errcodeRet);
~Pipe() override;
cl_int getPipeInfo(cl_image_info paramName,
size_t paramValueSize,
void *paramValue,
size_t *paramValueSizeRet);
void setPipeArg(void *memory, uint32_t patchSize, uint32_t rootDeviceIndex);
protected:
Pipe(Context *context,
cl_mem_flags flags,
cl_uint packetSize,
cl_uint maxPackets,
const cl_pipe_properties *properties,
void *memoryStorage,
MultiGraphicsAllocation multiGraphicsAllocation);
cl_uint pipePacketSize;
cl_uint pipeMaxPackets;
};
} // namespace NEO

View File

@@ -1,5 +1,5 @@
# #
# Copyright (C) 2018-2023 Intel Corporation # Copyright (C) 2018-2025 Intel Corporation
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# #
@@ -87,7 +87,6 @@ set(IGDRCL_SRCS_tests_api
${CMAKE_CURRENT_SOURCE_DIR}/cl_get_kernel_suggested_local_work_size_khr_tests.inl ${CMAKE_CURRENT_SOURCE_DIR}/cl_get_kernel_suggested_local_work_size_khr_tests.inl
${CMAKE_CURRENT_SOURCE_DIR}/cl_get_kernel_work_group_info_tests.inl ${CMAKE_CURRENT_SOURCE_DIR}/cl_get_kernel_work_group_info_tests.inl
${CMAKE_CURRENT_SOURCE_DIR}/cl_get_mem_object_info_tests.inl ${CMAKE_CURRENT_SOURCE_DIR}/cl_get_mem_object_info_tests.inl
${CMAKE_CURRENT_SOURCE_DIR}/cl_get_pipe_info_tests.inl
${CMAKE_CURRENT_SOURCE_DIR}/cl_get_platform_ids_tests.inl ${CMAKE_CURRENT_SOURCE_DIR}/cl_get_platform_ids_tests.inl
${CMAKE_CURRENT_SOURCE_DIR}/cl_get_platform_info_tests.inl ${CMAKE_CURRENT_SOURCE_DIR}/cl_get_platform_info_tests.inl
${CMAKE_CURRENT_SOURCE_DIR}/cl_get_program_build_info_tests.inl ${CMAKE_CURRENT_SOURCE_DIR}/cl_get_program_build_info_tests.inl

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -10,7 +10,6 @@
#include "opencl/test/unit_test/api/cl_get_kernel_suggested_local_work_size_khr_tests.inl" #include "opencl/test/unit_test/api/cl_get_kernel_suggested_local_work_size_khr_tests.inl"
#include "opencl/test/unit_test/api/cl_get_kernel_work_group_info_tests.inl" #include "opencl/test/unit_test/api/cl_get_kernel_work_group_info_tests.inl"
#include "opencl/test/unit_test/api/cl_get_mem_object_info_tests.inl" #include "opencl/test/unit_test/api/cl_get_mem_object_info_tests.inl"
#include "opencl/test/unit_test/api/cl_get_pipe_info_tests.inl"
#include "opencl/test/unit_test/api/cl_get_platform_ids_tests.inl" #include "opencl/test/unit_test/api/cl_get_platform_ids_tests.inl"
#include "opencl/test/unit_test/api/cl_get_platform_info_tests.inl" #include "opencl/test/unit_test/api/cl_get_platform_info_tests.inl"
#include "opencl/test/unit_test/api/cl_get_program_build_info_tests.inl" #include "opencl/test/unit_test/api/cl_get_program_build_info_tests.inl"

View File

@@ -1,209 +1,21 @@
/* /*
* Copyright (C) 2018-2024 Intel Corporation * Copyright (C) 2018-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
*/ */
#include "shared/source/device/device.h"
#include "shared/test/common/utilities/base_object_utils.h"
#include "opencl/source/context/context.h"
#include "opencl/source/helpers/base_object.h"
#include "opencl/test/unit_test/mocks/mock_platform.h"
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
#include "cl_api_tests.h" #include "cl_api_tests.h"
using namespace NEO; using namespace NEO;
struct ClCreatePipeTests : ApiTests { using ClCreatePipeTests = ApiTests;
VariableBackup<bool> supportsPipesBackup{&defaultHwInfo->capabilityTable.supportsPipes, true};
};
namespace ULT {
class ClCreatePipeWithParamTests : public ApiFixture<>, public testing::TestWithParam<uint64_t> {
void SetUp() override {
ApiFixture::setUp();
}
void TearDown() override {
ApiFixture::tearDown();
}
VariableBackup<bool> supportsPipesBackup{&defaultHwInfo->capabilityTable.supportsPipes, true};
};
class ClCreatePipeWithParamNegativeTests : public ApiFixture<>, public testing::TestWithParam<uint64_t> {
void SetUp() override {
ApiFixture::setUp();
}
void TearDown() override {
ApiFixture::tearDown();
}
VariableBackup<bool> supportsPipesBackup{&defaultHwInfo->capabilityTable.supportsPipes, true};
};
TEST_P(ClCreatePipeWithParamTests, GivenValidFlagsWhenCreatingPipeThenPipeIsCreatedAndSuccessIsReturned) {
cl_mem_flags flags = GetParam();
TEST_F(ClCreatePipeTests, WhenCreatingPipeThenInvalidOperationErrorIsReturned) {
cl_mem_flags flags = CL_MEM_READ_WRITE;
cl_int retVal = CL_SUCCESS;
auto pipe = clCreatePipe(pContext, flags, 1, 20, nullptr, &retVal); auto pipe = clCreatePipe(pContext, flags, 1, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
clReleaseMemObject(pipe);
}
TEST_P(ClCreatePipeWithParamNegativeTests, GivenInalidFlagsWhenCreatingPipeThenInvalidValueErrorIsReturned) {
cl_mem_flags flags = GetParam();
auto pipe = clCreatePipe(pContext, flags, 1, 20, nullptr, &retVal);
EXPECT_EQ(nullptr, pipe);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
clReleaseMemObject(pipe);
}
static cl_mem_flags validFlags[] = {
0,
CL_MEM_READ_WRITE,
CL_MEM_HOST_NO_ACCESS,
CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS,
};
static cl_mem_flags invalidFlags[] = {
CL_MEM_READ_WRITE | CL_MEM_HOST_READ_ONLY,
CL_MEM_WRITE_ONLY,
CL_MEM_READ_ONLY | CL_MEM_HOST_WRITE_ONLY,
CL_MEM_HOST_READ_ONLY,
CL_MEM_HOST_WRITE_ONLY,
CL_MEM_USE_HOST_PTR,
CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE,
CL_MEM_COPY_HOST_PTR,
CL_MEM_ALLOC_HOST_PTR,
CL_MEM_COPY_HOST_PTR | CL_MEM_ALLOC_HOST_PTR,
CL_MEM_READ_ONLY | CL_MEM_WRITE_ONLY,
CL_MEM_READ_WRITE | CL_MEM_READ_ONLY,
CL_MEM_READ_WRITE | CL_MEM_WRITE_ONLY,
CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_NO_ACCESS,
CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_WRITE_ONLY,
CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_NO_ACCESS,
CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR,
CL_MEM_USE_HOST_PTR | CL_MEM_ALLOC_HOST_PTR,
};
INSTANTIATE_TEST_SUITE_P(
CreatePipeCheckFlags,
ClCreatePipeWithParamTests,
testing::ValuesIn(validFlags));
INSTANTIATE_TEST_SUITE_P(
CreatePipeCheckFlagsNegative,
ClCreatePipeWithParamNegativeTests,
testing::ValuesIn(invalidFlags));
TEST_F(ClCreatePipeTests, GivenValidFlagsAndNullReturnWhenCreatingPipeThenPipeIsCreated) {
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto pipe = clCreatePipe(pContext, flags, 1, 20, nullptr, nullptr);
EXPECT_NE(nullptr, pipe);
clReleaseMemObject(pipe);
}
TEST_F(ClCreatePipeTests, GivenPipePacketSizeZeroWhenCreatingPipeThenInvalidPipeSizeErrorIsReturned) {
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto pipe = clCreatePipe(pContext, flags, 0, 20, nullptr, &retVal);
EXPECT_EQ(nullptr, pipe);
EXPECT_EQ(CL_INVALID_PIPE_SIZE, retVal);
clReleaseMemObject(pipe);
}
TEST_F(ClCreatePipeTests, GivenPipeMaxSizeZeroWhenCreatingPipeThenInvalidPipeSizeErrorIsReturned) {
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto pipe = clCreatePipe(pContext, flags, 1, 0, nullptr, &retVal);
EXPECT_EQ(nullptr, pipe);
EXPECT_EQ(CL_INVALID_PIPE_SIZE, retVal);
clReleaseMemObject(pipe);
}
TEST_F(ClCreatePipeTests, GivenPipePropertiesNotNullWhenCreatingPipeThenInvalidValueErrorIsReturned) {
cl_mem_flags flags = CL_MEM_READ_WRITE;
cl_pipe_properties properties = {0};
auto pipe = clCreatePipe(pContext, flags, 1, 20, &properties, &retVal);
EXPECT_EQ(nullptr, pipe);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
clReleaseMemObject(pipe);
}
TEST_F(ClCreatePipeTests, GivenDeviceNotSupportingPipesWhenCreatingPipeThenInvalidOperationErrorIsReturned) {
auto hardwareInfo = *defaultHwInfo;
hardwareInfo.capabilityTable.supportsPipes = false;
auto pClDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo, 0));
MockContext mockContext{pClDevice.get(), false};
auto pipe = clCreatePipe(&mockContext, 0, 1, 20, nullptr, &retVal);
EXPECT_EQ(nullptr, pipe); EXPECT_EQ(nullptr, pipe);
EXPECT_EQ(CL_INVALID_OPERATION, retVal); EXPECT_EQ(CL_INVALID_OPERATION, retVal);
} }
TEST_F(ClCreatePipeTests, GivenPipePacketSizeGreaterThanAllowedWhenCreatingPipeThenInvalidPipeSizeErrorIsReturned) {
cl_uint packetSize = pContext->getDevice(0)->getDeviceInfo().pipeMaxPacketSize;
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto pipe = clCreatePipe(pContext, flags, packetSize, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
clReleaseMemObject(pipe);
packetSize += 1;
pipe = clCreatePipe(pContext, flags, packetSize, 20, nullptr, &retVal);
EXPECT_EQ(nullptr, pipe);
EXPECT_EQ(CL_INVALID_PIPE_SIZE, retVal);
clReleaseMemObject(pipe);
}
TEST_F(ClCreatePipeTests, GivenNullContextWhenCreatingPipeThenInvalidContextErrorIsReturned) {
auto pipe = clCreatePipe(nullptr, 0, 1, 20, nullptr, &retVal);
EXPECT_EQ(nullptr, pipe);
EXPECT_EQ(CL_INVALID_CONTEXT, retVal);
clReleaseMemObject(pipe);
}
TEST(clCreatePipeTest, givenPlatformWithoutDevicesWhenClCreatePipeIsCalledThenDeviceIsTakenFromContext) {
auto executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->initializeMemoryManager();
executionEnvironment->prepareRootDeviceEnvironments(1);
auto device = std::make_unique<ClDevice>(*Device::create<RootDevice>(executionEnvironment, 0u), platform());
const ClDeviceInfo &devInfo = device->getDeviceInfo();
if (devInfo.svmCapabilities == 0 || device->getHardwareInfo().capabilityTable.supportsPipes == false) {
GTEST_SKIP();
}
cl_device_id clDevice = device.get();
cl_int retVal;
auto context = ReleaseableObjectPtr<Context>(Context::create<Context>(nullptr, ClDeviceVector(&clDevice, 1), nullptr, nullptr, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(0u, platform()->getNumDevices());
cl_uint packetSize = context->getDevice(0)->getDeviceInfo().pipeMaxPacketSize;
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto pipe = clCreatePipe(context.get(), flags, packetSize, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
clReleaseMemObject(pipe);
}
} // namespace ULT

View File

@@ -1,171 +0,0 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/source/context/context.h"
#include "opencl/source/mem_obj/pipe.h"
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
#include "cl_api_tests.h"
using namespace NEO;
struct ClGetPipeInfoTests : ApiTests {
VariableBackup<bool> supportsPipesBackup{&defaultHwInfo->capabilityTable.supportsPipes, true};
};
namespace ULT {
TEST_F(ClGetPipeInfoTests, GivenValidPipeWithPacketSizeOneWhenGettingPipeInfoThenPacketSizeReturnedIsOne) {
auto pipe = clCreatePipe(pContext, CL_MEM_READ_WRITE, 1, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
cl_uint paramValue = 0;
size_t paramValueRetSize = 0;
retVal = clGetPipeInfo(pipe, CL_PIPE_PACKET_SIZE, sizeof(paramValue), &paramValue, &paramValueRetSize);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(paramValue, 1u);
EXPECT_EQ(paramValueRetSize, sizeof(cl_uint));
clReleaseMemObject(pipe);
}
TEST_F(ClGetPipeInfoTests, GivenValidPipeWithMaxPacketEqualTwentyWhenGettingPipeInfoThenMaxPacketReturnedIsTwenty) {
auto pipe = clCreatePipe(pContext, CL_MEM_READ_WRITE, 1, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
cl_uint paramValue = 0;
size_t paramValueRetSize = 0;
retVal = clGetPipeInfo(pipe, CL_PIPE_MAX_PACKETS, sizeof(paramValue), &paramValue, &paramValueRetSize);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(paramValue, 20u);
EXPECT_EQ(paramValueRetSize, sizeof(cl_uint));
clReleaseMemObject(pipe);
}
TEST_F(ClGetPipeInfoTests, GivenInvalidParamNameWhenGettingPipeInfoThenClInvalidValueErrorIsReturned) {
auto pipe = clCreatePipe(pContext, CL_MEM_READ_WRITE, 1, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
cl_uint paramValue = 0;
size_t paramValueRetSize = 0;
retVal = clGetPipeInfo(pipe, CL_MEM_READ_WRITE, sizeof(paramValue), &paramValue, &paramValueRetSize);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
clReleaseMemObject(pipe);
}
TEST_F(ClGetPipeInfoTests, GivenInvalidParametersWhenGettingPipeInfoThenValueSizeRetIsNotUpdated) {
auto pipe = clCreatePipe(pContext, CL_MEM_READ_WRITE, 1, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
cl_uint paramValue = 0;
size_t paramValueRetSize = 0x1234;
retVal = clGetPipeInfo(pipe, CL_MEM_READ_WRITE, sizeof(paramValue), &paramValue, &paramValueRetSize);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
EXPECT_EQ(0x1234u, paramValueRetSize);
clReleaseMemObject(pipe);
}
TEST_F(ClGetPipeInfoTests, GivenInvalidMemoryObjectWhenGettingPipeInfoThenClInvalidMemObjectErrorIsReturned) {
cl_uint paramValue = 0;
size_t paramValueRetSize = 0;
char fakeMemoryObj[sizeof(Pipe)];
retVal = clGetPipeInfo((cl_mem)&fakeMemoryObj[0], CL_MEM_READ_WRITE, sizeof(paramValue), &paramValue, &paramValueRetSize);
EXPECT_EQ(CL_INVALID_MEM_OBJECT, retVal);
}
TEST_F(ClGetPipeInfoTests, GivenNullParamValueWhenGettingPipeInfoThenClSuccessIsReturned) {
auto pipe = clCreatePipe(pContext, CL_MEM_READ_WRITE, 1, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
size_t paramValueRetSize = 0;
cl_uint paramValue = 0;
retVal = clGetPipeInfo(pipe, CL_PIPE_MAX_PACKETS, sizeof(paramValue), nullptr, &paramValueRetSize);
EXPECT_EQ(CL_SUCCESS, retVal);
clReleaseMemObject(pipe);
}
TEST_F(ClGetPipeInfoTests, GivenNullParamValueSizeRetWhenGettingPipeInfoThenClSuccessIsReturned) {
auto pipe = clCreatePipe(pContext, CL_MEM_READ_WRITE, 1, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
cl_uint paramValue = 0;
retVal = clGetPipeInfo(pipe, CL_PIPE_MAX_PACKETS, sizeof(paramValue), &paramValue, nullptr);
EXPECT_EQ(CL_SUCCESS, retVal);
clReleaseMemObject(pipe);
}
TEST_F(ClGetPipeInfoTests, GivenParamValueSizeRetTooSmallWhenGettingPipeInfoThenClInvalidValueErrorIsReturned) {
auto pipe = clCreatePipe(pContext, CL_MEM_READ_WRITE, 1, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
uint16_t paramValue = 0;
size_t paramValueRetSize = 0;
retVal = clGetPipeInfo(pipe, CL_PIPE_PACKET_SIZE, sizeof(paramValue), &paramValue, &paramValueRetSize);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
clReleaseMemObject(pipe);
}
TEST_F(ClGetPipeInfoTests, GivenBufferInsteadOfPipeWhenGettingPipeInfoThenClInvalidMemObjectErrorIsReturned) {
auto buffer = clCreateBuffer(pContext, CL_MEM_READ_WRITE, 20, nullptr, &retVal);
EXPECT_NE(nullptr, buffer);
EXPECT_EQ(CL_SUCCESS, retVal);
cl_uint paramValue = 0;
size_t paramValueRetSize = 0;
retVal = clGetPipeInfo(buffer, CL_PIPE_PACKET_SIZE, sizeof(paramValue), &paramValue, &paramValueRetSize);
EXPECT_EQ(CL_INVALID_MEM_OBJECT, retVal);
clReleaseMemObject(buffer);
}
TEST_F(ClGetPipeInfoTests, WhenQueryingPipePropertiesThenNothingIsCopied) {
auto pipe = clCreatePipe(pContext, CL_MEM_READ_WRITE, 1, 20, nullptr, &retVal);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, retVal);
size_t paramSize = 1u;
retVal = clGetPipeInfo(pipe, CL_PIPE_PROPERTIES, 0, nullptr, &paramSize);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(0u, paramSize);
clReleaseMemObject(pipe);
}
} // namespace ULT

View File

@@ -108,9 +108,6 @@ struct DeviceGetCapsTest : public ::testing::Test {
EXPECT_STREQ("__opencl_c_ext_fp16_local_atomic_min_max", (++openclCFeatureIterator)->name); EXPECT_STREQ("__opencl_c_ext_fp16_local_atomic_min_max", (++openclCFeatureIterator)->name);
} }
} }
if (hwInfo.capabilityTable.supportsPipes) {
EXPECT_STREQ("__opencl_c_pipes", (++openclCFeatureIterator)->name);
}
if (hwInfo.capabilityTable.ftrSupportsFP64) { if (hwInfo.capabilityTable.ftrSupportsFP64) {
EXPECT_STREQ("__opencl_c_fp64", (++openclCFeatureIterator)->name); EXPECT_STREQ("__opencl_c_fp64", (++openclCFeatureIterator)->name);
if (hwInfo.capabilityTable.supportsOcl21Features && hwInfo.capabilityTable.supportsFloatAtomics) { if (hwInfo.capabilityTable.supportsOcl21Features && hwInfo.capabilityTable.supportsFloatAtomics) {
@@ -252,15 +249,9 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) {
EXPECT_EQ(0u, caps.queueOnDevicePreferredSize); EXPECT_EQ(0u, caps.queueOnDevicePreferredSize);
EXPECT_EQ(static_cast<cl_command_queue_properties>(0), caps.queueOnDeviceProperties); EXPECT_EQ(static_cast<cl_command_queue_properties>(0), caps.queueOnDeviceProperties);
if (defaultHwInfo->capabilityTable.supportsPipes) { EXPECT_EQ(0u, caps.maxPipeArgs);
EXPECT_EQ(16u, caps.maxPipeArgs); EXPECT_EQ(0u, caps.pipeMaxPacketSize);
EXPECT_EQ(1024u, caps.pipeMaxPacketSize); EXPECT_EQ(0u, caps.pipeMaxActiveReservations);
EXPECT_EQ(1u, caps.pipeMaxActiveReservations);
} else {
EXPECT_EQ(0u, caps.maxPipeArgs);
EXPECT_EQ(0u, caps.pipeMaxPacketSize);
EXPECT_EQ(0u, caps.pipeMaxActiveReservations);
}
EXPECT_EQ(64u, caps.preferredGlobalAtomicAlignment); EXPECT_EQ(64u, caps.preferredGlobalAtomicAlignment);
EXPECT_EQ(64u, caps.preferredLocalAtomicAlignment); EXPECT_EQ(64u, caps.preferredLocalAtomicAlignment);
@@ -1133,7 +1124,7 @@ HWTEST_F(DeviceGetCapsTest, givenEnabledFtrPooledEuWhenCalculatingMaxEuPerSSThen
EXPECT_EQ(expectedMaxWGS, device->getDeviceInfo().maxWorkGroupSize); EXPECT_EQ(expectedMaxWGS, device->getDeviceInfo().maxWorkGroupSize);
} }
TEST(DeviceGetCaps, givenDebugFlagToUseMaxSimdSizeForWkgCalculationWhenDeviceCapsAreCreatedThen1024WorkgroupSizeIsReturned) { TEST(DeviceGetCaps, givenDebugFlagToUseMaxSimdSizeForWkgCalculationWhenDeviceCapsAreCreatedThenNumSubGroupsIsCalculatedBasedOnMaxWorkGroupSize) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo); REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
DebugManagerStateRestore dbgRestorer; DebugManagerStateRestore dbgRestorer;
@@ -1147,7 +1138,6 @@ TEST(DeviceGetCaps, givenDebugFlagToUseMaxSimdSizeForWkgCalculationWhenDeviceCap
mySysInfo.ThreadCount = 24 * 7; mySysInfo.ThreadCount = 24 * 7;
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo)); auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
EXPECT_EQ(1024u, device->getSharedDeviceInfo().maxWorkGroupSize);
EXPECT_EQ(device->getSharedDeviceInfo().maxWorkGroupSize / CommonConstants::maximalSimdSize, device->getDeviceInfo().maxNumOfSubGroups); EXPECT_EQ(device->getSharedDeviceInfo().maxWorkGroupSize / CommonConstants::maximalSimdSize, device->getDeviceInfo().maxNumOfSubGroups);
} }
@@ -1335,14 +1325,6 @@ TEST_F(DeviceGetCapsTest, givenUnifiedMemorySharedSystemFlagWhenDeviceIsCreatedT
EXPECT_TRUE(device->areSharedSystemAllocationsAllowed()); EXPECT_TRUE(device->areSharedSystemAllocationsAllowed());
} }
TEST_F(DeviceGetCapsTest, givenOcl21DeviceWhenCheckingPipesSupportThenPipesAreSupported) {
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
if (device->getEnabledClVersion() == 21) {
EXPECT_EQ(1u, device->getHardwareInfo().capabilityTable.supportsPipes);
}
}
TEST_F(DeviceGetCapsTest, givenCapsDeviceEnqueueWhenCheckingDeviceEnqueueSupportThenNoSupportReported) { TEST_F(DeviceGetCapsTest, givenCapsDeviceEnqueueWhenCheckingDeviceEnqueueSupportThenNoSupportReported) {
auto hwInfo = *defaultHwInfo; auto hwInfo = *defaultHwInfo;
@@ -1356,42 +1338,15 @@ TEST_F(DeviceGetCapsTest, givenCapsDeviceEnqueueWhenCheckingDeviceEnqueueSupport
EXPECT_EQ(static_cast<cl_command_queue_properties>(0), caps.queueOnDeviceProperties); EXPECT_EQ(static_cast<cl_command_queue_properties>(0), caps.queueOnDeviceProperties);
} }
TEST_F(DeviceGetCapsTest, givenPipeSupportForcedWhenCheckingPipeSupportThenPipeIsCorrectlyReported) { TEST_F(DeviceGetCapsTest, whenCheckingPipeSupportThenNoSupportIsReported) {
DebugManagerStateRestore dbgRestorer;
int32_t forcePipeSupportValues[] = {-1, 0, 1};
auto hwInfo = *defaultHwInfo; auto hwInfo = *defaultHwInfo;
for (auto isPipeSupportedByHw : ::testing::Bool()) { auto pClDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
hwInfo.capabilityTable.supportsPipes = isPipeSupportedByHw; auto &caps = pClDevice->getDeviceInfo();
for (auto forcePipeSupport : forcePipeSupportValues) { EXPECT_EQ(0u, caps.maxPipeArgs);
debugManager.flags.ForcePipeSupport.set(forcePipeSupport); EXPECT_EQ(0u, caps.pipeMaxPacketSize);
auto pClDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); EXPECT_EQ(0u, caps.pipeMaxActiveReservations);
auto &caps = pClDevice->getDeviceInfo();
size_t pipeFeaturesCount = 0;
for (auto &openclCFeature : caps.openclCFeatures) {
if (0 == strcmp(openclCFeature.name, "__opencl_c_pipes")) {
pipeFeaturesCount++;
}
}
bool expectedPipeSupport = ((forcePipeSupport == -1) ? isPipeSupportedByHw : forcePipeSupport);
if (expectedPipeSupport) {
EXPECT_TRUE(pClDevice->arePipesSupported());
EXPECT_EQ(16u, caps.maxPipeArgs);
EXPECT_EQ(1024u, caps.pipeMaxPacketSize);
EXPECT_EQ(1u, caps.pipeMaxActiveReservations);
EXPECT_EQ(1u, pipeFeaturesCount);
} else {
EXPECT_FALSE(pClDevice->arePipesSupported());
EXPECT_EQ(0u, caps.maxPipeArgs);
EXPECT_EQ(0u, caps.pipeMaxPacketSize);
EXPECT_EQ(0u, caps.pipeMaxActiveReservations);
EXPECT_EQ(0u, pipeFeaturesCount);
}
}
}
} }
TEST_F(DeviceGetCapsTest, givenClDeviceWhenInitializingCapsThenUseGetQueueFamilyCapabilitiesMethod) { TEST_F(DeviceGetCapsTest, givenClDeviceWhenInitializingCapsThenUseGetQueueFamilyCapabilitiesMethod) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2024 Intel Corporation * Copyright (C) 2018-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -633,8 +633,8 @@ TEST(GetDeviceInfo, WhenQueryingPipesSupportThenProperValueIsReturned) {
EXPECT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(sizeof(cl_bool), paramRetSize); EXPECT_EQ(sizeof(cl_bool), paramRetSize);
cl_bool expectedPipesSupport = deviceFactory.rootDevices[0]->arePipesSupported() ? CL_TRUE : CL_FALSE; cl_bool expectedValue = CL_FALSE;
EXPECT_EQ(expectedPipesSupport, pipesSupport); EXPECT_EQ(expectedValue, pipesSupport);
} }
TEST(GetDeviceInfo, WhenQueryingNonUniformWorkGroupSupportThenProperValueIsReturned) { TEST(GetDeviceInfo, WhenQueryingNonUniformWorkGroupSupportThenProperValueIsReturned) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2023 Intel Corporation * Copyright (C) 2018-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -13,13 +13,11 @@
#include "opencl/source/accelerators/intel_motion_estimation.h" #include "opencl/source/accelerators/intel_motion_estimation.h"
#include "opencl/source/helpers/sampler_helpers.h" #include "opencl/source/helpers/sampler_helpers.h"
#include "opencl/source/kernel/kernel.h" #include "opencl/source/kernel/kernel.h"
#include "opencl/source/mem_obj/pipe.h"
#include "opencl/test/unit_test/fixtures/context_fixture.h" #include "opencl/test/unit_test/fixtures/context_fixture.h"
#include "opencl/test/unit_test/fixtures/image_fixture.h" #include "opencl/test/unit_test/fixtures/image_fixture.h"
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h" #include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
#include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_buffer.h"
#include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_kernel.h"
#include "opencl/test/unit_test/mocks/mock_pipe.h"
#include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/mocks/mock_program.h"
#include "opencl/test/unit_test/mocks/mock_sampler.h" #include "opencl/test/unit_test/mocks/mock_sampler.h"
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h" #include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
@@ -233,45 +231,6 @@ TEST_F(CloneKernelTest, givenArgBufferWhenCloningKernelThenKernelInfoIsCorrect)
} }
} }
TEST_F(CloneKernelTest, givenArgPipeWhenCloningKernelThenKernelInfoIsCorrect) {
pKernelInfo->addArgPipe(0, 0x20, sizeof(uint64_t));
auto pipe = clUniquePtr(Pipe::create(context.get(), 0, 1, 20, nullptr, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
cl_mem memObj = pipe.get();
auto rootDeviceIndex = *context->getRootDeviceIndices().begin();
pSourceKernel[rootDeviceIndex]->setKernelArgHandler(0, &Kernel::setArgPipe);
pClonedKernel[rootDeviceIndex]->setKernelArgHandler(0, &Kernel::setArgPipe);
retVal = pSourceKernel[rootDeviceIndex]->setArg(0, sizeof(cl_mem), &memObj);
ASSERT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(1u, pSourceKernel[rootDeviceIndex]->getKernelArguments().size());
EXPECT_EQ(Kernel::PIPE_OBJ, pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).type);
EXPECT_NE(0u, pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).size);
EXPECT_EQ(1u, pSourceKernel[rootDeviceIndex]->getPatchedArgumentsNum());
EXPECT_TRUE(pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).isPatched);
EXPECT_EQ(0u, pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).allocId);
retVal = pClonedMultiDeviceKernel->cloneKernel(pSourceMultiDeviceKernel.get());
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(pSourceKernel[rootDeviceIndex]->getKernelArguments().size(), pClonedKernel[rootDeviceIndex]->getKernelArguments().size());
EXPECT_EQ(pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).type, pClonedKernel[rootDeviceIndex]->getKernelArgInfo(0).type);
EXPECT_EQ(pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).object, pClonedKernel[rootDeviceIndex]->getKernelArgInfo(0).object);
EXPECT_EQ(pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).value, pClonedKernel[rootDeviceIndex]->getKernelArgInfo(0).value);
EXPECT_EQ(pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).size, pClonedKernel[rootDeviceIndex]->getKernelArgInfo(0).size);
EXPECT_EQ(pSourceKernel[rootDeviceIndex]->getPatchedArgumentsNum(), pClonedKernel[rootDeviceIndex]->getPatchedArgumentsNum());
EXPECT_EQ(pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).isPatched, pClonedKernel[rootDeviceIndex]->getKernelArgInfo(0).isPatched);
EXPECT_EQ(pSourceKernel[rootDeviceIndex]->getKernelArgInfo(0).allocId, pClonedKernel[rootDeviceIndex]->getKernelArgInfo(0).allocId);
auto pKernelArg = reinterpret_cast<uint64_t *>(pClonedKernel[rootDeviceIndex]->getCrossThreadData() +
pClonedKernel[rootDeviceIndex]->getKernelInfo().getArgDescriptorAt(0).as<ArgDescPointer>().stateless);
EXPECT_EQ(pipe->getGraphicsAllocation(rootDeviceIndex)->getGpuAddressToPatch(), *pKernelArg);
}
TEST_F(CloneKernelTest, givenArgImageWhenCloningKernelThenKernelInfoIsCorrect) { TEST_F(CloneKernelTest, givenArgImageWhenCloningKernelThenKernelInfoIsCorrect) {
pKernelInfo->addArgImage(0, 0x20); pKernelInfo->addArgImage(0, 0x20);
auto &metaPayload = pKernelInfo->argAsImg(0).metadataPayload; auto &metaPayload = pKernelInfo->argAsImg(0).metadataPayload;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2023 Intel Corporation * Copyright (C) 2018-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -8,14 +8,12 @@
#include "shared/test/common/test_macros/hw_test.h" #include "shared/test/common/test_macros/hw_test.h"
#include "opencl/source/kernel/kernel.h" #include "opencl/source/kernel/kernel.h"
#include "opencl/source/mem_obj/pipe.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
#include "opencl/test/unit_test/fixtures/context_fixture.h" #include "opencl/test/unit_test/fixtures/context_fixture.h"
#include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_buffer.h"
#include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h"
#include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_context.h"
#include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_kernel.h"
#include "opencl/test/unit_test/mocks/mock_pipe.h"
#include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/mocks/mock_program.h"
#include "CL/cl.h" #include "CL/cl.h"
@@ -43,17 +41,12 @@ class KernelArgPipeFixture : public ContextFixture, public ClDeviceFixture {
pKernelInfo = std::make_unique<MockKernelInfo>(); pKernelInfo = std::make_unique<MockKernelInfo>();
pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 1; pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 1;
pKernelInfo->heapInfo.pSsh = pSshLocal;
pKernelInfo->heapInfo.surfaceStateHeapSize = sizeof(pSshLocal);
pKernelInfo->addArgPipe(0, 0x30, sizeof(void *)); pKernelInfo->addArgPipe(0, 0x30, sizeof(void *));
pProgram = new MockProgram(pContext, false, toClDeviceVector(*pClDevice)); pProgram = new MockProgram(pContext, false, toClDeviceVector(*pClDevice));
pKernel = new MockKernel(pProgram, *pKernelInfo, *pClDevice); pKernel = new MockKernel(pProgram, *pKernelInfo, *pClDevice);
ASSERT_EQ(CL_SUCCESS, pKernel->initialize()); ASSERT_EQ(CL_SUCCESS, pKernel->initialize());
pKernel->setCrossThreadData(pCrossThreadData, sizeof(pCrossThreadData));
pKernel->setKernelArgHandler(0, &Kernel::setArgPipe); pKernel->setKernelArgHandler(0, &Kernel::setArgPipe);
} }
@@ -65,122 +58,27 @@ class KernelArgPipeFixture : public ContextFixture, public ClDeviceFixture {
ClDeviceFixture::tearDown(); ClDeviceFixture::tearDown();
} }
cl_int retVal = CL_SUCCESS;
MockProgram *pProgram = nullptr; MockProgram *pProgram = nullptr;
MockKernel *pKernel = nullptr; MockKernel *pKernel = nullptr;
std::unique_ptr<MockKernelInfo> pKernelInfo; std::unique_ptr<MockKernelInfo> pKernelInfo;
SKernelBinaryHeaderCommon kernelHeader; SKernelBinaryHeaderCommon kernelHeader;
char pSshLocal[64];
char pCrossThreadData[64];
}; };
typedef Test<KernelArgPipeFixture> KernelArgPipeTest; using KernelArgPipeTest = Test<KernelArgPipeFixture>;
TEST_F(KernelArgPipeTest, GivenValidPipeWhenSettingKernelArgThenPipeAddressIsCorrect) { TEST_F(KernelArgPipeTest, givenPointerWhenSettingKernelArgThenInvalidMemObjIsReturned) {
Pipe *pipe = new MockPipe(pContext);
auto val = (cl_mem)pipe; auto val = reinterpret_cast<void *>(0xBADF00D);
auto pVal = &val; auto pVal = &val;
auto retVal = this->pKernel->setArg(0, sizeof(cl_mem *), pVal);
EXPECT_EQ(CL_SUCCESS, retVal);
auto pKernelArg = (cl_mem **)(this->pKernel->getCrossThreadData() +
this->pKernelInfo->argAsPtr(0).stateless);
EXPECT_EQ(pipe->getCpuAddress(), *pKernelArg);
delete pipe;
}
TEST_F(KernelArgPipeTest, GivenSvmPtrStatelessWhenSettingKernelArgThenArgumentsAreSetCorrectly) {
Pipe *pipe = new MockPipe(pContext);
auto val = (cl_mem)pipe;
auto pVal = &val;
auto retVal = this->pKernel->setArg(0, sizeof(cl_mem *), pVal);
EXPECT_EQ(CL_SUCCESS, retVal);
delete pipe;
}
HWTEST_F(KernelArgPipeTest, GivenSvmPtrStatefulWhenSettingKernelArgThenArgumentsAreSetCorrectly) {
Pipe *pipe = new MockPipe(pContext);
auto val = (cl_mem)pipe;
auto pVal = &val;
pKernelInfo->argAsPtr(0).bindful = 0;
auto retVal = this->pKernel->setArg(0, sizeof(cl_mem *), pVal);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(0u, pKernel->getSurfaceStateHeapSize());
typedef typename FamilyType::RENDER_SURFACE_STATE RENDER_SURFACE_STATE;
auto surfaceState = reinterpret_cast<const RENDER_SURFACE_STATE *>(
ptrOffset(pKernel->getSurfaceStateHeap(),
pKernelInfo->argAsPtr(0).bindful));
void *surfaceAddress = reinterpret_cast<void *>(surfaceState->getSurfaceBaseAddress());
EXPECT_EQ(pipe->getCpuAddress(), surfaceAddress);
delete pipe;
}
TEST_F(KernelArgPipeTest, GivenInvalidPipeWhenSettingKernelArgThenInvalidMemObjectErrorIsReturned) {
char *ptr = new char[sizeof(Pipe)];
auto val = (cl_mem *)ptr;
auto pVal = &val;
auto retVal = this->pKernel->setArg(0, sizeof(cl_mem *), pVal); auto retVal = this->pKernel->setArg(0, sizeof(cl_mem *), pVal);
EXPECT_EQ(CL_INVALID_MEM_OBJECT, retVal); EXPECT_EQ(CL_INVALID_MEM_OBJECT, retVal);
delete[] ptr;
} }
TEST_F(KernelArgPipeTest, GivenBufferWhenSettingKernelArgThenInvalidArgValueErrorIsReturned) { TEST_F(KernelArgPipeTest, givenIncorrectSizeWhenSettingKernelArgThenInvalidMemObjIsReturned) {
Buffer *buffer = new MockBuffer(); auto val = reinterpret_cast<void *>(0xBADF00D);
auto val = (cl_mem)buffer;
auto pVal = &val; auto pVal = &val;
auto retVal = this->pKernel->setArg(0, sizeof(cl_mem *), pVal);
EXPECT_EQ(CL_INVALID_ARG_VALUE, retVal);
delete buffer;
}
TEST_F(KernelArgPipeTest, GivenPipeFromDifferentContextWhenSettingKernelArgThenInvalidMemObjectErrorIsReturned) {
MockContext newContext;
Pipe *pipe = new MockPipe(&newContext);
auto val = (cl_mem)pipe;
auto pVal = &val;
auto retVal = this->pKernel->setArg(0, sizeof(cl_mem *), pVal);
EXPECT_EQ(CL_INVALID_MEM_OBJECT, retVal);
delete pipe;
}
TEST_F(KernelArgPipeTest, GivenInvalidSizeWhenSettingKernelArgThenInvalidArgSizeErrorIsReturned) {
Pipe *pipe = new MockPipe(pContext);
auto val = (cl_mem *)pipe;
auto pVal = &val;
auto retVal = this->pKernel->setArg(0, 1, pVal); auto retVal = this->pKernel->setArg(0, 1, pVal);
EXPECT_EQ(CL_INVALID_ARG_SIZE, retVal); EXPECT_EQ(CL_INVALID_ARG_SIZE, retVal);
delete pipe;
}
TEST_F(KernelArgPipeTest, GivenPtrToNullWhenSettingKernelArgThenInvalidMemObjectErrorIsReturned) {
auto val = (cl_mem *)nullptr;
auto pVal = &val;
auto retVal = this->pKernel->setArg(0, sizeof(cl_mem *), pVal);
EXPECT_EQ(CL_INVALID_MEM_OBJECT, retVal);
}
TEST_F(KernelArgPipeTest, GivenNullWhenSettingKernelArgThenInvalidMemObjectErrorIsReturned) {
auto pVal = nullptr;
auto retVal = this->pKernel->setArg(0, sizeof(cl_mem *), pVal);
EXPECT_EQ(CL_INVALID_MEM_OBJECT, retVal);
} }

View File

@@ -1,5 +1,5 @@
# #
# Copyright (C) 2018-2022 Intel Corporation # Copyright (C) 2018-2025 Intel Corporation
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# #
@@ -39,7 +39,6 @@ set(IGDRCL_SRCS_tests_mem_obj
${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_helper_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_helper_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nv12_image_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nv12_image_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/packed_yuv_image_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/packed_yuv_image_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pipe_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sub_buffer_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/sub_buffer_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/zero_copy_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/zero_copy_tests.cpp
) )

View File

@@ -1,130 +0,0 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/test/common/fixtures/memory_management_fixture.h"
#include "shared/test/common/test_macros/test.h"
#include "opencl/source/mem_obj/pipe.h"
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
using namespace NEO;
// Tests for pipes
class PipeTest : public ::testing::Test, public MemoryManagementFixture {
public:
protected:
void SetUp() override {
}
void TearDown() override {
}
cl_int retVal = CL_INVALID_PIPE_SIZE;
MockContext context;
size_t size = 0u;
};
TEST_F(PipeTest, WhenCreatingPipeThenSuccessIsReturned) {
int errCode = CL_SUCCESS;
auto pipe = Pipe::create(&context, CL_MEM_READ_ONLY, 1, 20, nullptr, errCode);
EXPECT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, errCode);
delete pipe;
}
TEST_F(PipeTest, WhenCreatingPipeThenHeaderSizeAdditionIsReserved) {
int errCode = CL_SUCCESS;
auto pipe = Pipe::create(&context, CL_MEM_READ_ONLY, 1, 20, nullptr, errCode);
ASSERT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, errCode);
EXPECT_EQ((1 * (20 + 1)) + Pipe::intelPipeHeaderReservedSpace, pipe->getSize());
delete pipe;
}
TEST_F(PipeTest, WhenCreatingPipeThenHeaderIsInitialized) {
int errCode = CL_SUCCESS;
auto pipe = Pipe::create(&context, CL_MEM_READ_ONLY, 1, 20, nullptr, errCode);
ASSERT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, errCode);
EXPECT_EQ(21u, *reinterpret_cast<unsigned int *>(pipe->getCpuAddress()));
delete pipe;
}
TEST_F(PipeTest, GivenFailedAllocationInjectionWhenCreatingPipeThenOnlyFailingAllocationsAreNull) {
InjectedFunction method = [this](size_t failureIndex) {
auto retVal = CL_INVALID_VALUE;
auto pipe = Pipe::create(&context, CL_MEM_READ_ONLY, 1, 20, nullptr, retVal);
if (MemoryManagement::nonfailingAllocation == failureIndex) {
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(nullptr, pipe);
delete pipe;
} else {
EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal) << "for allocation " << failureIndex;
EXPECT_EQ(nullptr, pipe);
}
};
injectFailures(method);
}
TEST_F(PipeTest, givenPipeWhenEnqueueWriteForUnmapIsCalledThenReturnError) {
int errCode = CL_SUCCESS;
std::unique_ptr<Pipe> pipe(Pipe::create(&context, CL_MEM_READ_ONLY, 1, 20, nullptr, errCode));
ASSERT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, errCode);
MockCommandQueue cmdQ;
errCode = clEnqueueUnmapMemObject(&cmdQ, pipe.get(), nullptr, 0, nullptr, nullptr);
EXPECT_EQ(CL_INVALID_MEM_OBJECT, errCode);
}
TEST_F(PipeTest, givenPipeWithDifferentCpuAndGpuAddressesWhenSetArgPipeThenUseGpuAddress) {
int errCode = CL_SUCCESS;
auto pipe = Pipe::create(&context, CL_MEM_READ_ONLY, 1, 20, nullptr, errCode);
ASSERT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, errCode);
EXPECT_EQ(21u, *reinterpret_cast<unsigned int *>(pipe->getCpuAddress()));
uint64_t gpuAddress = 0x12345;
auto pipeAllocation = pipe->getGraphicsAllocation(context.getDevice(0)->getRootDeviceIndex());
auto gmmHelper = context.getDevice(0)->getGmmHelper();
auto canonizedGpuAddress = gmmHelper->canonize(gpuAddress);
pipeAllocation->setCpuPtrAndGpuAddress(pipeAllocation->getUnderlyingBuffer(), canonizedGpuAddress);
EXPECT_NE(reinterpret_cast<uint64_t>(pipeAllocation->getUnderlyingBuffer()), pipeAllocation->getGpuAddress());
uint64_t valueToPatch;
pipe->setPipeArg(&valueToPatch, sizeof(valueToPatch), context.getDevice(0)->getRootDeviceIndex());
EXPECT_EQ(valueToPatch, pipeAllocation->getGpuAddressToPatch());
delete pipe;
}
using MultiRootDeviceTests = MultiRootDeviceFixture;
TEST_F(MultiRootDeviceTests, GivenPipeGraphicsAllocationThenItHasCorrectRootDeviceIndex) {
int errCode = CL_SUCCESS;
std::unique_ptr<Pipe> pipe(Pipe::create(context.get(), CL_MEM_READ_ONLY, 1, 20, nullptr, errCode));
EXPECT_EQ(CL_SUCCESS, errCode);
ASSERT_NE(nullptr, pipe.get());
auto graphicsAllocation = pipe->getGraphicsAllocation(expectedRootDeviceIndex);
ASSERT_NE(nullptr, graphicsAllocation);
EXPECT_EQ(expectedRootDeviceIndex, graphicsAllocation->getRootDeviceIndex());
}

View File

@@ -1,37 +0,0 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/helpers/aligned_memory.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "opencl/source/mem_obj/pipe.h"
using namespace NEO;
class MockPipeStorage {
public:
MockPipeStorage() {
mockGfxAllocation = new MockGraphicsAllocation(data, sizeof(data) / 2);
}
MockPipeStorage(bool unaligned) {
mockGfxAllocation = new MockGraphicsAllocation(alignUp(&data, 4), sizeof(data) / 2);
}
char data[256]{};
MockGraphicsAllocation *mockGfxAllocation = nullptr;
};
class MockPipe : public MockPipeStorage, public Pipe {
public:
MockPipe(Context *context) : MockPipeStorage(), Pipe(context, 0, 1, 128, nullptr, &data, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockGfxAllocation)) {
}
~MockPipe() override {
if (!getContext()) {
delete mockGfxAllocation;
}
}
};

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2023 Intel Corporation * Copyright (C) 2020-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -31,8 +31,7 @@ bool TestChecks::supportsImages(const Context *pContext) {
} }
bool TestChecks::supportsOcl21(const std::unique_ptr<HardwareInfo> &pHardwareInfo) { bool TestChecks::supportsOcl21(const std::unique_ptr<HardwareInfo> &pHardwareInfo) {
return (pHardwareInfo->capabilityTable.supportsOcl21Features && pHardwareInfo->capabilityTable.supportsPipes && return (pHardwareInfo->capabilityTable.supportsOcl21Features && pHardwareInfo->capabilityTable.supportsIndependentForwardProgress);
pHardwareInfo->capabilityTable.supportsIndependentForwardProgress);
} }
bool TestChecks::supportsAuxResolves(const RootDeviceEnvironment &rootDeviceEnvironment) { bool TestChecks::supportsAuxResolves(const RootDeviceEnvironment &rootDeviceEnvironment) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -19,7 +19,6 @@ namespace TestChecks {
bool supportsSvm(const ClDevice *pClDevice); bool supportsSvm(const ClDevice *pClDevice);
bool supportsImages(const Context *pContext); bool supportsImages(const Context *pContext);
bool supportsOcl21(const std::unique_ptr<HardwareInfo> &pHardwareInfo); bool supportsOcl21(const std::unique_ptr<HardwareInfo> &pHardwareInfo);
bool supportsPipes(const ClDevice *pClDevice);
bool supportsAuxResolves(const RootDeviceEnvironment &rootDeviceEnvironment); bool supportsAuxResolves(const RootDeviceEnvironment &rootDeviceEnvironment);
} // namespace TestChecks } // namespace TestChecks

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2024 Intel Corporation * Copyright (C) 2018-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -88,13 +88,6 @@ void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer
} }
} }
auto forcePipeSupport = debugManager.flags.ForcePipeSupport.get();
if ((hwInfo.capabilityTable.supportsPipes && (forcePipeSupport == -1)) ||
(forcePipeSupport == 1)) {
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_pipes");
openclCFeatures.push_back(openClCFeature);
}
auto forceFp64Support = debugManager.flags.OverrideDefaultFP64Settings.get(); auto forceFp64Support = debugManager.flags.OverrideDefaultFP64Settings.get();
if ((hwInfo.capabilityTable.ftrSupportsFP64 && (forceFp64Support == -1)) || if ((hwInfo.capabilityTable.ftrSupportsFP64 && (forceFp64Support == -1)) ||
(forceFp64Support == 1)) { (forceFp64Support == 1)) {

View File

@@ -524,7 +524,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, EnableUsmConcurrentAccessSupport, 0, "0: default
DECLARE_DEBUG_VARIABLE(int32_t, EnableSharedSystemUsmSupport, -1, "-1: default, 0: shared system memory disabled, 1: shared system memory enabled") DECLARE_DEBUG_VARIABLE(int32_t, EnableSharedSystemUsmSupport, -1, "-1: default, 0: shared system memory disabled, 1: shared system memory enabled")
DECLARE_DEBUG_VARIABLE(int32_t, EnablePassInlineData, -1, "-1: default, 0: Do not allow to pass inline data 1: Enable passing of inline data") DECLARE_DEBUG_VARIABLE(int32_t, EnablePassInlineData, -1, "-1: default, 0: Do not allow to pass inline data 1: Enable passing of inline data")
DECLARE_DEBUG_VARIABLE(int32_t, ForceFineGrainedSVMSupport, -1, "-1: default, 0: Do not report Fine Grained SVM capabilities 1: Report SVM Fine Grained capabilities if device supports SVM") DECLARE_DEBUG_VARIABLE(int32_t, ForceFineGrainedSVMSupport, -1, "-1: default, 0: Do not report Fine Grained SVM capabilities 1: Report SVM Fine Grained capabilities if device supports SVM")
DECLARE_DEBUG_VARIABLE(int32_t, ForcePipeSupport, -1, "-1: default, 0: disabled, 1: enabled")
DECLARE_DEBUG_VARIABLE(int32_t, UseAsyncDrmExec, -1, "-1: default, 0: Disabled 1: Enabled. If enabled, pass EXEC_OBJECT_ASYNC to exec ioctl.") DECLARE_DEBUG_VARIABLE(int32_t, UseAsyncDrmExec, -1, "-1: default, 0: Disabled 1: Enabled. If enabled, pass EXEC_OBJECT_ASYNC to exec ioctl.")
DECLARE_DEBUG_VARIABLE(int32_t, UseBindlessMode, -1, "Use precompiled builtins in bindless mode, -1: api dependent, 0: disabled, 1: enabled") DECLARE_DEBUG_VARIABLE(int32_t, UseBindlessMode, -1, "Use precompiled builtins in bindless mode, -1: api dependent, 0: disabled, 1: enabled")
DECLARE_DEBUG_VARIABLE(int32_t, UseExternalAllocatorForSshAndDsh, -1, "Use 32 bit external allocator for ssh and dsh in Level Zero, -1: default, 0: disabled, 1: enabled") DECLARE_DEBUG_VARIABLE(int32_t, UseExternalAllocatorForSshAndDsh, -1, "Use 32 bit external allocator for ssh and dsh in Level Zero, -1: default, 0: disabled, 1: enabled")

View File

@@ -63,7 +63,6 @@ const RuntimeCapabilityTable ADLN::capabilityTable{
true, // ftr64KBpages true, // ftr64KBpages
false, // supportCacheFlushAfterWalker false, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
false, // supportsOnDemandPageFaults false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress false, // supportsIndependentForwardProgress

View File

@@ -63,7 +63,6 @@ const RuntimeCapabilityTable ADLP::capabilityTable{
true, // ftr64KBpages true, // ftr64KBpages
false, // supportCacheFlushAfterWalker false, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
false, // supportsOnDemandPageFaults false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress false, // supportsIndependentForwardProgress

View File

@@ -63,7 +63,6 @@ const RuntimeCapabilityTable ADLS::capabilityTable{
true, // ftr64KBpages true, // ftr64KBpages
false, // supportCacheFlushAfterWalker false, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
false, // supportsOnDemandPageFaults false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress false, // supportsIndependentForwardProgress

View File

@@ -63,7 +63,6 @@ const RuntimeCapabilityTable DG1::capabilityTable{
true, // instrumentationEnabled true, // instrumentationEnabled
true, // supportCacheFlushAfterWalker true, // supportCacheFlushAfterWalker
true, // supportsImages, true, // supportsImages,
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
false, // supportsOnDemandPageFaults false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress false, // supportsIndependentForwardProgress

View File

@@ -63,7 +63,6 @@ const RuntimeCapabilityTable RKL::capabilityTable{
true, // instrumentationEnabled true, // instrumentationEnabled
false, // supportCacheFlushAfterWalker false, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
false, // supportsOnDemandPageFaults false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress false, // supportsIndependentForwardProgress

View File

@@ -63,7 +63,6 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
true, // ftr64KBpages true, // ftr64KBpages
false, // supportCacheFlushAfterWalker false, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
false, // supportsOnDemandPageFaults false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress false, // supportsIndependentForwardProgress

View File

@@ -50,7 +50,6 @@ struct RuntimeCapabilityTable {
bool instrumentationEnabled; bool instrumentationEnabled;
bool supportCacheFlushAfterWalker; bool supportCacheFlushAfterWalker;
bool supportsImages; bool supportsImages;
bool supportsPipes;
bool supportsOcl21Features; bool supportsOcl21Features;
bool supportsOnDemandPageFaults; bool supportsOnDemandPageFaults;
bool supportsIndependentForwardProgress; bool supportsIndependentForwardProgress;
@@ -112,7 +111,6 @@ inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilit
result &= (lhs.deviceName == rhs.deviceName); result &= (lhs.deviceName == rhs.deviceName);
result &= (lhs.supportCacheFlushAfterWalker == rhs.supportCacheFlushAfterWalker); result &= (lhs.supportCacheFlushAfterWalker == rhs.supportCacheFlushAfterWalker);
result &= (lhs.supportsImages == rhs.supportsImages); result &= (lhs.supportsImages == rhs.supportsImages);
result &= (lhs.supportsPipes == rhs.supportsPipes);
result &= (lhs.supportsOcl21Features == rhs.supportsOcl21Features); result &= (lhs.supportsOcl21Features == rhs.supportsOcl21Features);
result &= (lhs.supportsOnDemandPageFaults == rhs.supportsOnDemandPageFaults); result &= (lhs.supportsOnDemandPageFaults == rhs.supportsOnDemandPageFaults);
result &= (lhs.supportsIndependentForwardProgress == rhs.supportsIndependentForwardProgress); result &= (lhs.supportsIndependentForwardProgress == rhs.supportsIndependentForwardProgress);

View File

@@ -66,7 +66,6 @@ const RuntimeCapabilityTable BMG::capabilityTable{
true, // instrumentationEnabled true, // instrumentationEnabled
false, // supportCacheFlushAfterWalker false, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
true, // supportsOnDemandPageFaults true, // supportsOnDemandPageFaults
true, // supportsIndependentForwardProgress true, // supportsIndependentForwardProgress

View File

@@ -64,7 +64,6 @@ const RuntimeCapabilityTable LNL::capabilityTable{
true, // instrumentationEnabled true, // instrumentationEnabled
false, // supportCacheFlushAfterWalker false, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
true, // supportsOnDemandPageFaults true, // supportsOnDemandPageFaults
true, // supportsIndependentForwardProgress true, // supportsIndependentForwardProgress

View File

@@ -64,7 +64,6 @@ const RuntimeCapabilityTable PTL::capabilityTable{
true, // instrumentationEnabled true, // instrumentationEnabled
false, // supportCacheFlushAfterWalker false, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
true, // supportsOnDemandPageFaults true, // supportsOnDemandPageFaults
true, // supportsIndependentForwardProgress true, // supportsIndependentForwardProgress

View File

@@ -76,7 +76,6 @@ const RuntimeCapabilityTable PVC::capabilityTable{
true, // instrumentationEnabled true, // instrumentationEnabled
false, // supportCacheFlushAfterWalker false, // supportCacheFlushAfterWalker
false, // supportsImages false, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
true, // supportsOnDemandPageFaults true, // supportsOnDemandPageFaults
true, // supportsIndependentForwardProgress true, // supportsIndependentForwardProgress

View File

@@ -61,7 +61,6 @@ const RuntimeCapabilityTable ARL::capabilityTable{
true, // instrumentationEnabled true, // instrumentationEnabled
true, // supportCacheFlushAfterWalker true, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
false, // supportsOnDemandPageFaults false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress false, // supportsIndependentForwardProgress

View File

@@ -66,7 +66,6 @@ const RuntimeCapabilityTable DG2::capabilityTable{
true, // instrumentationEnabled true, // instrumentationEnabled
true, // supportCacheFlushAfterWalker true, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
false, // supportsOnDemandPageFaults false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress false, // supportsIndependentForwardProgress

View File

@@ -62,7 +62,6 @@ const RuntimeCapabilityTable MTL::capabilityTable{
true, // instrumentationEnabled true, // instrumentationEnabled
true, // supportCacheFlushAfterWalker true, // supportCacheFlushAfterWalker
true, // supportsImages true, // supportsImages
false, // supportsPipes
true, // supportsOcl21Features true, // supportsOcl21Features
false, // supportsOnDemandPageFaults false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress false, // supportsIndependentForwardProgress

View File

@@ -200,7 +200,6 @@ EnableSharedSystemUsmSupport = -1
EnablePassInlineData = -1 EnablePassInlineData = -1
ForceFineGrainedSVMSupport = -1 ForceFineGrainedSVMSupport = -1
EnableImmediateCmdListHeapSharing = -1 EnableImmediateCmdListHeapSharing = -1
ForcePipeSupport = -1
ForceSystemMemoryPlacement = 0 ForceSystemMemoryPlacement = 0
ForceNonSystemMemoryPlacement = 0 ForceNonSystemMemoryPlacement = 0
DisableIndirectAccess = -1 DisableIndirectAccess = -1

View File

@@ -1229,10 +1229,6 @@ HWTEST2_F(DeviceTests, givenHwInfoWhenSlmSizeIsRequiredThenReturnCorrectValue, I
EXPECT_EQ(64u, defaultHwInfo->capabilityTable.slmSize); EXPECT_EQ(64u, defaultHwInfo->capabilityTable.slmSize);
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenXeHPAndLaterProductWhenCheckingPipesSupportThenFalseIsReturned) {
EXPECT_FALSE(defaultHwInfo->capabilityTable.supportsPipes);
}
TEST_F(DeviceTests, whenCheckingPreferredPlatformNameThenNullIsReturned) { TEST_F(DeviceTests, whenCheckingPreferredPlatformNameThenNullIsReturned) {
EXPECT_EQ(nullptr, defaultHwInfo->capabilityTable.preferredPlatformName); EXPECT_EQ(nullptr, defaultHwInfo->capabilityTable.preferredPlatformName);
} }

View File

@@ -68,10 +68,6 @@ HWTEST2_F(Gen12LpDeviceCaps, givenTglLpWhenCheckSupportCacheFlushAfterWalkerThen
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker); EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker);
} }
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpDeviceWhenCheckingPipesSupportThenFalseIsReturned) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsPipes);
}
HWTEST2_F(Gen12LpDeviceCaps, GivenTGLLPWhenCheckftr64KBpagesThenTrue, IsTGLLP) { HWTEST2_F(Gen12LpDeviceCaps, GivenTGLLPWhenCheckftr64KBpagesThenTrue, IsTGLLP) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages); EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
} }