Skip to content

Commit d881ba8

Browse files
committed
Re-enable adapter specific tests, add config specific KNOWN_FAILUREs
Also take out some loader specific known failures to see what happens.
1 parent 8665a43 commit d881ba8

15 files changed

+45
-146
lines changed

.github/workflows/build-hw-reusable.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ jobs:
110110
# This is to check that install command does not fail
111111
run: cmake --install ${{github.workspace}}/build
112112

113-
# - name: Test adapter specific
114-
# working-directory: ${{github.workspace}}/build
115-
# run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
116-
# # Don't run adapter specific tests when building multiple adapters
117-
# if: ${{ matrix.adapter.other_name == '' }}
113+
- name: Test adapter specific
114+
working-directory: ${{github.workspace}}/build
115+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
116+
# Don't run adapter specific tests when building multiple adapters
117+
if: ${{ matrix.adapter.other_name == '' }}
118118

119119
- name: Test adapters
120120
working-directory: ${{github.workspace}}/build

test/adapters/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ function(add_adapter_memcheck_test name)
7777
endfunction()
7878

7979
if(UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_ALL)
80-
# add_subdirectory(cuda)
80+
add_subdirectory(cuda)
8181
endif()
8282

8383
if(UR_BUILD_ADAPTER_HIP OR UR_BUILD_ADAPTER_ALL)
84-
# add_subdirectory(hip)
84+
add_subdirectory(hip)
8585
endif()
8686

8787
if(UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_L0_V2 OR UR_BUILD_ADAPTER_ALL)
88-
# add_subdirectory(level_zero)
88+
add_subdirectory(level_zero)
8989
endif()

test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
#include "fixtures.h"
77

88
using urCudaDeviceCreateWithNativeHandle = uur::urPlatformTest;
9+
UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urCudaDeviceCreateWithNativeHandle);
910

10-
TEST_F(urCudaDeviceCreateWithNativeHandle, Success) {
11+
TEST_P(urCudaDeviceCreateWithNativeHandle, Success) {
1112
// get a device from cuda
1213
int nCudaDevices;
1314
ASSERT_SUCCESS_CUDA(cuDeviceGetCount(&nCudaDevices));
@@ -16,7 +17,12 @@ TEST_F(urCudaDeviceCreateWithNativeHandle, Success) {
1617
ASSERT_SUCCESS_CUDA(cuDeviceGet(&cudaDevice, 0));
1718

1819
ur_native_handle_t nativeCuda = static_cast<ur_native_handle_t>(cudaDevice);
19-
ur_device_handle_t urDevice;
20+
21+
ur_adapter_handle_t adapter = nullptr;
22+
ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_ADAPTER,
23+
sizeof(adapter), &adapter, nullptr));
24+
25+
ur_device_handle_t urDevice = nullptr;
2026
ASSERT_SUCCESS(urDeviceCreateWithNativeHandle(nativeCuda, adapter, nullptr,
2127
&urDevice));
2228
}

