mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
Add test for GET_DEVICE_VERSION + clGetDeviceInfo.
Change-Id: I3894552237bb1c56efcd4da651c9b9be71980cc0
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -150,3 +150,25 @@ INSTANTIATE_TEST_CASE_P(
|
||||
Device_,
|
||||
GetDeviceInfoSize,
|
||||
testing::ValuesIn(deviceInfoParams2));
|
||||
|
||||
TEST(DeviceInfoTests, givenDefaultDeviceWhenQueriedForDeviceVersionThenProperSizeIsReturned) {
|
||||
auto device = std::unique_ptr<Device>(DeviceHelper<>::create());
|
||||
size_t sizeReturned = 0;
|
||||
auto retVal = device->getDeviceInfo(
|
||||
CL_DEVICE_VERSION,
|
||||
0,
|
||||
nullptr,
|
||||
&sizeReturned);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(16u, sizeReturned);
|
||||
std::unique_ptr<char[]> deviceVersion(new char[sizeReturned]);
|
||||
|
||||
retVal = device->getDeviceInfo(
|
||||
CL_DEVICE_VERSION,
|
||||
sizeReturned,
|
||||
deviceVersion.get(),
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
Reference in New Issue
Block a user