2020-03-24 12:17:13 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-04-28 13:00:33 +02:00
|
|
|
#include <memory>
|
|
|
|
|
2020-03-24 12:17:13 +01:00
|
|
|
namespace NEO {
|
|
|
|
class ClDevice;
|
2020-04-21 13:45:26 +02:00
|
|
|
class Context;
|
2020-04-28 13:00:33 +02:00
|
|
|
struct HardwareInfo;
|
2020-03-24 12:17:13 +01:00
|
|
|
|
|
|
|
namespace TestChecks {
|
|
|
|
bool supportsSvm(const ClDevice *pClDevice);
|
2020-04-21 13:45:26 +02:00
|
|
|
bool supportsImages(const Context *pContext);
|
2020-04-22 14:03:42 +02:00
|
|
|
bool supportsOcl21(const Context *pContext);
|
2020-09-11 10:54:46 +02:00
|
|
|
bool supportsOcl21(const std::unique_ptr<HardwareInfo> &pHardwareInfo);
|
2020-04-28 13:00:33 +02:00
|
|
|
bool supportsDeviceEnqueue(const ClDevice *pClDevice);
|
|
|
|
bool supportsDeviceEnqueue(const Context *pContext);
|
|
|
|
bool supportsDeviceEnqueue(const std::unique_ptr<HardwareInfo> &pHardwareInfo);
|
2020-04-29 14:51:40 +02:00
|
|
|
bool supportsPipes(const ClDevice *pClDevice);
|
2020-10-03 23:11:39 +02:00
|
|
|
bool supportsAuxResolves();
|
2020-03-24 12:17:13 +01:00
|
|
|
} // namespace TestChecks
|
|
|
|
|
|
|
|
} // namespace NEO
|
|
|
|
|
2020-04-22 19:26:27 +02:00
|
|
|
#include "shared/test/unit_test/test_macros/test_checks_shared.h"
|
2020-04-21 13:45:26 +02:00
|
|
|
|
|
|
|
#define REQUIRE_IMAGES_OR_SKIP(param) \
|
|
|
|
if (NEO::TestChecks::supportsImages(param) == false) { \
|
|
|
|
GTEST_SKIP(); \
|
|
|
|
}
|
2020-04-22 14:03:42 +02:00
|
|
|
|
2020-05-25 10:21:04 +02:00
|
|
|
#define REQUIRE_IMAGE_SUPPORT_OR_SKIP(param) \
|
|
|
|
auto hwInfo = castToObject<Context>(param)->getDevice(0)->getHardwareInfo(); \
|
|
|
|
if (!hwInfo.capabilityTable.supportsImages) { \
|
|
|
|
GTEST_SKIP(); \
|
|
|
|
}
|
|
|
|
|
2020-04-22 14:03:42 +02:00
|
|
|
#define REQUIRE_OCL_21_OR_SKIP(param) \
|
|
|
|
if (NEO::TestChecks::supportsOcl21(param) == false) { \
|
|
|
|
GTEST_SKIP(); \
|
|
|
|
}
|
2020-04-28 13:00:33 +02:00
|
|
|
|
|
|
|
#define REQUIRE_DEVICE_ENQUEUE_OR_SKIP(param) \
|
|
|
|
if (NEO::TestChecks::supportsDeviceEnqueue(param) == false) { \
|
|
|
|
GTEST_SKIP(); \
|
|
|
|
}
|
2020-10-03 23:11:39 +02:00
|
|
|
|
|
|
|
#define REQUIRE_AUX_RESOLVES() \
|
|
|
|
if (NEO::TestChecks::supportsAuxResolves() == false) { \
|
|
|
|
GTEST_SKIP(); \
|
|
|
|
}
|