Skip to content

Commit b6ace46

Browse files
committed
Merge branch 'develop' into regression
# Conflicts: # tests/backends/stdpar/stdpar_csvm.cpp
2 parents 93fc69e + 095ce16 commit b6ace46

File tree

9 files changed

+63
-182
lines changed

9 files changed

+63
-182
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Additional dependencies for the Kokkos backend:
139139

140140
Additional dependencies for the stdpar backend:
141141

142-
- the code must be compiled with a stdpar capable compiler; currently supported are [nvc++](https://developer.nvidia.com/hpc-sdk), [roc-stdpar](https://github.com/ROCm/roc-stdpar), [icpx](https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html), [AdaptiveCpp](https://github.com/AdaptiveCpp/AdaptiveCpp), and [GNU GCC](https://gcc.gnu.org/))
142+
- the code must be compiled with a stdpar capable compiler; currently supported are [nvc++](https://developer.nvidia.com/hpc-sdk), [roc-stdpar](https://github.com/llvm/llvm-project) (merged into upstream LLVM starting with version 18), [icpx](https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html), [AdaptiveCpp](https://github.com/AdaptiveCpp/AdaptiveCpp), and [GNU GCC](https://gcc.gnu.org/))
143143
- depending on the used stdpar implementation, additional dependencies are required:
144144

145145
- `nvc++`: a CUDA SDK

cmake/plssvm/plssvmstdparTargets.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ if (TARGET plssvm::plssvm-stdpar)
2020
return()
2121
endif ()
2222
elseif (PLSSVM_STDPAR_BACKEND MATCHES "roc-stdpar")
23-
check_cxx_compiler_flag("-hipstdpar --hipstdpar-path=${PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH}" PLSSVM_HAS_HIPSTDPAR_STDPAR_FLAG)
23+
check_cxx_compiler_flag("--hipstdpar" PLSSVM_HAS_HIPSTDPAR_STDPAR_FLAG)
2424
if (NOT PLSSVM_HAS_HIPSTDPAR_STDPAR_FLAG)
2525
set(plssvm_FOUND OFF)
2626
set(plssvm_stdpar_FOUND OFF)
2727
set(plssvm_NOT_FOUND_MESSAGE
28-
"The CMAKE_CXX_COMPILER must be set to the hipstdpar patched LLVM compiler (acpp) in user code in order to use plssvm::stdpar!"
28+
"The CMAKE_CXX_COMPILER must be set to a compatible LLVM (version 18 or newer) in user code in order to use plssvm::stdpar!"
2929
)
3030
return()
3131
endif ()

src/plssvm/backends/Kokkos/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ if (Kokkos_ENABLE_SYCL)
4040
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
4141
message(FATAL_ERROR "For Kokkos::SYCL to work, the compiler must be IntelLLVM, but is ${CMAKE_CXX_COMPILER}!")
4242
endif ()
43+
44+
target_compile_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -sycl-std=2020 -fsycl)
45+
target_link_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -fsycl)
4346

4447
# set icpx specific compiler flags based on the provided PLSSVM_TARGET_PLATFORMS
4548
set(PLSSVM_KOKKOS_SYCL_FSYCL_TARGETS "")
@@ -64,15 +67,12 @@ if (Kokkos_ENABLE_SYCL)
6467
target_compile_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=${PLSSVM_AMD_TARGET_ARCHS})
6568
target_link_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=${PLSSVM_AMD_TARGET_ARCHS})
6669
endif ()
67-
# intel targets
68-
if (DEFINED PLSSVM_INTEL_TARGET_ARCHS)
69-
# assemble -fsycl-targets
70-
list(APPEND PLSSVM_KOKKOS_SYCL_FSYCL_TARGETS "spir64_gen")
71-
endif ()
7270
# set -fsycl-targets
7371
list(JOIN PLSSVM_KOKKOS_SYCL_FSYCL_TARGETS "," PLSSVM_KOKKOS_SYCL_FSYCL_TARGETS_STRING)
74-
target_compile_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -sycl-std=2020 -fsycl -fsycl-targets=${PLSSVM_KOKKOS_SYCL_FSYCL_TARGETS_STRING})
75-
target_link_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -fsycl -fsycl-targets=${PLSSVM_KOKKOS_SYCL_FSYCL_TARGETS_STRING})
72+
if (NOT PLSSVM_KOKKOS_SYCL_FSYCL_TARGETS STREQUAL "")
73+
target_compile_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -fsycl-targets=${PLSSVM_KOKKOS_SYCL_FSYCL_TARGETS_STRING})
74+
target_link_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -fsycl-targets=${PLSSVM_KOKKOS_SYCL_FSYCL_TARGETS_STRING})
75+
endif ()
7676