test/adapters/level_zero/event_cache_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ TEST_P(urEventCacheTest, eventsReuseWithVisibleEventAndWait) {
167167
template <typename T>
168168
inline std::string
169169
printFlags(const testing::TestParamInfo<typename T::ParamType> &info) {
170-
const auto device_handle = std::get<0>(info.param);
170+
const auto device_handle = std::get<0>(info.param).device;
171171
const auto platform_device_name =
172172
uur::GetPlatformAndDeviceName(device_handle);
173173
auto flags = combineFlags(std::get<1>(info.param));
@@ -181,7 +181,7 @@ printFlags(const testing::TestParamInfo<typename T::ParamType> &info) {
181181
return platform_device_name + "__" + str;
182182
}
183183

184-
UUR_TEST_SUITE_P(
184+
UUR_DEVICE_TEST_SUITE_P(
185185
urEventCacheTest,
186186
::testing::Combine(
187187
testing::Values(0, UR_QUEUE_FLAG_DISCARD_EVENTS),

test/adapters/level_zero/multi_device_event_cache_tests.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
// See LICENSE.TXT
44
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
#include "ur_print.hpp"
76
#include "uur/fixtures.h"
87
#include "uur/raii.h"
98

10-
#include <map>
11-
#include <string>
12-
139
#include "ze_tracer_common.hpp"
1410

1511
size_t zeCommandListAppendWaitOnEventsCount = 0;
@@ -27,7 +23,9 @@ static std::shared_ptr<_zel_tracer_handle_t> tracer = [] {
2723
}();
2824

2925
using urMultiQueueMultiDeviceEventCacheTest = uur::urAllDevicesTest;
30-
TEST_F(urMultiQueueMultiDeviceEventCacheTest,
26+
UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiQueueMultiDeviceEventCacheTest);
27+
28+
TEST_P(urMultiQueueMultiDeviceEventCacheTest,
3129
GivenMultiSubDeviceWithQueuePerSubDeviceThenEventIsSharedBetweenQueues) {
3230
uint32_t max_sub_devices = 0;
3331
ASSERT_SUCCESS(
@@ -83,7 +81,7 @@ TEST_F(urMultiQueueMultiDeviceEventCacheTest,
8381
ASSERT_SUCCESS(urQueueRelease(queue1));
8482
}
8583

86-
TEST_F(urMultiQueueMultiDeviceEventCacheTest,
84+
TEST_P(urMultiQueueMultiDeviceEventCacheTest,
8785
GivenMultiDeviceWithQueuePerDeviceThenMultiDeviceEventIsCreated) {
8886
if (devices.size() < 2) {
8987
GTEST_SKIP();

test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TEST_P(urLevelZeroKernelNativeHandleTest, OwnedHandleRelease) {
1919
urDeviceGetNativeHandle(device, (ur_native_handle_t *)&native_device);
2020

2121
std::shared_ptr<std::vector<char>> il_binary;
22-
uur::KernelsEnvironment::instance->LoadSource("foo", il_binary);
22+
uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary);
2323

2424
auto kernel_name =
2525
uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0];
@@ -79,7 +79,7 @@ TEST_P(urLevelZeroKernelNativeHandleTest, NullProgram) {
7979
urDeviceGetNativeHandle(device, (ur_native_handle_t *)&native_device);
8080

8181
std::shared_ptr<std::vector<char>> il_binary;
82-
uur::KernelsEnvironment::instance->LoadSource("foo", il_binary);
82+
uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary);
8383

8484
auto kernel_name =
8585
uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0];

test/adapters/level_zero/v2/event_pool_test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct ProviderParams {
8888
template <typename T>
8989
inline std::string
9090
printParams(const testing::TestParamInfo<typename T::ParamType> &info) {
91-
const auto device_handle = std::get<0>(info.param);
91+
const auto device_handle = std::get<0>(info.param).device;
9292
const auto platform_device_name =
9393
uur::GetPlatformAndDeviceName(device_handle);
9494
auto params = std::get<1>(info.param);
@@ -144,8 +144,8 @@ static ProviderParams test_cases[] = {
144144
//{TEST_PROVIDER_COUNTER, EVENT_COUNTER, QUEUE_IMMEDIATE},
145145
};
146146

147-
UUR_TEST_SUITE_P(EventPoolTest, testing::ValuesIn(test_cases),
148-
printParams<EventPoolTest>);
147+
UUR_DEVICE_TEST_SUITE_P(EventPoolTest, testing::ValuesIn(test_cases),
148+
printParams<EventPoolTest>);
149149

150150
TEST_P(EventPoolTest, InvalidDevice) {
151151
auto pool = cache->borrow(MAX_DEVICES, getParam().flags);
@@ -237,8 +237,8 @@ TEST_P(EventPoolTest, ProviderNormalUseMostFreePool) {
237237

238238
using EventPoolTestWithQueue = uur::urQueueTestWithParam<ProviderParams>;
239239

240-
UUR_TEST_SUITE_P(EventPoolTestWithQueue, testing::ValuesIn(test_cases),
241-
printParams<EventPoolTest>);
240+
UUR_DEVICE_TEST_SUITE_P(EventPoolTestWithQueue, testing::ValuesIn(test_cases),
241+
printParams<EventPoolTest>);
242242

243243
// TODO: actual min version is unknown, retest after drivers on CI are
244244
// updated.

test/adapters/level_zero/v2/memory_residency.cpp

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,34 @@
33
// See LICENSE.TXT
44
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
#include "ur_print.hpp"
76
#include "uur/fixtures.h"
8-
#include "uur/raii.h"
97
#include "uur/utils.h"
108

11-
#include <map>
12-
#include <string>
13-
149
using urMemoryResidencyTest = uur::urMultiDeviceContextTestTemplate<1>;
10+
UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMemoryResidencyTest);
1511

16-
TEST_F(urMemoryResidencyTest, allocatingDeviceMemoryWillResultInOOM) {
12+
TEST_P(urMemoryResidencyTest, allocatingDeviceMemoryWillResultInOOM) {
1713
static constexpr size_t allocSize = 1024 * 1024;
1814

19-
if (!uur::isPVC(uur::DevicesEnvironment::instance->devices[0])) {
15+
if (!uur::isPVC(devices[0])) {
2016
GTEST_SKIP() << "Test requires a PVC device";
2117
}
2218

2319
size_t initialMemFree = 0;
24-
ASSERT_SUCCESS(
25-
urDeviceGetInfo(uur::DevicesEnvironment::instance->devices[0],
26-
UR_DEVICE_INFO_GLOBAL_MEM_FREE, sizeof(size_t),
27-
&initialMemFree, nullptr));
20+
ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_GLOBAL_MEM_FREE,
21+
sizeof(size_t), &initialMemFree, nullptr));
2822

2923
if (initialMemFree < allocSize) {
3024
GTEST_SKIP() << "Not enough device memory available";
3125
}
3226

3327
void *ptr = nullptr;
34-
ASSERT_SUCCESS(
35-
urUSMDeviceAlloc(context, uur::DevicesEnvironment::instance->devices[0],
36-
nullptr, nullptr, allocSize, &ptr));
28+
ASSERT_SUCCESS(urUSMDeviceAlloc(context, devices[0], nullptr, nullptr,
29+
allocSize, &ptr));
3730

3831
size_t currentMemFree = 0;
39-
ASSERT_SUCCESS(
40-
urDeviceGetInfo(uur::DevicesEnvironment::instance->devices[0],
41-
UR_DEVICE_INFO_GLOBAL_MEM_FREE, sizeof(size_t),
42-
&currentMemFree, nullptr));
32+
ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_GLOBAL_MEM_FREE,
33+
sizeof(size_t), &currentMemFree, nullptr));
4334

4435
// amount of free memory should decrease after making a memory allocation resident
4536
ASSERT_LE(currentMemFree, initialMemFree);

test/conformance/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ function(add_conformance_test name)
5151
GTest::gtest_main
5252
unit_tests_helpers)
5353

54+
if(UR_USE_CFI)
55+
target_compile_definitions(${TEST_TARGET_NAME} PRIVATE UR_USE_CFI)
56+
endif()
57+
5458
if(UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_ALL)
5559
add_test_adapter(${name} adapter_cuda CUDA)
5660
endif()

test/conformance/enqueue/urEnqueueEventsWaitMultiDevice.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,12 @@ TEST_P(urEnqueueEventsWaitMultiDeviceMTTest, EnqueueWaitSingleQueueMultiOps) {
189189
}
190190

191191
TEST_P(urEnqueueEventsWaitMultiDeviceMTTest, EnqueueWaitOnAllQueues) {
192-
// This is a flaky fail when UR_CONFORMANCE_TEST_LOADER=ON
192+
// Fails when -fsanitize=cfi
193+
#ifdef UR_USE_CFI
193194
if (getParam().value) {
194195
UUR_KNOWN_FAILURE_ON(uur::OpenCL{});
195196
}
197+
#endif
196198

197199
std::vector<uur::raii::Event> eventsRaii(devices.size());
198200
std::vector<ur_event_handle_t> events(devices.size());

test/conformance/event/urEventGetNativeHandle.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

66
#include "fixtures.h"
7-
#include "uur/known_failure.h"
87

98
using urEventGetNativeHandleTest = uur::event::urEventTest;
109
UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventGetNativeHandleTest);
@@ -17,9 +16,6 @@ TEST_P(urEventGetNativeHandleTest, Success) {
1716
}
1817

1918
TEST_P(urEventGetNativeHandleTest, InvalidNullHandleEvent) {
20-
// This test has issues when UR_CONFORMANCE_TEST_LOADER=ON
21-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
22-
2319
ur_native_handle_t native_event = 0;
2420
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE,
2521
urEventGetNativeHandle(nullptr, &native_event));

test/conformance/event/urEventRelease.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

66
#include "fixtures.h"
7-
#include "uur/known_failure.h"
87

98
using urEventReleaseTest = uur::event::urEventTest;
109

1110
UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventReleaseTest);
1211

1312
TEST_P(urEventReleaseTest, Success) {
14-
// This test has issues when UR_CONFORMANCE_TEST_LOADER=ON
15-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
16-
1713
ASSERT_SUCCESS(urEventRetain(event));
1814

1915
uint32_t prevRefCount = 0;

test/conformance/event/urEventRetain.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

66
#include "fixtures.h"
7-
#include "uur/known_failure.h"
87

98
using urEventRetainTest = uur::event::urEventTest;
109
UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventRetainTest);
1110

1211
TEST_P(urEventRetainTest, Success) {
13-
// This test has issues when UR_CONFORMANCE_TEST_LOADER=ON
14-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
15-
1612
uint32_t prevRefCount = 0;
1713
ASSERT_SUCCESS(uur::GetObjectReferenceCount(event, prevRefCount));
1814

test/conformance/event/urEventSetCallback.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ TEST_P(urEventSetCallbackTest, ValidateParameters) {
4949
UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{});
5050
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
5151

52-
// This test has issues when UR_CONFORMANCE_TEST_LOADER=ON
53-
UUR_KNOWN_FAILURE_ON(uur::OpenCL{});
54-
5552
struct CallbackParameters {
5653
ur_event_handle_t event;
5754
ur_execution_info_t execStatus;
@@ -182,9 +179,6 @@ using urEventSetCallbackNegativeTest = uur::event::urEventTest;
182179
void emptyCallback(ur_event_handle_t, ur_execution_info_t, void *) {}
183180

184181
TEST_P(urEventSetCallbackNegativeTest, InvalidNullHandleEvent) {
185-
// This test has issues when UR_CONFORMANCE_TEST_LOADER=ON
186-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
187-
188182
ASSERT_EQ_RESULT(urEventSetCallback(
189183
nullptr, ur_execution_info_t::UR_EXECUTION_INFO_QUEUED,
190184
emptyCallback, nullptr),

test/conformance/usm/usm_adapter_hip.match

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)