Skip to content

Commit f7c82cc

Browse files
authored
run dr shp-tests (#1591)
1 parent e3c6b26 commit f7c82cc

File tree

5 files changed

+42
-15
lines changed

5 files changed

+42
-15
lines changed

.github/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM intel/oneapi:latest
2+
RUN apt update --allow-insecure-repositories
3+
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
4+
RUN apt install -y g++-13
5+
RUN apt install -y libgtest-dev
6+
RUN apt install -y libcxxopts-dev
7+
8+
RUN apt remove --purge --auto-remove -y cmake
9+
RUN wget https://cmake.org/files/v3.29/cmake-3.29.2.tar.gz
10+
RUN tar -xzvf cmake-3.29.2.tar.gz && cd cmake-3.29.2 && ./bootstrap && make -j12 && make install
11+
12+
RUN apt install -y libfmt-dev
13+
14+
CMD /bin/bash

.github/workflows/ci.yml

100644100755
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- release_oneDPL
99
- main
1010
- 'release/**'
11+
- distributed-ranges
1112

1213
permissions: read-all
1314

@@ -220,6 +221,27 @@ jobs:
220221
make VERBOSE=1 -j${BUILD_CONCURRENCY} ${make_targets}
221222
ctest --timeout ${TEST_TIMEOUT} --output-on-failure ${ctest_flags}
222223
224+
dr-testing:
225+
name: Run DR shp-tests
226+
runs-on: ubuntu-latest
227+
steps:
228+
- uses: actions/checkout@v3
229+
- name: Build docker image
230+
run: docker build . -t dr-test -f .github/Dockerfile
231+
- name: Run tests
232+
run: |
233+
docker run --name dr-test -d -v $(pwd):/repo dr-test sh -c "
234+
cd repo &&
235+
mkdir build &&
236+
cd build &&
237+
cmake -DCMAKE_CXX_STANDARD=23 -DCMAKE_CXX_COMPILER=icpx -DONEDPL_BACKEND=dpcpp -DCMAKE_BUILD_TYPE=Release .. &&
238+
cmake --build . --target shp-all-tests -j${nproc} &&
239+
ctest --test-dir . -L SHP -j 4"
240+
docker logs -f dr-test
241+
exit_code=$(docker inspect dr-test --format='{{.State.ExitCode}}')
242+
docker rm -f dr-test
243+
exit $exit_code
244+
223245
linux-pstl-offload-testing:
224246
name: PSTL offload ${{ matrix.device_type }},bknd=dpcpp,cmplr=${{ matrix.cxx_compiler }},${{ matrix.os }},std=с++${{ matrix.std }},cfg=${{ matrix.build_type }}
225247
runs-on: ['${{ matrix.os }}']

test/CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ endif()
6969
add_custom_target(build-onedpl-tests
7070
COMMENT "Build all oneDPL tests")
7171

72-
if (ONEDPL_USE_DR)
73-
set(run-onedpl-tests-depends build-onedpl-tests shp-tests shp-tests-3)
74-
else()
75-
set(run-onedpl-tests-depends build-onedpl-tests)
76-
endif()
72+
set(run-onedpl-tests-depends build-onedpl-tests)
7773

7874
add_custom_target(run-onedpl-tests
7975
COMMAND "${CMAKE_CTEST_COMMAND}" --output-on-failure
@@ -253,11 +249,6 @@ foreach (_file IN LISTS UNIT_TESTS)
253249

254250
endforeach()
255251

256-
if (ONEDPL_USE_DR)
257-
add_custom_target(build-dr-tests COMMENT "Build dr tests" DEPENDS shp-tests shp-tests-3)
258-
add_custom_target(run-dr-tests COMMENT "Run dr tests" DEPENDS build-dr-tests COMMAND ./distributed-ranges/shp/shp-tests ./distributed-ranges/shp/shp-tests-3)
259-
endif()
260-
261252
# add additional TUs if required
262253
if (TARGET interop_allocs.pass)
263254
target_sources(interop_allocs.pass PRIVATE "${CMAKE_CURRENT_LIST_DIR}/pstl_offload/memory/interop_allocs_system.cpp"

test/distributed-ranges/shp/containers.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ TYPED_TEST(DistributedVectorTest, Resize) {
105105
EXPECT_EQ(dv, v);
106106
}
107107

108-
template <typename AllocT> class DeviceVectorTest : public testing::Test {
108+
template <typename AllocT> class RemoteVectorTest : public testing::Test {
109109
public:
110-
using DeviceVec = dr::shp::device_vector<typename AllocT::value_type, AllocT>;
110+
using RemoteVec = dr::shp::remote_vector<typename AllocT::value_type, AllocT>;
111111
};
112112

113-
TYPED_TEST_SUITE(DeviceVectorTest, AllocatorTypes);
113+
TYPED_TEST_SUITE(RemoteVectorTest, AllocatorTypes);
114114

115-
TYPED_TEST(DeviceVectorTest, is_remote_contiguous_range) {
116-
static_assert(dr::remote_contiguous_range<typename TestFixture::DeviceVec>);
115+
TYPED_TEST(RemoteVectorTest, is_remote_contiguous_range) {
116+
static_assert(dr::remote_contiguous_range<typename TestFixture::RemoteVec>);
117117
}

0 commit comments

Comments
 (0)