7777
# add option for IntelLLVM Ahead-of-Time (AOT) compilation
7878
option(PLSSVM_KOKKOS_BACKEND_INTEL_LLVM_ENABLE_AOT "Enables Ahead-of-Time compilation for the Kokkos::SYCL execution space using IntelLLVM." ON)
@@ -104,6 +104,8 @@ if (Kokkos_ENABLE_SYCL)
104104
)
105105
endif ()
106106
if (DEFINED PLSSVM_INTEL_TARGET_ARCHS)
107+
target_compile_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -fsycl-targets=spir64_gen)
108+
target_link_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -fsycl-targets=spir64_gen)
107109
# add Intel GPU target specific flags for AOT
108110
list(JOIN PLSSVM_INTEL_TARGET_ARCHS "," PLSSVM_INTEL_TARGET_ARCHS_STRING)
109111
target_compile_options(${PLSSVM_KOKKOS_BACKEND_LIBRARY_NAME} PRIVATE -Xsycl-target-backend=spir64_gen "-device ${PLSSVM_INTEL_TARGET_ARCHS_STRING}")

src/plssvm/backends/SYCL/DPCPP/CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,12 @@ if (PLSSVM_SYCL_BACKEND_CHECK_FOR_DPCPP_COMPILER)
104104
)
105105
target_link_options(${PLSSVM_SYCL_BACKEND_DPCPP_LIBRARY_NAME} PRIVATE -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=${PLSSVM_AMD_TARGET_ARCHS})
106106
endif ()
107-
# intel targets
108-
if (DEFINED PLSSVM_INTEL_TARGET_ARCHS)
109-
# assemble -fsycl-targets
110-
list(APPEND PLSSVM_DPCPP_FSYCL_TARGETS "spir64_gen")
111-
endif ()
112107
# set -fsycl-targets
113108
list(JOIN PLSSVM_DPCPP_FSYCL_TARGETS "," PLSSVM_DPCPP_FSYCL_TARGETS_STRING)
114-
target_compile_options(${PLSSVM_SYCL_BACKEND_DPCPP_LIBRARY_NAME} PRIVATE -fsycl-targets=${PLSSVM_DPCPP_FSYCL_TARGETS_STRING})
115-
target_link_options(${PLSSVM_SYCL_BACKEND_DPCPP_LIBRARY_NAME} PRIVATE -fsycl-targets=${PLSSVM_DPCPP_FSYCL_TARGETS_STRING})
109+
if (NOT PLSSVM_DPCPP_FSYCL_TARGETS_STRING STREQUAL "")
110+
target_compile_options(${PLSSVM_SYCL_BACKEND_DPCPP_LIBRARY_NAME} PRIVATE -fsycl-targets=${PLSSVM_DPCPP_FSYCL_TARGETS_STRING})
111+
target_link_options(${PLSSVM_SYCL_BACKEND_DPCPP_LIBRARY_NAME} PRIVATE -fsycl-targets=${PLSSVM_DPCPP_FSYCL_TARGETS_STRING})
112+
endif ()
116113

