-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SimSYCL as a SYCL implementation #871
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
accessor_legacy | ||
atomic | ||
atomic_ref_stress | ||
buffer | ||
device | ||
exception_handling | ||
handler | ||
image | ||
image_accessor | ||
invoke | ||
kernel | ||
kernel_args | ||
kernel_bundle | ||
math_builtin_api | ||
multi_ptr | ||
queue | ||
reduction | ||
sampler | ||
spec_constants | ||
stream |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,45 @@ | ||||||
add_library(SYCL::SYCL INTERFACE IMPORTED GLOBAL) | ||||||
target_link_libraries(SYCL::SYCL INTERFACE SimSYCL::simsycl) | ||||||
# 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}>) | ||||||
|
||||||
# hipSYCL needs the macro to be called on both the object library (to | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Copy pasta - although I think this isn't even true? |
||||||
# override the compiler) and the executable (to override the linker). | ||||||
add_sycl_to_target(TARGET ${object_lib_name} SOURCES ${test_cases_list}) | ||||||
add_sycl_to_target(TARGET ${exe_name}) | ||||||
|
||||||
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() | ||||||
|
||||||
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 SimSYCL::simsycl) | ||||||
endfunction() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
set (KNOWN_SYCL_IMPLEMENTATIONS "Intel_SYCL;DPCPP;hipSYCL") | ||
set (KNOWN_SYCL_IMPLEMENTATIONS "Intel_SYCL;DPCPP;hipSYCL;SimSYCL") | ||
if (NOT ${SYCL_IMPLEMENTATION} IN_LIST KNOWN_SYCL_IMPLEMENTATIONS) | ||
message(FATAL_ERROR | ||
"The SYCL CTS requires specifying a SYCL implementation with " | ||
"-DSYCL_IMPLEMENTATION=[Intel_SYCL,DPCPP;hipSYCL]") | ||
"-DSYCL_IMPLEMENTATION=[Intel_SYCL,DPCPP;hipSYCL;SimSYCL]") | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should just put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps |
||
|
||
if(NOT TARGET OpenCL_Proxy) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,10 @@ TEST_CASE("event::get_backend returns the associated backend", "[event]") { | |
|
||
TEST_CASE("event::get_wait_list returns a list of all direct dependencies", | ||
"[event]") { | ||
#if SYCL_CTS_COMPILING_WITH_SIMSYCL | ||
SKIP("SimSYCL does not implement asynchronous execution."); | ||
#endif | ||
Comment on lines
+77
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that from the conformance point of view the better to use |
||
|
||
resolvable_host_event e_a; | ||
resolvable_host_event e_b{{e_a.get_sycl_event()}}; | ||
resolvable_host_event e_c; | ||
|
@@ -117,6 +121,10 @@ class delayed_host_event : public resolvable_host_event { | |
}; | ||
|
||
TEST_CASE("event can be waited upon", "[event]") { | ||
#if SYCL_CTS_COMPILING_WITH_SIMSYCL | ||
SKIP("SimSYCL does not implement asynchronous execution."); | ||
#endif | ||
|
||
// Give main thread some time to fail the did_resolve check | ||
delayed_host_event dhe{std::chrono::milliseconds(100)}; | ||
|
||
|
@@ -138,6 +146,10 @@ TEST_CASE("event can be waited upon", "[event]") { | |
} | ||
|
||
TEST_CASE("multiple events can be waited upon simultaneously", "[event]") { | ||
#if SYCL_CTS_COMPILING_WITH_SIMSYCL | ||
SKIP("SimSYCL does not implement asynchronous execution."); | ||
#endif | ||
|
||
// Give main thread some time to fail the did_resolve check | ||
delayed_host_event dhe1{std::chrono::milliseconds(100)}; | ||
delayed_host_event dhe2{std::chrono::milliseconds(100)}; | ||
|
@@ -302,6 +314,10 @@ TEST_CASE("event::get_info returns correct command execution status", | |
sycl::info::event_command_status>(make_device_event()); | ||
|
||
SECTION("for host_task event") { | ||
#if SYCL_CTS_COMPILING_WITH_SIMSYCL | ||
SKIP("SimSYCL does not implement asynchronous execution."); | ||
#endif | ||
|
||
resolvable_host_event rhe; | ||
auto& event = rhe.get_sycl_event(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
file(GLOB test_cases_list *.cpp) | ||
|
||
if(SYCL_IMPLEMENTATION STREQUAL SimSYCL) | ||
message(WARNING "SimSYCL does not provide true concurrency between host and device, disabling USM atomic tests") | ||
list(FILTER test_cases_list EXCLUDE REGEX usm_atomic_access_.*\\.cpp$) | ||
endif() | ||
Comment on lines
+3
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Piggybacking off of @AlexeySachkov's comment, these should preferably also be disabled using |
||
|
||
|
||
add_cts_test(${test_cases_list}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this file is named
AdaptSimSYCL
and notSimSYCL
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've had
Find*
andAdapt*
files for a while now, it has nothing to do with AdaptiveCpp - the corresponding file for AdaptiveCpp in #874 is calledAdaptAdaptiveCpp
;-).