mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
create new variable defaultHwInfo as a std::unqiue_ptr<HardwareInfo> replace platformDevices with defaultHwInfo in opencl/test/unit_test/api Related-To: NEO-4499 Change-Id: I75b924e5b8a3a18f4ff9fdc3e598192569e102f7 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
38 lines
966 B
C++
38 lines
966 B
C++
/*
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "cl_api_tests.h"
|
|
|
|
using namespace NEO;
|
|
|
|
typedef api_tests clSVMFreeTests;
|
|
|
|
namespace ULT {
|
|
|
|
TEST_F(clSVMFreeTests, GivenNullPtrWhenFreeingSvmThenNoAction) {
|
|
clSVMFree(
|
|
nullptr, // cl_context context
|
|
nullptr // void *svm_pointer
|
|
);
|
|
}
|
|
|
|
TEST_F(clSVMFreeTests, GivenContextWithDeviceNotSupportingSvmWhenFreeingSvmThenNoAction) {
|
|
HardwareInfo hwInfo = *defaultHwInfo;
|
|
hwInfo.capabilityTable.ftrSvm = false;
|
|
auto clDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
|
|
|
|
cl_device_id deviceId = clDevice.get();
|
|
auto context = clUniquePtr(Context::create<MockContext>(nullptr, ClDeviceVector(&deviceId, 1), nullptr, nullptr, retVal));
|
|
EXPECT_EQ(retVal, CL_SUCCESS);
|
|
|
|
clSVMFree(
|
|
context.get(),
|
|
reinterpret_cast<void *>(0x1234));
|
|
}
|
|
|
|
} // namespace ULT
|