117114
# add option for DPC++ Ahead-of-Time (AOT) compilation
118115
option(PLSSVM_SYCL_BACKEND_DPCPP_ENABLE_AOT "Enables Ahead-of-Time compilation for DPC++." ON)
@@ -148,6 +145,8 @@ if (PLSSVM_SYCL_BACKEND_CHECK_FOR_DPCPP_COMPILER)
148145
endif ()
149146
# intel targets
150147
if (DEFINED PLSSVM_INTEL_TARGET_ARCHS)
148+
target_compile_options(${PLSSVM_SYCL_BACKEND_DPCPP_LIBRARY_NAME} PRIVATE -fsycl-targets=spir64_gen)
149+
target_link_options(${PLSSVM_SYCL_BACKEND_DPCPP_LIBRARY_NAME} PRIVATE -fsycl-targets=spir64_gen)
151150
# add target specific flags for AOT
152151
list(JOIN PLSSVM_INTEL_TARGET_ARCHS "," PLSSVM_INTEL_TARGET_ARCHS_STRING)
153152
target_compile_options(

src/plssvm/backends/stdpar/roc-stdpar/CMakeLists.txt

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,11 @@
66

77
message(CHECK_START "searching for roc-stdpar")
88

9-
# check whether the roc-stdpar include path has been provided
10-
if (DEFINED PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH)
11-
set(PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH ${PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH}
12-
CACHE STRING "The roc-stdpar path (--hipstdpar-path) necessary to compile the roc-stdpar backend." FORCE
13-
)
14-
elseif (DEFINED ENV{PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH})
15-
set(PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH $ENV{PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH}
16-
CACHE STRING "The roc-stdpar path (--hipstdpar-path) necessary to compile the roc-stdpar backend." FORCE
17-
)
18-
endif ()
19-
20-
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH)
21-
# check for AMD's roc-stdpar enabled compiler -> only possible with the provided path
9+
# check whether the roc-stdpar compiler is available
10+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
11+
# check for AMD's roc-stdpar enabled compiler
2212
include(CheckCXXCompilerFlag)
23-
check_cxx_compiler_flag("-hipstdpar --hipstdpar-path=${PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH}" PLSSVM_HAS_HIPSTDPAR_STDPAR_FLAG)
13+
check_cxx_compiler_flag("--hipstdpar" PLSSVM_HAS_HIPSTDPAR_STDPAR_FLAG)
2414
if (NOT PLSSVM_HAS_HIPSTDPAR_STDPAR_FLAG)
2515
# the target offload flag couldn't be found!
2616
if (PLSSVM_ENABLE_STDPAR_BACKEND MATCHES "ON")
@@ -44,20 +34,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND PLSSVM_STDPAR_BACKEND_HIPSTDPAR_P
4434
# roc-stdpar found
4535
message(CHECK_PASS "found")
4636
set_local_and_parent(PLSSVM_STDPAR_BACKEND "roc-stdpar")
47-
else ()
48-
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH)
49-
message(STATUS "Try checking for the roc-stdpar backend but the roc-stdpar include path wasn't provided via \"PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH\"!")
50-
endif ()
51-
message(CHECK_FAIL "skipped")
52-
return()
5337
endif ()
5438

5539
# add stdpar implementation specific source file to library
5640
append_local_and_parent(PLSSVM_STDPAR_SOURCES ${CMAKE_CURRENT_LIST_DIR}/csvm.cpp)
5741

5842
# set global roc-stdpar compiler flags
5943
set_local_and_parent(
60-
PLSSVM_STDPAR_BACKEND_COMPILER_FLAG -hipstdpar --hipstdpar-path=${PLSSVM_STDPAR_BACKEND_HIPSTDPAR_PATH} --offload-arch=${PLSSVM_AMD_TARGET_ARCHS}
44+
PLSSVM_STDPAR_BACKEND_COMPILER_FLAG --hipstdpar --offload-arch=${PLSSVM_AMD_TARGET_ARCHS}
6145
)
6246
# TODO: The flag "--hipstdpar-interpose-alloc" may be necessary for older AMD GPUs
6347

tests/detail/cmd/parser_predict.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,31 +365,31 @@ TEST_F(ParserPredictVerbosityAndQuiet, parsing) {
365365
EXPECT_EQ(plssvm::verbosity, plssvm::verbosity_level::quiet);
366366
}
367367

368-
class ParserPredictHelp : public ParserPredict,
369-
public ::testing::WithParamInterface<std::string> { };
368+
class ParserPredictHelpDeathTest : public ParserPredict,
369+
public ::testing::WithParamInterface<std::string> { };
370370

