mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
remove MT tests from igdrcl_tests target
these tests are executed as part of igdrcl_mt_tests Change-Id: I907bbe99b1283962db2b5ad5fae1e4c848683ff1 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
847fd71500
commit
884ae6fbab
@ -8,7 +8,6 @@ set(IGDRCL_SRCS_tests_helpers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/array_count_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/base_object_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/base_object_tests_mt.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/basic_math_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bit_helpers_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_helper_tests.cpp
|
||||
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 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"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
TEST(BaseObjectTestsMt, givenObjectOwnershipForEachThreadWhenIncrementingNonAtomicValueThenNoDataRacesAreExpected) {
|
||||
MockCommandQueue *object = new MockCommandQueue;
|
||||
object->takeOwnership();
|
||||
uint32_t counter = 0;
|
||||
const uint32_t loopCount = 50;
|
||||
const uint32_t numThreads = 3;
|
||||
|
||||
auto incrementNonAtomicValue = [&](CommandQueue *obj) {
|
||||
for (uint32_t i = 0; i < loopCount; i++) {
|
||||
obj->takeOwnership();
|
||||
counter++;
|
||||
obj->releaseOwnership();
|
||||
}
|
||||
};
|
||||
|
||||
EXPECT_EQ(0U, object->getCond().peekNumWaiters());
|
||||
|
||||
std::thread t1(incrementNonAtomicValue, object);
|
||||
std::thread t2(incrementNonAtomicValue, object);
|
||||
std::thread t3(incrementNonAtomicValue, object);
|
||||
|
||||
while (object->getCond().peekNumWaiters() != numThreads) {
|
||||
std::this_thread::yield();
|
||||
}
|
||||
|
||||
EXPECT_EQ(0u, counter);
|
||||
object->releaseOwnership();
|
||||
|
||||
t1.join();
|
||||
t2.join();
|
||||
t3.join();
|
||||
|
||||
EXPECT_EQ(loopCount * numThreads, counter);
|
||||
|
||||
object->release();
|
||||
}
|
||||
} // namespace NEO
|
Reference in New Issue
Block a user