mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
refactor: remove not needed code related to cl accelerator
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
cf1eeb8b51
commit
8b6aaceab4
@@ -1,16 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(RUNTIME_SRCS_ACCELERATORS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intel_accelerator.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intel_accelerator.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intel_motion_estimation.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intel_motion_estimation.h
|
||||
)
|
||||
|
||||
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_ACCELERATORS})
|
||||
set_property(GLOBAL PROPERTY RUNTIME_SRCS_ACCELERATORS ${RUNTIME_SRCS_ACCELERATORS})
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||
|
||||
#include "shared/source/helpers/get_info.h"
|
||||
|
||||
#include "opencl/source/context/context.h"
|
||||
#include "opencl/source/helpers/get_info_status_mapper.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
cl_int IntelAccelerator::getInfo(cl_accelerator_info_intel paramName,
|
||||
size_t paramValueSize,
|
||||
void *paramValue,
|
||||
size_t *paramValueSizeRet) const {
|
||||
cl_int result = CL_SUCCESS;
|
||||
size_t ret = GetInfo::invalidSourceSize;
|
||||
auto getInfoStatus = GetInfoStatus::invalidValue;
|
||||
|
||||
switch (paramName) {
|
||||
case CL_ACCELERATOR_DESCRIPTOR_INTEL: {
|
||||
ret = getDescriptorSize();
|
||||
getInfoStatus = GetInfo::getInfo(paramValue, paramValueSize, getDescriptor(), ret);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CL_ACCELERATOR_REFERENCE_COUNT_INTEL: {
|
||||
auto v = getReference();
|
||||
|
||||
ret = sizeof(cl_uint);
|
||||
getInfoStatus = GetInfo::getInfo(paramValue, paramValueSize, &v, ret);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CL_ACCELERATOR_CONTEXT_INTEL: {
|
||||
ret = sizeof(cl_context);
|
||||
cl_context ctx = static_cast<cl_context>(pContext);
|
||||
getInfoStatus = GetInfo::getInfo(paramValue, paramValueSize, &ctx, ret);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CL_ACCELERATOR_TYPE_INTEL: {
|
||||
auto v = getTypeId();
|
||||
ret = sizeof(cl_accelerator_type_intel);
|
||||
getInfoStatus = GetInfo::getInfo(paramValue, paramValueSize, &v, ret);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
getInfoStatus = GetInfoStatus::invalidValue;
|
||||
break;
|
||||
}
|
||||
|
||||
result = changeGetInfoStatusToCLResultType(getInfoStatus);
|
||||
GetInfo::setParamValueReturnSize(paramValueSizeRet, ret, getInfoStatus);
|
||||
|
||||
return result;
|
||||
}
|
||||
} // namespace NEO
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "opencl/source/api/cl_types.h"
|
||||
#include "opencl/source/helpers/base_object.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// cl_intel_accelerator Class Stuff
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NEO {
|
||||
|
||||
class Context;
|
||||
|
||||
typedef struct TagAcceleratorObjParams {
|
||||
cl_uint acceleratorType;
|
||||
cl_uint acceleratorFlags;
|
||||
} OCLRT_ACCELERATOR_OBJECT_PARAMS, *POCLRT_ACCELERATOR_OBJECT_PARAMS;
|
||||
|
||||
template <>
|
||||
struct OpenCLObjectMapper<_cl_accelerator_intel> {
|
||||
typedef class IntelAccelerator DerivedType;
|
||||
};
|
||||
|
||||
class IntelAccelerator : public BaseObject<_cl_accelerator_intel> {
|
||||
public:
|
||||
IntelAccelerator(Context *context,
|
||||
cl_accelerator_type_intel typeId,
|
||||
size_t descriptorSize,
|
||||
const void *descriptor) : pContext(context),
|
||||
typeId(typeId),
|
||||
descriptorSize(descriptorSize),
|
||||
pDescriptor(descriptor) {}
|
||||
|
||||
IntelAccelerator() {}
|
||||
|
||||
static const cl_ulong objectMagic = 0xC6D72FA2E81EA569ULL;
|
||||
|
||||
cl_accelerator_type_intel getTypeId() const { return typeId; }
|
||||
|
||||
size_t getDescriptorSize() const { return descriptorSize; }
|
||||
|
||||
const void *getDescriptor() const { return pDescriptor; }
|
||||
|
||||
cl_int getInfo(cl_accelerator_info_intel paramName,
|
||||
size_t paramValueSize,
|
||||
void *paramValue,
|
||||
size_t *paramValueSizeRet) const;
|
||||
|
||||
protected:
|
||||
Context *pContext = nullptr;
|
||||
const cl_accelerator_type_intel typeId = -1;
|
||||
const size_t descriptorSize = 0;
|
||||
const void *pDescriptor = nullptr;
|
||||
|
||||
private:
|
||||
};
|
||||
} // namespace NEO
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
cl_int VmeAccelerator::validateVmeArgs(Context *context,
|
||||
cl_accelerator_type_intel typeId,
|
||||
size_t descriptorSize,
|
||||
const void *descriptor) {
|
||||
const cl_motion_estimation_desc_intel *descObj =
|
||||
reinterpret_cast<const cl_motion_estimation_desc_intel *>(descriptor);
|
||||
|
||||
DEBUG_BREAK_IF(!context);
|
||||
DEBUG_BREAK_IF(typeId != CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL);
|
||||
|
||||
if ((descriptorSize != sizeof(cl_motion_estimation_desc_intel)) ||
|
||||
(descriptor == NULL)) {
|
||||
return CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL;
|
||||
}
|
||||
|
||||
switch (descObj->mb_block_type) {
|
||||
case CL_ME_MB_TYPE_16x16_INTEL:
|
||||
case CL_ME_MB_TYPE_8x8_INTEL:
|
||||
case CL_ME_MB_TYPE_4x4_INTEL:
|
||||
break;
|
||||
default:
|
||||
return CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL;
|
||||
}
|
||||
|
||||
switch (descObj->subpixel_mode) {
|
||||
case CL_ME_SUBPIXEL_MODE_INTEGER_INTEL:
|
||||
case CL_ME_SUBPIXEL_MODE_HPEL_INTEL:
|
||||
case CL_ME_SUBPIXEL_MODE_QPEL_INTEL:
|
||||
break;
|
||||
default:
|
||||
return CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL;
|
||||
}
|
||||
|
||||
switch (descObj->sad_adjust_mode) {
|
||||
case CL_ME_SAD_ADJUST_MODE_NONE_INTEL:
|
||||
case CL_ME_SAD_ADJUST_MODE_HAAR_INTEL:
|
||||
break;
|
||||
default:
|
||||
return CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL;
|
||||
}
|
||||
|
||||
switch (descObj->search_path_type) {
|
||||
case CL_ME_SEARCH_PATH_RADIUS_2_2_INTEL:
|
||||
case CL_ME_SEARCH_PATH_RADIUS_4_4_INTEL:
|
||||
case CL_ME_SEARCH_PATH_RADIUS_16_12_INTEL:
|
||||
break;
|
||||
default:
|
||||
return CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL;
|
||||
}
|
||||
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
} // namespace NEO
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// VmeAccelerator Class Stuff
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NEO {
|
||||
|
||||
class Context;
|
||||
|
||||
class VmeAccelerator : public IntelAccelerator {
|
||||
public:
|
||||
static VmeAccelerator *create(Context *context,
|
||||
cl_accelerator_type_intel typeId,
|
||||
size_t descriptorSize,
|
||||
const void *descriptor,
|
||||
cl_int &result) {
|
||||
|
||||
result = validateVmeArgs(context, typeId, descriptorSize, descriptor);
|
||||
VmeAccelerator *acc = nullptr;
|
||||
|
||||
if (result == CL_SUCCESS) {
|
||||
acc = new VmeAccelerator(
|
||||
context,
|
||||
typeId,
|
||||
descriptorSize,
|
||||
descriptor);
|
||||
}
|
||||
|
||||
return acc;
|
||||
}
|
||||
|
||||
protected:
|
||||
private:
|
||||
VmeAccelerator(Context *context,
|
||||
cl_accelerator_type_intel typeId,
|
||||
size_t descriptorSize,
|
||||
const void *descriptor) : IntelAccelerator(context,
|
||||
typeId,
|
||||
descriptorSize,
|
||||
descriptor) {
|
||||
}
|
||||
static cl_int validateVmeArgs(Context *context,
|
||||
cl_accelerator_type_intel typeId,
|
||||
size_t descriptorSize,
|
||||
const void *descriptor);
|
||||
};
|
||||
} // namespace NEO
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "shared/source/utilities/heap_allocator.h"
|
||||
#include "shared/source/utilities/staging_buffer_manager.h"
|
||||
|
||||
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
||||
#include "opencl/source/api/additional_extensions.h"
|
||||
#include "opencl/source/api/api_enter.h"
|
||||
#include "opencl/source/cl_device/cl_device.h"
|
||||
@@ -4473,7 +4472,7 @@ cl_accelerator_intel CL_API_CALL clCreateAcceleratorINTEL(
|
||||
cl_int *errcodeRet) {
|
||||
|
||||
TRACING_ENTER(ClCreateAcceleratorINTEL, &context, &acceleratorType, &descriptorSize, &descriptor, &errcodeRet);
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
cl_int retVal = CL_INVALID_ACCELERATOR_TYPE_INTEL;
|
||||
API_ENTER(&retVal);
|
||||
DBG_LOG_INPUTS("context", context,
|
||||
"acceleratorType", acceleratorType,
|
||||
@@ -4481,33 +4480,6 @@ cl_accelerator_intel CL_API_CALL clCreateAcceleratorINTEL(
|
||||
"descriptor", NEO::fileLoggerInstance().infoPointerToString(descriptor, descriptorSize));
|
||||
cl_accelerator_intel accelerator = nullptr;
|
||||
|
||||
do {
|
||||
retVal = validateObjects(context);
|
||||
|
||||
if (retVal != CL_SUCCESS) {
|
||||
retVal = CL_INVALID_CONTEXT;
|
||||
break;
|
||||
}
|
||||
|
||||
Context *pContext = castToObject<Context>(context);
|
||||
|
||||
DEBUG_BREAK_IF(!pContext);
|
||||
|
||||
switch (acceleratorType) {
|
||||
case CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL:
|
||||
accelerator = VmeAccelerator::create(
|
||||
pContext,
|
||||
acceleratorType,
|
||||
descriptorSize,
|
||||
descriptor,
|
||||
retVal);
|
||||
break;
|
||||
default:
|
||||
retVal = CL_INVALID_ACCELERATOR_TYPE_INTEL;
|
||||
}
|
||||
|
||||
} while (false);
|
||||
|
||||
if (errcodeRet) {
|
||||
*errcodeRet = retVal;
|
||||
}
|
||||
@@ -4520,23 +4492,10 @@ cl_int CL_API_CALL clRetainAcceleratorINTEL(
|
||||
cl_accelerator_intel accelerator) {
|
||||
|
||||
TRACING_ENTER(ClRetainAcceleratorINTEL, &accelerator);
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
cl_int retVal = CL_INVALID_ACCELERATOR_INTEL;
|
||||
API_ENTER(&retVal);
|
||||
DBG_LOG_INPUTS("accelerator", accelerator);
|
||||
|
||||
IntelAccelerator *pAccelerator = nullptr;
|
||||
|
||||
do {
|
||||
pAccelerator = castToObject<IntelAccelerator>(accelerator);
|
||||
|
||||
if (!pAccelerator) {
|
||||
retVal = CL_INVALID_ACCELERATOR_INTEL;
|
||||
break;
|
||||
}
|
||||
|
||||
pAccelerator->retain();
|
||||
} while (false);
|
||||
|
||||
TRACING_EXIT(ClRetainAcceleratorINTEL, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
@@ -4549,27 +4508,13 @@ cl_int CL_API_CALL clGetAcceleratorInfoINTEL(
|
||||
size_t *paramValueSizeRet) {
|
||||
|
||||
TRACING_ENTER(ClGetAcceleratorInfoINTEL, &accelerator, ¶mName, ¶mValueSize, ¶mValue, ¶mValueSizeRet);
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
cl_int retVal = CL_INVALID_ACCELERATOR_INTEL;
|
||||
API_ENTER(&retVal);
|
||||
DBG_LOG_INPUTS("accelerator", accelerator,
|
||||
"paramName", paramName,
|
||||
"paramValueSize", paramValueSize,
|
||||
"paramValue", NEO::fileLoggerInstance().infoPointerToString(paramValue, paramValueSize),
|
||||
"paramValueSizeRet", paramValueSizeRet);
|
||||
IntelAccelerator *pAccelerator = nullptr;
|
||||
|
||||
do {
|
||||
pAccelerator = castToObject<IntelAccelerator>(accelerator);
|
||||
|
||||
if (!pAccelerator) {
|
||||
retVal = CL_INVALID_ACCELERATOR_INTEL;
|
||||
break;
|
||||
}
|
||||
|
||||
retVal = pAccelerator->getInfo(
|
||||
paramName, paramValueSize, paramValue, paramValueSizeRet);
|
||||
|
||||
} while (false);
|
||||
|
||||
TRACING_EXIT(ClGetAcceleratorInfoINTEL, &retVal);
|
||||
return retVal;
|
||||
@@ -4579,27 +4524,10 @@ cl_int CL_API_CALL clReleaseAcceleratorINTEL(
|
||||
cl_accelerator_intel accelerator) {
|
||||
|
||||
TRACING_ENTER(ClReleaseAcceleratorINTEL, &accelerator);
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
if (wasPlatformTeardownCalled) {
|
||||
TRACING_EXIT(ClReleaseAcceleratorINTEL, &retVal);
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
cl_int retVal = CL_INVALID_ACCELERATOR_INTEL;
|
||||
API_ENTER(&retVal);
|
||||
DBG_LOG_INPUTS("accelerator", accelerator);
|
||||
|
||||
IntelAccelerator *pAccelerator = nullptr;
|
||||
|
||||
do {
|
||||
pAccelerator = castToObject<IntelAccelerator>(accelerator);
|
||||
|
||||
if (!pAccelerator) {
|
||||
retVal = CL_INVALID_ACCELERATOR_INTEL;
|
||||
break;
|
||||
}
|
||||
|
||||
pAccelerator->release();
|
||||
} while (false);
|
||||
|
||||
TRACING_EXIT(ClReleaseAcceleratorINTEL, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
#include "shared/source/utilities/lookup_array.h"
|
||||
#include "shared/source/utilities/tag_allocator.h"
|
||||
|
||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
||||
#include "opencl/source/built_ins/builtins_dispatch_builder.h"
|
||||
#include "opencl/source/cl_device/cl_device.h"
|
||||
#include "opencl/source/command_queue/cl_local_work_size.h"
|
||||
@@ -360,12 +358,8 @@ cl_int Kernel::initialize() {
|
||||
kernelArguments[i].type = IMAGE_OBJ;
|
||||
usingImages = true;
|
||||
} else if (arg.is<ArgDescriptor::argTSampler>()) {
|
||||
if (arg.getExtendedTypeInfo().isAccelerator) {
|
||||
kernelArgHandlers[i] = &Kernel::setArgAccelerator;
|
||||
} else {
|
||||
kernelArgHandlers[i] = &Kernel::setArgSampler;
|
||||
kernelArguments[i].type = SAMPLER_OBJ;
|
||||
}
|
||||
kernelArgHandlers[i] = &Kernel::setArgSampler;
|
||||
kernelArguments[i].type = SAMPLER_OBJ;
|
||||
} else {
|
||||
kernelArgHandlers[i] = &Kernel::setArgImmediate;
|
||||
}
|
||||
@@ -1717,63 +1711,6 @@ cl_int Kernel::setArgSampler(uint32_t argIndex,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
cl_int Kernel::setArgAccelerator(uint32_t argIndex,
|
||||
size_t argSize,
|
||||
const void *argVal) {
|
||||
auto retVal = CL_INVALID_ARG_VALUE;
|
||||
|
||||
if (argSize != sizeof(cl_accelerator_intel)) {
|
||||
return CL_INVALID_ARG_SIZE;
|
||||
}
|
||||
|
||||
if (!argVal) {
|
||||
return retVal;
|
||||
}
|
||||
|
||||
auto clAcceleratorObj = *(static_cast<const cl_accelerator_intel *>(argVal));
|
||||
DBG_LOG_INPUTS("setArgAccelerator cl_mem", clAcceleratorObj);
|
||||
|
||||
const auto pAccelerator = castToObject<IntelAccelerator>(clAcceleratorObj);
|
||||
|
||||
if (pAccelerator) {
|
||||
storeKernelArg(argIndex, ACCELERATOR_OBJ, clAcceleratorObj, argVal, argSize);
|
||||
|
||||
const auto &arg = kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[argIndex];
|
||||
const auto &argAsSmp = arg.as<ArgDescSampler>();
|
||||
|
||||
if (argAsSmp.samplerType == iOpenCL::SAMPLER_OBJECT_VME) {
|
||||
|
||||
const auto pVmeAccelerator = castToObjectOrAbort<VmeAccelerator>(pAccelerator);
|
||||
auto pDesc = static_cast<const cl_motion_estimation_desc_intel *>(pVmeAccelerator->getDescriptor());
|
||||
DEBUG_BREAK_IF(!pDesc);
|
||||
|
||||
if (arg.getExtendedTypeInfo().hasVmeExtendedDescriptor) {
|
||||
const auto &explicitArgsExtendedDescriptors = kernelInfo.kernelDescriptor.payloadMappings.explicitArgsExtendedDescriptors;
|
||||
UNRECOVERABLE_IF(argIndex >= explicitArgsExtendedDescriptors.size());
|
||||
auto vmeDescriptor = static_cast<ArgDescVme *>(explicitArgsExtendedDescriptors[argIndex].get());
|
||||
|
||||
auto pVmeMbBlockTypeDst = reinterpret_cast<cl_uint *>(ptrOffset(crossThreadData, vmeDescriptor->mbBlockType));
|
||||
*pVmeMbBlockTypeDst = pDesc->mb_block_type;
|
||||
|
||||
auto pVmeSubpixelMode = reinterpret_cast<cl_uint *>(ptrOffset(crossThreadData, vmeDescriptor->subpixelMode));
|
||||
*pVmeSubpixelMode = pDesc->subpixel_mode;
|
||||
|
||||
auto pVmeSadAdjustMode = reinterpret_cast<cl_uint *>(ptrOffset(crossThreadData, vmeDescriptor->sadAdjustMode));
|
||||
*pVmeSadAdjustMode = pDesc->sad_adjust_mode;
|
||||
|
||||
auto pVmeSearchPathType = reinterpret_cast<cl_uint *>(ptrOffset(crossThreadData, vmeDescriptor->searchPathType));
|
||||
*pVmeSearchPathType = pDesc->search_path_type;
|
||||
}
|
||||
|
||||
retVal = CL_SUCCESS;
|
||||
} else if (argAsSmp.samplerType == iOpenCL::SAMPLER_OBJECT_VE) {
|
||||
retVal = CL_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void Kernel::setKernelArgHandler(uint32_t argIndex, KernelArgHandler handler) {
|
||||
if (kernelArgHandlers.size() <= argIndex) {
|
||||
kernelArgHandlers.resize(argIndex + 1);
|
||||
|
||||
@@ -248,10 +248,6 @@ class Kernel : public ReferenceTrackedObject<Kernel>, NEO::NonCopyableAndNonMova
|
||||
size_t argSize,
|
||||
const void *argVal);
|
||||
|
||||
cl_int setArgAccelerator(uint32_t argIndex,
|
||||
size_t argSize,
|
||||
const void *argVal);
|
||||
|
||||
void storeKernelArg(uint32_t argIndex,
|
||||
KernelArgType argType,
|
||||
void *argObject,
|
||||
|
||||
@@ -93,8 +93,6 @@ set(IGDRCL_SRCS_tests_api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_get_program_info_tests.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_get_supported_image_formats_tests.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_icd_get_platform_ids_khr_tests.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_intel_accelerator_tests.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_intel_motion_estimation.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_intel_tracing_tests.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_link_program_tests.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_mem_locally_uncached_resource_tests.cpp
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "opencl/test/unit_test/api/cl_get_program_info_tests.inl"
|
||||
#include "opencl/test/unit_test/api/cl_get_supported_image_formats_tests.inl"
|
||||
#include "opencl/test/unit_test/api/cl_icd_get_platform_ids_khr_tests.inl"
|
||||
#include "opencl/test/unit_test/api/cl_intel_accelerator_tests.inl"
|
||||
#include "opencl/test/unit_test/api/cl_intel_tracing_tests.inl"
|
||||
#include "opencl/test/unit_test/api/cl_link_program_tests.inl"
|
||||
#include "opencl/test/unit_test/api/cl_release_command_queue_tests.inl"
|
||||
|
||||
@@ -1,323 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
||||
#include "opencl/source/context/context.h"
|
||||
#include "opencl/source/global_teardown/global_platform_teardown.h"
|
||||
#include "opencl/test/unit_test/api/cl_api_tests.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
namespace ULT {
|
||||
|
||||
struct IntelAcceleratorTest : public ApiTests {
|
||||
public:
|
||||
IntelAcceleratorTest() {}
|
||||
|
||||
void SetUp() override {
|
||||
ApiTests::SetUp();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
ApiTests::TearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
cl_accelerator_intel accelerator = nullptr;
|
||||
cl_motion_estimation_desc_intel desc;
|
||||
cl_int retVal = 0xEEEEEEEEu;
|
||||
cl_int result = -1;
|
||||
};
|
||||
|
||||
struct IntelAcceleratorTestWithValidDescriptor : IntelAcceleratorTest {
|
||||
|
||||
IntelAcceleratorTestWithValidDescriptor() {}
|
||||
|
||||
void SetUp() override {
|
||||
IntelAcceleratorTest::SetUp();
|
||||
|
||||
desc.mb_block_type = CL_ME_MB_TYPE_16x16_INTEL;
|
||||
desc.subpixel_mode = CL_ME_SUBPIXEL_MODE_QPEL_INTEL;
|
||||
desc.sad_adjust_mode = CL_ME_SAD_ADJUST_MODE_HAAR_INTEL;
|
||||
desc.search_path_type = CL_ME_SEARCH_PATH_RADIUS_2_2_INTEL;
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
IntelAcceleratorTest::TearDown();
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(IntelAcceleratorTestWithValidDescriptor, GivenInvalidAcceleratorTypeWhenCreatingAcceleratorThenClInvalidAcceleratorTypeIntelErrorIsReturned) {
|
||||
auto invalidAcceleratorType = static_cast<cl_accelerator_type_intel>(0xEEEEEEEE);
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
invalidAcceleratorType,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(static_cast<cl_accelerator_intel>(nullptr), accelerator);
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_TYPE_INTEL, retVal);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorTestWithValidDescriptor, GivenInvalidContextWhenCreatingAcceleratorThenClInvalidContextErrorIsReturned) {
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
nullptr,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
EXPECT_EQ(static_cast<cl_accelerator_intel>(nullptr), accelerator);
|
||||
EXPECT_EQ(CL_INVALID_CONTEXT, retVal);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorTest, GivenNullAcceleratorWhenReleasingAcceleratorThenClInvalidAcceleratorIntelErrorIsReturned) {
|
||||
result = clReleaseAcceleratorINTEL(nullptr);
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_INTEL, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorTest, GivenNullAcceleratorWhenRetainingAcceleratorThenClInvalidAcceleratorIntelErrorIsReturned) {
|
||||
result = clRetainAcceleratorINTEL(nullptr);
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_INTEL, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorTest, GivenInvalidAcceleratorWhenTerdownWasCalledThenSuccessReturned) {
|
||||
wasPlatformTeardownCalled = true;
|
||||
auto retVal = clReleaseAcceleratorINTEL(nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
wasPlatformTeardownCalled = false;
|
||||
}
|
||||
|
||||
struct IntelAcceleratorGetInfoTest : IntelAcceleratorTestWithValidDescriptor {
|
||||
|
||||
IntelAcceleratorGetInfoTest() {}
|
||||
|
||||
void SetUp() override {
|
||||
IntelAcceleratorTestWithValidDescriptor::SetUp();
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
ASSERT_NE(nullptr, accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, result);
|
||||
|
||||
IntelAcceleratorTestWithValidDescriptor::TearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
size_t paramValueSizeRet = 0;
|
||||
};
|
||||
|
||||
TEST_F(IntelAcceleratorTest, GivenNullAcceleratorWhenGettingAcceleratorInfoThenClInvalidAcceleratorIntelErrorIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
nullptr, 0,
|
||||
0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_INTEL, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorTest, GivenNullAcceleratorWhenGettingAcceleratorInfoThenParamValueAndSizeArePreserved) {
|
||||
cl_uint paramValue = 0xEEEEEEE1u;
|
||||
size_t paramSize = 0xEEEEEEE3u;
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
nullptr, 0,
|
||||
sizeof(paramValue), ¶mValue, ¶mSize);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_INTEL, result);
|
||||
|
||||
// No changes to inputs
|
||||
EXPECT_EQ(static_cast<cl_uint>(0xEEEEEEE1u), paramValue);
|
||||
EXPECT_EQ(0xEEEEEEE3u, paramSize);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenInvalidParamNameWhenGettingAcceleratorInfoThenClInvalidValueErrorIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
0xEEEEEEEE,
|
||||
sizeof(cl_uint),
|
||||
nullptr,
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenClAcceleratorReferenceCountIntelWhenGettingAcceleratorInfoThenParamValueSizeRetHasCorrectSize) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint),
|
||||
nullptr,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_uint), paramValueSizeRet);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenClAcceleratorReferenceCountIntelWhenGettingAcceleratorInfoThenParamValueIsOne) {
|
||||
cl_uint paramValue = static_cast<cl_uint>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint),
|
||||
¶mValue,
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(1u, paramValue);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenLongForDescriptorSizeWhenGettingAcceleratorInfoThenCorrectValuesAreReturned) {
|
||||
cl_uint paramValue = static_cast<cl_uint>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint) + 1,
|
||||
¶mValue,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_uint), paramValueSizeRet);
|
||||
EXPECT_EQ(1u, paramValue);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenShortForDescriptorSizeWhenGettingAcceleratorInfoThenClInvalidValueErrorIsReturned) {
|
||||
cl_uint paramValue = static_cast<cl_uint>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint) - 1,
|
||||
¶mValue,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenZeroForDescriptorSizeGivenLongForDescriptorSizeWhenGettingAcceleratorInfoThenCorrectValuesAreReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
0,
|
||||
nullptr,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_uint), paramValueSizeRet);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenCallToRetainAcceleratorWhenGettingAcceleratorInfoThenParamValueIsTwo) {
|
||||
cl_uint paramValue = static_cast<cl_uint>(-1);
|
||||
|
||||
result = clRetainAcceleratorINTEL(accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, result);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint),
|
||||
¶mValue,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(2u, paramValue);
|
||||
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint),
|
||||
¶mValue,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(1u, paramValue);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenNullPtrForParamValueWhenGettingAcceleratorInfoThenClSuccessIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_CONTEXT_INTEL,
|
||||
sizeof(cl_context),
|
||||
nullptr,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_context), paramValueSizeRet);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenLongForDescriptorSizeWhenGettingAcceleratorContextInfoThenCorrectValuesAreReturned) {
|
||||
cl_context paramValue = reinterpret_cast<cl_context>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_CONTEXT_INTEL,
|
||||
sizeof(cl_context) + 1,
|
||||
¶mValue,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_context), paramValueSizeRet);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenAcceleratorContextIntelWhenGettingAcceleratorInfoThenCorrectValuesAreReturned) {
|
||||
cl_context paramValue = reinterpret_cast<cl_context>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_CONTEXT_INTEL,
|
||||
sizeof(cl_context),
|
||||
¶mValue,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_context), paramValueSizeRet);
|
||||
|
||||
cl_context referenceContext = static_cast<cl_context>(pContext);
|
||||
EXPECT_EQ(referenceContext, paramValue);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenShortForDescriptorSizeWhenGettingAcceleratorContextInfoThenClInvalidValueErrorIsReturned) {
|
||||
cl_context paramValue = reinterpret_cast<cl_context>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_CONTEXT_INTEL,
|
||||
sizeof(cl_context) - 1,
|
||||
¶mValue,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GivenZeroForDescriptorSizeGivenLongForDescriptorSizeWhenGettingAcceleratorContextInfoThenCorrectValuesAreReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_CONTEXT_INTEL,
|
||||
0,
|
||||
nullptr,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_context), paramValueSizeRet);
|
||||
}
|
||||
} // namespace ULT
|
||||
@@ -1,503 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
||||
#include "opencl/source/context/context.h"
|
||||
#include "opencl/test/unit_test/api/cl_api_tests.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
namespace ULT {
|
||||
|
||||
struct IntelMotionEstimationTest : public ApiTests {
|
||||
public:
|
||||
IntelMotionEstimationTest() {}
|
||||
|
||||
void SetUp() override {
|
||||
ApiTests::SetUp();
|
||||
|
||||
desc.mb_block_type = CL_ME_MB_TYPE_16x16_INTEL;
|
||||
desc.subpixel_mode = CL_ME_SUBPIXEL_MODE_QPEL_INTEL;
|
||||
desc.sad_adjust_mode = CL_ME_SAD_ADJUST_MODE_HAAR_INTEL;
|
||||
desc.search_path_type = CL_ME_SEARCH_PATH_RADIUS_2_2_INTEL;
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
ApiTests::TearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
cl_accelerator_intel accelerator = nullptr;
|
||||
cl_motion_estimation_desc_intel desc;
|
||||
cl_int retVal = 0xEEEEEEEEu;
|
||||
cl_int result = -1;
|
||||
};
|
||||
|
||||
typedef IntelMotionEstimationTest IntelMotionEstimationNegativeTest;
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenNullDescriptorWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
nullptr,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
ASSERT_EQ(static_cast<cl_accelerator_intel>(nullptr), accelerator);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenDescriptorSizeLongerThanActualWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel) + 1,
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
ASSERT_EQ(static_cast<cl_accelerator_intel>(nullptr), accelerator);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenDescriptorSizeShorterThanActualWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel) - 1,
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
ASSERT_EQ(static_cast<cl_accelerator_intel>(nullptr), accelerator);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenInvalidMacroBlockTypeWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
desc.mb_block_type = 0xEEEEEEEE;
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
nullptr,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
ASSERT_EQ(static_cast<cl_accelerator_intel>(nullptr), accelerator);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenInvalidSubPixelModeWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
desc.subpixel_mode = 0xEEEEEEEE;
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
nullptr,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
ASSERT_EQ(static_cast<cl_accelerator_intel>(nullptr), accelerator);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenInvalidSadAdjustModeWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
desc.sad_adjust_mode = 0xEEEEEEEE;
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
nullptr,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
ASSERT_EQ(static_cast<cl_accelerator_intel>(nullptr), accelerator);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenInvalidSearchPathTypeWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
desc.search_path_type = 0xEEEEEEEE;
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
nullptr,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
ASSERT_EQ(static_cast<cl_accelerator_intel>(nullptr), accelerator);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationTest, GivenValidArgumentsWhenCreatingAcceleratorThenAcceleratorIsCreated) {
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
ASSERT_NE(nullptr, accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
auto acc = static_cast<VmeAccelerator *>(accelerator);
|
||||
|
||||
delete acc;
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationTest, GivenNullReturnWhenCreatingAcceleratorThenAcceleratorIsCreated) {
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
nullptr);
|
||||
|
||||
ASSERT_NE(nullptr, accelerator);
|
||||
|
||||
auto acc = static_cast<VmeAccelerator *>(accelerator);
|
||||
|
||||
delete acc;
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationTest, GivenValidAcceleratorWhenReleasingAcceleratorThenSuccessIsReturned) {
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
ASSERT_NE(nullptr, accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationTest, GivenValidAcceleratorWhenRetainingAndReleasingAcceleratorThenReferenceCountIsAdjustedCorrectly) {
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
ASSERT_NE(nullptr, accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
auto pAccelerator = static_cast<IntelAccelerator *>(accelerator);
|
||||
|
||||
ASSERT_EQ(1, pAccelerator->getReference());
|
||||
|
||||
result = clRetainAcceleratorINTEL(accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, result);
|
||||
ASSERT_EQ(2, pAccelerator->getReference());
|
||||
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(1, pAccelerator->getReference());
|
||||
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
}
|
||||
|
||||
struct IntelMotionEstimationGetInfoTest : public IntelMotionEstimationTest {
|
||||
public:
|
||||
IntelMotionEstimationGetInfoTest() : typeReturned(static_cast<cl_accelerator_type_intel>(-1)),
|
||||
paramValueSizeRet(static_cast<size_t>(-1)) {}
|
||||
|
||||
void SetUp() override {
|
||||
IntelMotionEstimationTest::SetUp();
|
||||
|
||||
descReturn.mb_block_type = static_cast<cl_uint>(-1);
|
||||
descReturn.subpixel_mode = static_cast<cl_uint>(-1);
|
||||
descReturn.sad_adjust_mode = static_cast<cl_uint>(-1);
|
||||
descReturn.search_path_type = static_cast<cl_uint>(-1);
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
ASSERT_NE(nullptr, accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
|
||||
IntelMotionEstimationTest::TearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
cl_motion_estimation_desc_intel descReturn;
|
||||
cl_accelerator_type_intel typeReturned;
|
||||
size_t paramValueSizeRet;
|
||||
};
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenValidParamsWhenGettingAcceleratorInfoThenDescriptorContainsCorrectInformation) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel), // exact
|
||||
&descReturn,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), paramValueSizeRet);
|
||||
|
||||
EXPECT_EQ(static_cast<cl_uint>(CL_ME_MB_TYPE_16x16_INTEL), descReturn.mb_block_type);
|
||||
EXPECT_EQ(static_cast<cl_uint>(CL_ME_SUBPIXEL_MODE_QPEL_INTEL), descReturn.subpixel_mode);
|
||||
EXPECT_EQ(static_cast<cl_uint>(CL_ME_SAD_ADJUST_MODE_HAAR_INTEL), descReturn.sad_adjust_mode);
|
||||
EXPECT_EQ(static_cast<cl_uint>(CL_ME_SEARCH_PATH_RADIUS_2_2_INTEL), descReturn.search_path_type);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenTooShortDescriptorLengthWhenGettingAcceleratorInfoThenClInvalidValueErrorIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel) - 1, // short
|
||||
&descReturn,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenDescriptorLengthZeroWhenGettingAcceleratorInfoThenClInvalidValueErrorIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
0,
|
||||
&descReturn,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenInvalidParametersWhenGettingAcceleratorInfoThenValueSizeRetIsNotUpdated) {
|
||||
paramValueSizeRet = 0x1234;
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
0,
|
||||
&descReturn,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
EXPECT_EQ(0x1234u, paramValueSizeRet);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenLongerDescriptorLengthWhenGettingAcceleratorInfoThenCorrectDescriptorLengthIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel) + 1, // long
|
||||
&descReturn,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), paramValueSizeRet);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenDescriptorLengthZeroAndDescriptorNullWhenGettingAcceleratorInfoThenCorrectDescriptorLengthIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
0, // query required size w/nullptr return
|
||||
nullptr,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), paramValueSizeRet);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeWhenGettingAcceleratorInfoThenAcceleratorTypeMotionEstimationIntelIsReturned) {
|
||||
ASSERT_EQ(sizeof(cl_accelerator_type_intel), sizeof(cl_uint));
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
sizeof(cl_uint),
|
||||
&typeReturned,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet);
|
||||
|
||||
EXPECT_EQ(static_cast<cl_accelerator_type_intel>(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), typeReturned);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelWhenGettingAcceleratorInfoThenClAcceleratorTypeMotionEstimationIntelIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
sizeof(cl_uint), // exact
|
||||
&typeReturned,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet);
|
||||
|
||||
EXPECT_EQ(static_cast<cl_accelerator_type_intel>(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), typeReturned);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTooShortTypeLengthWhenGettingAcceleratorInfoThenClInvalidValueIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
sizeof(cl_uint) - 1, // short
|
||||
&typeReturned,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTypeLengthZeroWhenGettingAcceleratorInfoThenClInvalidValueIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
0, // very short
|
||||
&typeReturned,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTooLongTypeLengthWhenGettingAcceleratorInfoThenCorrectLengthIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
sizeof(cl_uint) + 1, // long
|
||||
&typeReturned,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndNullTypeWhenGettingAcceleratorInfoThenCorrectLengthIsReturned) {
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
0,
|
||||
nullptr,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationTest, GivenDescriptor8x8IntegerNone2x2WhenCreatingAcceleratorThenSuccessIsReturned) {
|
||||
desc.mb_block_type = CL_ME_MB_TYPE_8x8_INTEL;
|
||||
desc.subpixel_mode = CL_ME_SUBPIXEL_MODE_INTEGER_INTEL;
|
||||
desc.sad_adjust_mode = CL_ME_SAD_ADJUST_MODE_NONE_INTEL;
|
||||
desc.search_path_type = CL_ME_SEARCH_PATH_RADIUS_2_2_INTEL;
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationTest, GivenDescriptor4x4HpelHaar16x12WhenCreatingAcceleratorThenSuccessIsReturned) {
|
||||
desc.mb_block_type = CL_ME_MB_TYPE_4x4_INTEL;
|
||||
desc.subpixel_mode = CL_ME_SUBPIXEL_MODE_HPEL_INTEL;
|
||||
desc.sad_adjust_mode = CL_ME_SAD_ADJUST_MODE_HAAR_INTEL;
|
||||
desc.search_path_type = CL_ME_SEARCH_PATH_RADIUS_16_12_INTEL;
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationTest, GivenDescriptor16x16HpelHaar4x4WhenCreatingAcceleratorThenSuccessIsReturned) {
|
||||
desc.mb_block_type = CL_ME_MB_TYPE_16x16_INTEL;
|
||||
desc.subpixel_mode = CL_ME_SUBPIXEL_MODE_QPEL_INTEL;
|
||||
desc.sad_adjust_mode = CL_ME_SAD_ADJUST_MODE_HAAR_INTEL;
|
||||
desc.search_path_type = CL_ME_SEARCH_PATH_RADIUS_4_4_INTEL;
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenInvalidBlockTypeWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
desc.mb_block_type = static_cast<cl_uint>(-1);
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenInvalidSubpixelModeWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
desc.subpixel_mode = static_cast<cl_uint>(-1);
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenInvalidAdjustModeWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
desc.sad_adjust_mode = static_cast<cl_uint>(-1);
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
}
|
||||
|
||||
TEST_F(IntelMotionEstimationNegativeTest, GivenInvalidPathTypeWhenCreatingAcceleratorThenClInvalidAcceleratorDescriptorIntelErrorIsReturned) {
|
||||
desc.search_path_type = static_cast<cl_uint>(-1);
|
||||
|
||||
accelerator = clCreateAcceleratorINTEL(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel),
|
||||
&desc,
|
||||
&retVal);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, retVal);
|
||||
}
|
||||
} // namespace ULT
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/common/utilities/base_object_utils.h"
|
||||
|
||||
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
||||
#include "opencl/source/built_ins/aux_translation_builtin.h"
|
||||
#include "opencl/source/built_ins/builtins_dispatch_builder.h"
|
||||
#include "opencl/source/helpers/dispatch_info_builder.h"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||
#include "opencl/source/api/api.h"
|
||||
#include "opencl/source/api/cl_types.h"
|
||||
#include "opencl/source/context/context.h"
|
||||
@@ -94,7 +93,6 @@ class MockObject<Program> : public MockObjectBase<Program> {
|
||||
|
||||
typedef ::testing::Types<
|
||||
MockPlatform,
|
||||
IntelAccelerator,
|
||||
// Context,
|
||||
// Program,
|
||||
// Kernel,
|
||||
@@ -105,7 +103,6 @@ typedef ::testing::Types<
|
||||
|
||||
typedef ::testing::Types<
|
||||
MockPlatform,
|
||||
IntelAccelerator,
|
||||
Context,
|
||||
Program,
|
||||
Buffer,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018-2024 Intel Corporation
|
||||
# Copyright (C) 2018-2025 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -8,7 +8,6 @@ set(IGDRCL_SRCS_tests_kernel
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cache_flush_tests.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/clone_kernel_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_accelerator_arg_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_buffer_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_buffer_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_buffer_fixture.cpp
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/common/utilities/base_object_utils.h"
|
||||
|
||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
||||
#include "opencl/source/helpers/sampler_helpers.h"
|
||||
#include "opencl/source/kernel/kernel.h"
|
||||
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
||||
@@ -286,68 +284,6 @@ TEST_F(CloneKernelTest, givenArgImageWhenCloningKernelThenKernelInfoIsCorrect) {
|
||||
EXPECT_EQ(imageDepth, *pImgDepth);
|
||||
}
|
||||
|
||||
TEST_F(CloneKernelTest, givenArgAcceleratorWhenCloningKernelThenKernelInfoIsCorrect) {
|
||||
pKernelInfo->addArgAccelerator(0, undefined<SurfaceStateHeapOffset>, 0x4, 0x14, 0x1c, 0xc);
|
||||
|
||||
cl_motion_estimation_desc_intel desc = {
|
||||
CL_ME_MB_TYPE_4x4_INTEL,
|
||||
CL_ME_SUBPIXEL_MODE_QPEL_INTEL,
|
||||
CL_ME_SAD_ADJUST_MODE_HAAR_INTEL,
|
||||
CL_ME_SEARCH_PATH_RADIUS_16_12_INTEL};
|
||||
|
||||
cl_accelerator_intel accelerator = VmeAccelerator::create(
|
||||
context.get(),
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL, sizeof(desc), &desc,
|
||||
retVal);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, accelerator);
|
||||
|
||||
auto rootDeviceIndex = *context->getRootDeviceIndices().begin();
|
||||
pSourceKernel[rootDeviceIndex]->setKernelArgHandler(0, &Kernel::setArgAccelerator);
|
||||
pClonedKernel[rootDeviceIndex]->setKernelArgHandler(0, &Kernel::setArgAccelerator);
|
||||
|
||||
retVal = pSourceKernel[rootDeviceIndex]->setArg(0, sizeof(cl_accelerator_intel), &accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
EXPECT_EQ(1u, pSourceKernel[rootDeviceIndex]->getKernelArguments().size());
|
||||
EXPECT_EQ(Kernel::ACCELERATOR_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 crossThreadData = reinterpret_cast<uint32_t *>(pClonedKernel[rootDeviceIndex]->getCrossThreadData());
|
||||
ASSERT_TRUE(pClonedKernel[rootDeviceIndex]->getKernelInfo().getArgDescriptorAt(0).getExtendedTypeInfo().hasVmeExtendedDescriptor);
|
||||
const auto clonedArgDescVme = reinterpret_cast<ArgDescVme *>(pClonedKernel[rootDeviceIndex]->getKernelInfo().kernelDescriptor.payloadMappings.explicitArgsExtendedDescriptors[0].get());
|
||||
|
||||
uint32_t *pMbBlockType = ptrOffset(crossThreadData, clonedArgDescVme->mbBlockType);
|
||||
EXPECT_EQ(desc.mb_block_type, *pMbBlockType);
|
||||
|
||||
uint32_t *pSubpixelMode = ptrOffset(crossThreadData, clonedArgDescVme->subpixelMode);
|
||||
EXPECT_EQ(desc.subpixel_mode, *pSubpixelMode);
|
||||
|
||||
uint32_t *pSadAdjustMode = ptrOffset(crossThreadData, clonedArgDescVme->sadAdjustMode);
|
||||
EXPECT_EQ(desc.sad_adjust_mode, *pSadAdjustMode);
|
||||
|
||||
uint32_t *pSearchPathType = ptrOffset(crossThreadData, clonedArgDescVme->searchPathType);
|
||||
EXPECT_EQ(desc.search_path_type, *pSearchPathType);
|
||||
|
||||
retVal = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
TEST_F(CloneKernelTest, givenArgSamplerWhenCloningKernelThenKernelInfoIsCorrect) {
|
||||
auto sampler = clUniquePtr<Sampler>(new MockSampler(context.get(),
|
||||
true,
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
||||
#include "opencl/source/kernel/kernel.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/mocks/mock_cl_device.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_program.h"
|
||||
|
||||
#include "CL/cl.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
class KernelArgAcceleratorFixture : public ContextFixture, public ClDeviceFixture {
|
||||
|
||||
using ContextFixture::setUp;
|
||||
|
||||
public:
|
||||
KernelArgAcceleratorFixture() {
|
||||
}
|
||||
|
||||
protected:
|
||||
void setUp() {
|
||||
desc = {
|
||||
CL_ME_MB_TYPE_4x4_INTEL,
|
||||
CL_ME_SUBPIXEL_MODE_QPEL_INTEL,
|
||||
CL_ME_SAD_ADJUST_MODE_HAAR_INTEL,
|
||||
CL_ME_SEARCH_PATH_RADIUS_16_12_INTEL};
|
||||
|
||||
ClDeviceFixture::setUp();
|
||||
cl_device_id device = pClDevice;
|
||||
ContextFixture::setUp(1, &device);
|
||||
|
||||
pKernelInfo = std::make_unique<MockKernelInfo>();
|
||||
pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 1;
|
||||
|
||||
pKernelInfo->addArgAccelerator(0, 0x20, 0x04, 0x14, 0x1c, 0x0c);
|
||||
|
||||
pProgram = new MockProgram(pContext, false, toClDeviceVector(*pClDevice));
|
||||
pKernel = new MockKernel(pProgram, *pKernelInfo, *pClDevice);
|
||||
ASSERT_EQ(CL_SUCCESS, pKernel->initialize());
|
||||
|
||||
pKernel->setKernelArgHandler(0, &Kernel::setArgAccelerator);
|
||||
|
||||
pCrossThreadData[0x04] = desc.mb_block_type;
|
||||
pCrossThreadData[0x0c] = desc.subpixel_mode;
|
||||
pCrossThreadData[0x14] = desc.sad_adjust_mode;
|
||||
pCrossThreadData[0x1c] = desc.sad_adjust_mode;
|
||||
|
||||
pKernel->setCrossThreadData(&pCrossThreadData[0], sizeof(pCrossThreadData));
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
delete pKernel;
|
||||
|
||||
delete pProgram;
|
||||
ContextFixture::tearDown();
|
||||
ClDeviceFixture::tearDown();
|
||||
}
|
||||
|
||||
cl_motion_estimation_desc_intel desc;
|
||||
MockProgram *pProgram = nullptr;
|
||||
MockKernel *pKernel = nullptr;
|
||||
std::unique_ptr<MockKernelInfo> pKernelInfo;
|
||||
char pCrossThreadData[64];
|
||||
};
|
||||
|
||||
typedef Test<KernelArgAcceleratorFixture> KernelArgAcceleratorTest;
|
||||
|
||||
TEST_F(KernelArgAcceleratorTest, WhenCreatingVmeAcceleratorThenCorrectKernelArgsAreSet) {
|
||||
cl_int status;
|
||||
cl_accelerator_intel accelerator = VmeAccelerator::create(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL, sizeof(desc), &desc,
|
||||
status);
|
||||
ASSERT_EQ(CL_SUCCESS, status);
|
||||
ASSERT_NE(nullptr, accelerator);
|
||||
|
||||
status = this->pKernel->setArg(0, sizeof(cl_accelerator_intel), &accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, status);
|
||||
|
||||
char *crossThreadData = pKernel->getCrossThreadData();
|
||||
|
||||
const auto vmeDescriptor = reinterpret_cast<ArgDescVme *>(pKernelInfo->kernelDescriptor.payloadMappings.explicitArgsExtendedDescriptors[0].get());
|
||||
|
||||
uint32_t *pMbBlockType = ptrOffset(reinterpret_cast<uint32_t *>(crossThreadData), vmeDescriptor->mbBlockType);
|
||||
EXPECT_EQ(desc.mb_block_type, *pMbBlockType);
|
||||
|
||||
uint32_t *pSubpixelMode = ptrOffset(reinterpret_cast<uint32_t *>(crossThreadData), vmeDescriptor->subpixelMode);
|
||||
EXPECT_EQ(desc.subpixel_mode, *pSubpixelMode);
|
||||
|
||||
uint32_t *pSadAdjustMode = ptrOffset(reinterpret_cast<uint32_t *>(crossThreadData), vmeDescriptor->sadAdjustMode);
|
||||
EXPECT_EQ(desc.sad_adjust_mode, *pSadAdjustMode);
|
||||
|
||||
uint32_t *pSearchPathType = ptrOffset(reinterpret_cast<uint32_t *>(crossThreadData), vmeDescriptor->searchPathType);
|
||||
EXPECT_EQ(desc.search_path_type, *pSearchPathType);
|
||||
|
||||
status = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, status);
|
||||
}
|
||||
|
||||
TEST_F(KernelArgAcceleratorTest, GivenNullWhenSettingKernelArgThenInvalidArgValueErrorIsReturned) {
|
||||
cl_int status;
|
||||
|
||||
status = this->pKernel->setArg(0, sizeof(cl_accelerator_intel), nullptr);
|
||||
ASSERT_EQ(CL_INVALID_ARG_VALUE, status);
|
||||
}
|
||||
|
||||
TEST_F(KernelArgAcceleratorTest, GivenInvalidSizeWhenSettingKernelArgThenInvalidArgSizeErrorIsReturned) {
|
||||
cl_int status;
|
||||
cl_accelerator_intel accelerator = VmeAccelerator::create(
|
||||
pContext,
|
||||
CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL, sizeof(desc), &desc,
|
||||
status);
|
||||
ASSERT_EQ(CL_SUCCESS, status);
|
||||
ASSERT_NE(nullptr, accelerator);
|
||||
|
||||
status = this->pKernel->setArg(0, sizeof(cl_accelerator_intel) - 1, accelerator);
|
||||
ASSERT_EQ(CL_INVALID_ARG_SIZE, status);
|
||||
|
||||
status = clReleaseAcceleratorINTEL(accelerator);
|
||||
EXPECT_EQ(CL_SUCCESS, status);
|
||||
}
|
||||
|
||||
TEST_F(KernelArgAcceleratorTest, GivenInvalidAcceleratorWhenSettingKernelArgThenInvalidArgValueErrorIsReturned) {
|
||||
cl_int status;
|
||||
|
||||
const void *notAnAccelerator = static_cast<void *>(pKernel);
|
||||
|
||||
status = this->pKernel->setArg(0, sizeof(cl_accelerator_intel), notAnAccelerator);
|
||||
ASSERT_EQ(CL_INVALID_ARG_VALUE, status);
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||
#include "opencl/source/command_queue/command_queue.h"
|
||||
#include "opencl/source/platform/platform.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
|
||||
@@ -182,24 +182,6 @@ TEST_F(KernelDataTest, GivenSamplerArgumentWhenBuildingThenProgramIsCorrect) {
|
||||
EXPECT_EQ_VAL(samplerData.Offset, pKernelInfo->getArgDescriptorAt(3).as<ArgDescSampler>().bindful);
|
||||
}
|
||||
|
||||
TEST_F(KernelDataTest, GivenAcceleratorArgumentWhenBuildingThenProgramIsCorrect) {
|
||||
iOpenCL::SPatchSamplerKernelArgument samplerData;
|
||||
samplerData.Token = PATCH_TOKEN_SAMPLER_KERNEL_ARGUMENT;
|
||||
samplerData.ArgumentNumber = 3;
|
||||
samplerData.Offset = 0x40;
|
||||
samplerData.Type = iOpenCL::SAMPLER_OBJECT_VME;
|
||||
samplerData.Size = sizeof(samplerData);
|
||||
|
||||
pPatchList = &samplerData;
|
||||
patchListSize = samplerData.Size;
|
||||
|
||||
buildAndDecode();
|
||||
|
||||
EXPECT_TRUE(pKernelInfo->getArgDescriptorAt(3).is<ArgDescriptor::argTSampler>());
|
||||
EXPECT_TRUE(pKernelInfo->getArgDescriptorAt(3).getExtendedTypeInfo().isAccelerator);
|
||||
EXPECT_EQ_VAL(samplerData.Offset, pKernelInfo->getArgDescriptorAt(3).as<ArgDescSampler>().bindful);
|
||||
}
|
||||
|
||||
TEST_F(KernelDataTest, GivenBindingTableStateWhenBuildingThenProgramIsCorrect) {
|
||||
iOpenCL::SPatchBindingTableState bindingTableState;
|
||||
bindingTableState.Token = PATCH_TOKEN_BINDING_TABLE_STATE;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||
#include "opencl/source/sharings/sharing_factory.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
@@ -25,7 +24,6 @@ struct VABaseObjectTests : public ::testing::Test {
|
||||
|
||||
typedef ::testing::Types<
|
||||
MockPlatform,
|
||||
IntelAccelerator,
|
||||
MockCommandQueue>
|
||||
BaseObjectTypes;
|
||||
|
||||
|
||||
@@ -1256,9 +1256,6 @@ DecodeError populateKernelPayloadArgument(NEO::KernelDescriptor &dst, const Kern
|
||||
using SamplerType = Types::Kernel::PayloadArgument::SamplerType;
|
||||
dst.payloadMappings.explicitArgs[src.argIndex].as<ArgDescSampler>(true);
|
||||
auto &extendedInfo = arg.getExtendedTypeInfo();
|
||||
extendedInfo.isAccelerator = (src.samplerType == SamplerType::samplerTypeVME) ||
|
||||
(src.samplerType == SamplerType::samplerTypeVE) ||
|
||||
(src.samplerType == SamplerType::samplerTypeVD);
|
||||
const bool usesVme = src.samplerType == SamplerType::samplerTypeVME;
|
||||
extendedInfo.hasVmeExtendedDescriptor = usesVme;
|
||||
dst.kernelAttributes.flags.usesVme = usesVme;
|
||||
|
||||
@@ -146,7 +146,6 @@ struct ArgDescriptor final {
|
||||
}
|
||||
union {
|
||||
struct {
|
||||
bool isAccelerator : 1;
|
||||
bool isDeviceQueue : 1;
|
||||
bool isMediaImage : 1;
|
||||
bool isMediaBlockImage : 1;
|
||||
|
||||
@@ -276,7 +276,6 @@ void populateKernelArgDescriptor(KernelDescriptor &dst, size_t argNum, const SPa
|
||||
DEBUG_BREAK_IF(token.Type != iOpenCL::SAMPLER_OBJECT_VME &&
|
||||
token.Type != iOpenCL::SAMPLER_OBJECT_VE &&
|
||||
token.Type != iOpenCL::SAMPLER_OBJECT_VD);
|
||||
dst.payloadMappings.explicitArgs[argNum].getExtendedTypeInfo().isAccelerator = true;
|
||||
dst.kernelAttributes.flags.usesVme |= (token.Type == iOpenCL::SAMPLER_OBJECT_VME);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -16,16 +16,6 @@ void populatePointerKernelArg(KernelDescriptor &kernelDesc, ArgDescPointer &dst,
|
||||
KernelDescriptor::AddressingMode addressingMode);
|
||||
}
|
||||
|
||||
void MockKernelInfo::addArgAccelerator(uint32_t index, SurfaceStateHeapOffset bindful,
|
||||
CrossThreadDataOffset mbBlockType, CrossThreadDataOffset sadAdjustMode,
|
||||
CrossThreadDataOffset searchPathType, CrossThreadDataOffset subpixelMode) {
|
||||
addArgSampler(index, bindful);
|
||||
argAsSmp(index).samplerType = iOpenCL::SAMPLER_OBJECT_VME;
|
||||
argAt(index).getExtendedTypeInfo().isAccelerator = true;
|
||||
addExtendedVmeDescriptor(index, mbBlockType, sadAdjustMode, searchPathType, subpixelMode);
|
||||
kernelDescriptor.kernelAttributes.flags.usesVme = true;
|
||||
}
|
||||
|
||||
void MockKernelInfo::addArgBuffer(uint32_t index, CrossThreadDataOffset stateless, uint8_t pointerSize, SurfaceStateHeapOffset bindful, CrossThreadDataOffset bindless) {
|
||||
resizeArgsIfIndexTooBig(index);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -19,9 +19,6 @@ namespace NEO {
|
||||
|
||||
class MockKernelInfo : public KernelInfo {
|
||||
public:
|
||||
void addArgAccelerator(uint32_t index, SurfaceStateHeapOffset bindful = undefined<CrossThreadDataOffset>,
|
||||
CrossThreadDataOffset mbBlockType = undefined<CrossThreadDataOffset>, CrossThreadDataOffset sadAdjustMode = undefined<CrossThreadDataOffset>,
|
||||
CrossThreadDataOffset searchPathType = undefined<CrossThreadDataOffset>, CrossThreadDataOffset subpixelMode = undefined<CrossThreadDataOffset>);
|
||||
void addArgBuffer(uint32_t index, CrossThreadDataOffset stateless = undefined<CrossThreadDataOffset>, uint8_t pointerSize = 0, SurfaceStateHeapOffset bindful = undefined<SurfaceStateHeapOffset>, CrossThreadDataOffset bindless = undefined<CrossThreadDataOffset>);
|
||||
void addArgDevQueue(uint32_t index, CrossThreadDataOffset stateless = undefined<CrossThreadDataOffset>, uint8_t pointerSize = 0, SurfaceStateHeapOffset bindful = undefined<SurfaceStateHeapOffset>);
|
||||
void addArgImage(uint32_t index, SurfaceStateHeapOffset offset = undefined<CrossThreadDataOffset>, uint32_t type = iOpenCL::IMAGE_MEMORY_OBJECT_2D, bool isTransformable = false);
|
||||
|
||||
@@ -5852,13 +5852,11 @@ TEST_F(decodeZeInfoKernelEntryTest, GivenValidSamplerArgumentWithMetadataThenPop
|
||||
EXPECT_EQ(undefined<uint8_t>, sampler0.size);
|
||||
|
||||
auto &sampler1 = args[1].as<ArgDescSampler>();
|
||||
EXPECT_TRUE(args[1].getExtendedTypeInfo().isAccelerator);
|
||||
EXPECT_EQ(80U, sampler1.bindful);
|
||||
EXPECT_EQ(1U, sampler1.index);
|
||||
EXPECT_EQ(undefined<uint8_t>, sampler1.size);
|
||||
|
||||
auto &sampler2 = args[2].as<ArgDescSampler>();
|
||||
EXPECT_TRUE(args[2].getExtendedTypeInfo().isAccelerator);
|
||||
EXPECT_EQ(96U, sampler2.bindful);
|
||||
EXPECT_EQ(0U, sampler2.metadataPayload.samplerSnapWa);
|
||||
EXPECT_EQ(4U, sampler2.metadataPayload.samplerNormalizedCoords);
|
||||
@@ -5867,7 +5865,6 @@ TEST_F(decodeZeInfoKernelEntryTest, GivenValidSamplerArgumentWithMetadataThenPop
|
||||
EXPECT_EQ(undefined<uint8_t>, sampler2.size);
|
||||
|
||||
auto &sampler3 = args[3].as<ArgDescSampler>();
|
||||
EXPECT_TRUE(args[3].getExtendedTypeInfo().isAccelerator);
|
||||
EXPECT_TRUE(args[3].getExtendedTypeInfo().hasVmeExtendedDescriptor);
|
||||
EXPECT_EQ(12U, sampler3.bindless);
|
||||
auto vmePayload = static_cast<NEO::ArgDescVme *>(kd.payloadMappings.explicitArgsExtendedDescriptors[3].get());
|
||||
|
||||
@@ -302,7 +302,7 @@ TEST(ArgDescriptorAs, GivenMismatchedArgTypeThenAborts) {
|
||||
|
||||
TEST(ArgDescriptorCopyAssign, WhenCopyAssignedThenCopiesExtendedTypeInfo) {
|
||||
NEO::ArgDescriptor arg0;
|
||||
arg0.getExtendedTypeInfo().isAccelerator = true;
|
||||
arg0.getExtendedTypeInfo().isMediaBlockImage = true;
|
||||
|
||||
NEO::ArgDescriptor arg1{arg0};
|
||||
NEO::ArgDescriptor arg2;
|
||||
|
||||
@@ -646,7 +646,6 @@ TEST(KernelDescriptorFromPatchtokens, GivenKernelWithSamplerKernelArgumentThenKe
|
||||
EXPECT_EQ(samplerArg.Offset, dst.payloadMappings.explicitArgs[1].as<NEO::ArgDescSampler>().bindful);
|
||||
EXPECT_TRUE(NEO::isUndefinedOffset(dst.payloadMappings.explicitArgs[1].as<NEO::ArgDescSampler>().bindless));
|
||||
EXPECT_EQ(samplerArg.Type, dst.payloadMappings.explicitArgs[1].as<NEO::ArgDescSampler>().samplerType);
|
||||
EXPECT_FALSE(dst.payloadMappings.explicitArgs[1].getExtendedTypeInfo().isAccelerator);
|
||||
EXPECT_TRUE(dst.payloadMappings.explicitArgs[1].getExtendedTypeInfo().needsPatch);
|
||||
EXPECT_FALSE(dst.kernelAttributes.flags.usesVme);
|
||||
}
|
||||
@@ -668,7 +667,6 @@ TEST(KernelDescriptorFromPatchtokens, GivenKernelWithSamplerKernelArgumentWhenSa
|
||||
NEO::populateKernelDescriptor(dst, kernelTokens, sizeof(void *));
|
||||
EXPECT_TRUE(dst.payloadMappings.explicitArgs[1].is<NEO::ArgDescriptor::argTSampler>());
|
||||
EXPECT_EQ(samplerArg.Type, dst.payloadMappings.explicitArgs[1].as<NEO::ArgDescSampler>().samplerType);
|
||||
EXPECT_TRUE(dst.payloadMappings.explicitArgs[1].getExtendedTypeInfo().isAccelerator);
|
||||
EXPECT_TRUE(dst.kernelAttributes.flags.usesVme);
|
||||
}
|
||||
|
||||
@@ -678,7 +676,6 @@ TEST(KernelDescriptorFromPatchtokens, GivenKernelWithSamplerKernelArgumentWhenSa
|
||||
NEO::populateKernelDescriptor(dst, kernelTokens, sizeof(void *));
|
||||
EXPECT_TRUE(dst.payloadMappings.explicitArgs[1].is<NEO::ArgDescriptor::argTSampler>());
|
||||
EXPECT_EQ(samplerArg.Type, dst.payloadMappings.explicitArgs[1].as<NEO::ArgDescSampler>().samplerType);
|
||||
EXPECT_TRUE(dst.payloadMappings.explicitArgs[1].getExtendedTypeInfo().isAccelerator);
|
||||
EXPECT_FALSE(dst.kernelAttributes.flags.usesVme);
|
||||
}
|
||||
|
||||
@@ -688,7 +685,6 @@ TEST(KernelDescriptorFromPatchtokens, GivenKernelWithSamplerKernelArgumentWhenSa
|
||||
NEO::populateKernelDescriptor(dst, kernelTokens, sizeof(void *));
|
||||
EXPECT_TRUE(dst.payloadMappings.explicitArgs[1].is<NEO::ArgDescriptor::argTSampler>());
|
||||
EXPECT_EQ(samplerArg.Type, dst.payloadMappings.explicitArgs[1].as<NEO::ArgDescSampler>().samplerType);
|
||||
EXPECT_TRUE(dst.payloadMappings.explicitArgs[1].getExtendedTypeInfo().isAccelerator);
|
||||
EXPECT_FALSE(dst.kernelAttributes.flags.usesVme);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user