371-
TEST_P(ParserPredictHelp, parsing) {
371+
TEST_P(ParserPredictHelpDeathTest, parsing) {
372372
const std::string &flag = GetParam();
373373
// create artificial command line arguments in test fixture
374374
this->CreateCMDArgs({ "./plssvm-predict", flag });
375375
// create parameter object
376376
EXPECT_EXIT((plssvm::detail::cmd::parser_predict{ this->get_argc(), this->get_argv() }), ::testing::ExitedWithCode(EXIT_SUCCESS), "");
377377
}
378378

379-
INSTANTIATE_TEST_SUITE_P(ParserPredict, ParserPredictHelp, ::testing::Values("-h", "--help"), naming::pretty_print_parameter_flag<ParserPredictHelp>);
379+
INSTANTIATE_TEST_SUITE_P(ParserPredict, ParserPredictHelpDeathTest, ::testing::Values("-h", "--help"), naming::pretty_print_parameter_flag<ParserPredictHelpDeathTest>);
380380

381-
class ParserPredictVersion : public ParserPredict,
382-
public ::testing::WithParamInterface<std::string> { };
381+
class ParserPredictVersionDeathTest : public ParserPredict,
382+
public ::testing::WithParamInterface<std::string> { };
383383

384-
TEST_P(ParserPredictVersion, parsing) {
384+
TEST_P(ParserPredictVersionDeathTest, parsing) {
385385
const std::string &flag = GetParam();
386386
// create artificial command line arguments in test fixture
387387
this->CreateCMDArgs({ "./plssvm-predict", flag });
388388
// create parameter object
389389
EXPECT_EXIT((plssvm::detail::cmd::parser_predict{ this->get_argc(), this->get_argv() }), ::testing::ExitedWithCode(EXIT_SUCCESS), "");
390390
}
391391

392-
INSTANTIATE_TEST_SUITE_P(ParserPredict, ParserPredictVersion, ::testing::Values("-v", "--version"), naming::pretty_print_parameter_flag<ParserPredictHelp>);
392+
INSTANTIATE_TEST_SUITE_P(ParserPredict, ParserPredictVersionDeathTest, ::testing::Values("-v", "--version"), naming::pretty_print_parameter_flag<ParserPredictVersionDeathTest>);
393393

394394
class ParserPredictDeathTest : public ParserPredict { };
395395

tests/detail/cmd/parser_scale.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,31 +334,31 @@ TEST_F(ParserScaleVerbosityAndQuiet, parsing) {
334334
EXPECT_EQ(plssvm::verbosity, plssvm::verbosity_level::quiet);
335335
}
336336

337-
class ParserScaleHelp : public ParserScale,
338-
public ::testing::WithParamInterface<std::string> { };
337+
class ParserScaleHelpDeathTest : public ParserScale,
338+
public ::testing::WithParamInterface<std::string> { };
339339

340-
TEST_P(ParserScaleHelp, parsing) {
340+
TEST_P(ParserScaleHelpDeathTest, parsing) {
341341
const std::string &flag = GetParam();
342342
// create artificial command line arguments in test fixture
343343
this->CreateCMDArgs({ "./plssvm-scale", flag });
344344
// create parameter object
345345
EXPECT_EXIT((plssvm::detail::cmd::parser_scale{ this->get_argc(), this->get_argv() }), ::testing::ExitedWithCode(EXIT_SUCCESS), "");
346346
}
347347

348-
INSTANTIATE_TEST_SUITE_P(ParserScale, ParserScaleHelp, ::testing::Values("-h", "--help"), naming::pretty_print_parameter_flag<ParserScaleHelp>);
348+
INSTANTIATE_TEST_SUITE_P(ParserScale, ParserScaleHelpDeathTest, ::testing::Values("-h", "--help"), naming::pretty_print_parameter_flag<ParserScaleHelpDeathTest>);
349349

350-
class ParserScaleVersion : public ParserScale,
351-
public ::testing::WithParamInterface<std::string> { };
350+
class ParserScaleVersionDeathTest : public ParserScale,
351+
public ::testing::WithParamInterface<std::string> { };
352352

353-
TEST_P(ParserScaleVersion, parsing) {
353+
TEST_P(ParserScaleVersionDeathTest, parsing) {
354354
const std::string &flag = GetParam();
355355
// create artificial command line arguments in test fixture
356356
this->CreateCMDArgs({ "./plssvm-scale", flag });
357357
// create parameter object
358358
EXPECT_EXIT((plssvm::detail::cmd::parser_scale{ this->get_argc(), this->get_argv() }), ::testing::ExitedWithCode(EXIT_SUCCESS), "");
359359
}
360360

361-
INSTANTIATE_TEST_SUITE_P(ParserScale, ParserScaleVersion, ::testing::Values("-v", "--version"), naming::pretty_print_parameter_flag<ParserScaleVersion>);
361+
INSTANTIATE_TEST_SUITE_P(ParserScale, ParserScaleVersionDeathTest, ::testing::Values("-v", "--version"), naming::pretty_print_parameter_flag<ParserScaleVersionDeathTest>);
362362

363363
class ParserScaleDeathTest : public ParserScale { };
364364

tests/detail/cmd/parser_train.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -682,31 +682,31 @@ TEST_F(ParserTrainVerbosityAndQuiet, parsing) {
682682
EXPECT_EQ(plssvm::verbosity, plssvm::verbosity_level::quiet);
683683
}
684684

685-
class ParserTrainHelp : public ParserTrain,
686-
public ::testing::WithParamInterface<std::string> { };
685+
class ParserTrainHelpDeathTest : public ParserTrain,
686+
public ::testing::WithParamInterface<std::string> { };
687687

688-
TEST_P(ParserTrainHelp, parsing) {
688+
TEST_P(ParserTrainHelpDeathTest, parsing) {
689689
const std::string &flag = GetParam();
690690
// create artificial command line arguments in test fixture
691691
this->CreateCMDArgs({ "./plssvm-train", flag });
692692
// create parameter object
693693
EXPECT_EXIT((plssvm::detail::cmd::parser_train{ this->get_argc(), this->get_argv() }), ::testing::ExitedWithCode(EXIT_SUCCESS), "");
694694
}
695695

696-
INSTANTIATE_TEST_SUITE_P(ParserTrain, ParserTrainHelp, ::testing::Values("-h", "--help"), naming::pretty_print_parameter_flag<ParserTrainHelp>);
696+
INSTANTIATE_TEST_SUITE_P(ParserTrain, ParserTrainHelpDeathTest, ::testing::Values("-h", "--help"), naming::pretty_print_parameter_flag<ParserTrainHelpDeathTest>);
697697

698-
class ParserTrainVersion : public ParserTrain,
699-
public ::testing::WithParamInterface<std::string> { };
698+
class ParserTrainVersionDeathTest : public ParserTrain,
699+
public ::testing::WithParamInterface<std::string> { };
700700

701-
TEST_P(ParserTrainVersion, parsing) {
701+
TEST_P(ParserTrainVersionDeathTest, parsing) {
702702
const std::string &flag = GetParam();
703703
// create artificial command line arguments in test fixture
704704
this->CreateCMDArgs({ "./plssvm-train", flag });
705705
// create parameter object
706706
EXPECT_EXIT((plssvm::detail::cmd::parser_train{ this->get_argc(), this->get_argv() }), ::testing::ExitedWithCode(EXIT_SUCCESS), "");
707707
}
708708

709-
INSTANTIATE_TEST_SUITE_P(ParserTrain, ParserTrainVersion, ::testing::Values("-v", "--version"), naming::pretty_print_parameter_flag<ParserTrainVersion>);
709+
INSTANTIATE_TEST_SUITE_P(ParserTrain, ParserTrainVersionDeathTest, ::testing::Values("-v", "--version"), naming::pretty_print_parameter_flag<ParserTrainVersionDeathTest>);
710710

711711
TEST_F(ParserTrainDeathTest, no_positional_argument) {
712712
this->CreateCMDArgs({ "./plssvm-train" });

0 commit comments

Comments
 (0)