Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/cts_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
version: fcd26a61b600cd4b653724e59e72d4f7d1da259c
- sycl-impl: simsycl
version: 960c155109b066b26c1ecb6b2348ff9f6b69704d
- sycl-impl: protosycl
version: c57f50ceb66d33376d141de45fce6b1e7826f8ac
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -121,6 +123,8 @@ jobs:
version: fcd26a61b600cd4b653724e59e72d4f7d1da259c
- sycl-impl: simsycl
version: 960c155109b066b26c1ecb6b2348ff9f6b69704d
- sycl-impl: protosycl
version: c57f50ceb66d33376d141de45fce6b1e7826f8ac
env:
container-workspace: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
parallel-build-jobs: 2
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ project(sycl_cts LANGUAGES CXX)

if(SYCL_IMPLEMENTATION STREQUAL SimSYCL)
set(CMAKE_CXX_STANDARD 20)
elseif(SYCL_IMPLEMENTATION STREQUAL ProtoSYCL)
set(CMAKE_CXX_STANDARD 23)
Comment on lines 5 to +7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest moving this to cmake/FindProtoSYCL.cmake to isolate implementation specific settings similar to cmake/FindDPCPP.cmake.

else()
set(CMAKE_CXX_STANDARD 17)
endif()
Expand Down
4 changes: 2 additions & 2 deletions ci/generate_exclude_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def parse_arguments():
configuration-time test category filters for all failing targets.""")

parser.add_argument('sycl_implementation', metavar="SYCL-Implementation",
choices=['DPCPP', 'AdaptiveCpp', 'SimSYCL'], type=str,
help="The SYCL implementation to use")
choices=['DPCPP', 'AdaptiveCpp', 'SimSYCL', 'ProtoSYCL'],
type=str, help="The SYCL implementation to use")
parser.add_argument('--cmake-args', type=str,
help="Arguments to pass on to CMake during configuration")
parser.add_argument('-j', type=int, default=0, dest='parallel_jobs',
Expand Down
4 changes: 4 additions & 0 deletions ci/protosycl.filter
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
device
group_functions
math_builtin_api
property
29 changes: 29 additions & 0 deletions cmake/AdaptProtoSYCL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
add_library(SYCL::SYCL INTERFACE IMPORTED GLOBAL)
target_link_libraries(SYCL::SYCL INTERFACE ProtoSYCL)
# add_sycl_executable_implementation function
# Builds a SYCL program, compiling multiple SYCL test case source files into a
# test executable, invoking a single-source/device compiler
# Parameters are:
# - NAME Name of the test executable
# - OBJECT_LIBRARY Name of the object library of all the compiled test cases
# - TESTS List of SYCL test case source files to be built into the
# test executable
function(add_sycl_executable_implementation)
cmake_parse_arguments(args "" "NAME;OBJECT_LIBRARY" "TESTS" ${ARGN})
set(exe_name ${args_NAME})
set(object_lib_name ${args_OBJECT_LIBRARY})
set(test_cases_list ${args_TESTS})

add_library(${object_lib_name} OBJECT ${test_cases_list})
add_executable(${exe_name} $<TARGET_OBJECTS:${object_lib_name}>)

add_sycl_to_target(TARGET ${object_lib_name} SOURCES ${test_cases_list})

set_target_properties(${object_lib_name} PROPERTIES
INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${exe_name},INCLUDE_DIRECTORIES>
COMPILE_DEFINITIONS $<TARGET_PROPERTY:${exe_name},COMPILE_DEFINITIONS>
COMPILE_OPTIONS $<TARGET_PROPERTY:${exe_name},COMPILE_OPTIONS>
COMPILE_FEATURES $<TARGET_PROPERTY:${exe_name},COMPILE_FEATURES>
POSITION_INDEPENDENT_CODE ON)

endfunction()
2 changes: 1 addition & 1 deletion cmake/AddSYCLExecutable.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set (KNOWN_SYCL_IMPLEMENTATIONS "DPCPP;AdaptiveCpp;SimSYCL")
set (KNOWN_SYCL_IMPLEMENTATIONS "DPCPP;AdaptiveCpp;SimSYCL;ProtoSYCL")
if ("${SYCL_IMPLEMENTATION}" STREQUAL "" OR NOT ${SYCL_IMPLEMENTATION} IN_LIST KNOWN_SYCL_IMPLEMENTATIONS)
message(FATAL_ERROR
"The SYCL CTS requires specifying a SYCL implementation with "
Expand Down
21 changes: 21 additions & 0 deletions cmake/FindProtoSYCL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include(FetchContent)
FetchContent_Declare(
ProtoSYCL
SOURCE_DIR /ProtoSYCL
)
FetchContent_MakeAvailable(ProtoSYCL)

function(add_sycl_to_target)
set(options)
set(one_value_keywords TARGET)
set(multi_value_keywords SOURCES)
cmake_parse_arguments(ADD_SYCL
"${options}"
"${one_value_keywords}"
"${multi_value_keywords}"
${ARGN}
)

target_link_libraries(${ADD_SYCL_TARGET} PUBLIC ProtoSYCL)

endfunction()
38 changes: 38 additions & 0 deletions docker/protosycl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM khronosgroup/sycl-cts-ci:common

ARG IMPL_VERSION
RUN test -n "$IMPL_VERSION" || ( echo "Error: IMPL_VERSION is not set"; exit 1 )

# Install LLVM script dependencies.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
gnupg \
lsb-release \
g++-14 \
software-properties-common && \
rm -rf /var/lib/apt/lists/*

# Install LLVM 22.
RUN wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh 22 all && \
rm llvm.sh

# Set clang-22 as the default clang version.
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 100 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 100
ENV CC=clang
ENV CXX=clang++

# Build ProtoSYCL.
RUN git clone https://github.com/0x12CC/ProtoSYCL.git && \
cd ProtoSYCL && \
git checkout $IMPL_VERSION && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja && \
ninja

# Copy the configure script to the /scripts directory.
COPY configure.sh /scripts/
15 changes: 15 additions & 0 deletions docker/protosycl/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o noclobber -o nounset
cmake . -G Ninja -B build \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER=/ProtoSYCL/build/sycl++ \
-DCMAKE_CXX_STANDARD=23 \
-DCMAKE_BUILD_TYPE=Release \
-DSYCL_IMPLEMENTATION=ProtoSYCL \
-DSYCL_CTS_ENABLE_FULL_CONFORMANCE=OFF \
-DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=OFF \
-DSYCL_CTS_ENABLE_CUDA_INTEROP_TESTS=OFF \
-DSYCL_CTS_ENABLE_HALF_TESTS=ON \
-DSYCL_CTS_ENABLE_DEPRECATED_FEATURES_TESTS=ON \
-DSYCL_CTS_ENABLE_FEATURE_SET_FULL=ON \
$@
Loading