Skip to content

Commit

Permalink
[SYCL][E2E] Fix deprecated warnings in Config tests (#14429)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayylol authored Jul 11, 2024
1 parent 991b352 commit b7d13a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
22 changes: 10 additions & 12 deletions sycl/test-e2e/Config/device_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@

#include <iostream>

class RejectEverything : public sycl::device_selector {
public:
int operator()(const sycl::device &Device) const final {
// Negative value means that a device must not be selected
return -1;
}
};

int main() {
RejectEverything Selector;
auto RejectEverything = [](const sycl::device &) { return -1; };
try {
sycl::device Device(Selector);
} catch (sycl::exception &) {
return 0;
sycl::device Device(RejectEverything);
} catch (sycl::exception &e) {
if (e.code() == sycl::errc::runtime &&
std::string(e.what()).find("No device of requested type available.") !=
std::string::npos) {
return 0;
}
std::cerr << "Error. Incorrect exception was thrown." << std::endl;
return 1;
}
std::cerr << "Error. A device is found." << std::endl;
return 1;
Expand Down
1 change: 0 additions & 1 deletion sycl/test-e2e/Config/env_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// RUN: %if cpu %{ env SYCL_PROGRAM_APPEND_COMPILE_OPTIONS="-enable-link-options -cl-denorms-are-zero" SHOULD_CRASH=1 %{run} %t.out %}

#include <cassert>
#include <memory>
#include <sycl/detail/core.hpp>

using namespace sycl;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Config/kernel_from_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// FIXME separate compilation requires -fno-sycl-dead-args-optimization
// As we are doing a separate device compilation here, we need to explicitly
// add the device lib instrumentation (itt_compiler_wrapper)
// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 -fsycl-device-only -fsycl-use-bitcode -fno-sycl-dead-args-optimization -Xclang -fsycl-int-header=%t.h -c %s -o %t.bc -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict
// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 -fsycl-device-only -fno-sycl-dead-args-optimization -Xclang -fsycl-int-header=%t.h -c %s -o %t.bc -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict
// >> ---- unbundle compiler wrapper and sanitizer device objects
// RUN: clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-itt-compiler-wrappers%obj_ext -output=%t_compiler_wrappers.bc -unbundle
// RUN: %if linux %{ clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-sanitizer%obj_ext -output=%t_sanitizer.bc -unbundle %}
Expand Down

0 comments on commit b7d13a3

Please sign in to comment.