Skip to content

Revert "[SYCL] Allow overriding plugin libraries (#4067)" #4659

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

Merged
merged 2 commits into from
Sep 30, 2021
Merged
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: 0 additions & 4 deletions sycl/source/detail/config.def
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,4 @@ CONFIG(SYCL_CACHE_THRESHOLD, 16, __SYCL_CACHE_THRESHOLD)
CONFIG(SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE, 16, __SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE)
CONFIG(SYCL_CACHE_MAX_DEVICE_IMAGE_SIZE, 16, __SYCL_CACHE_MAX_DEVICE_IMAGE_SIZE)
CONFIG(INTEL_ENABLE_OFFLOAD_ANNOTATIONS, 1, __SYCL_INTEL_ENABLE_OFFLOAD_ANNOTATIONS)
CONFIG(SYCL_OVERRIDE_PI_OPENCL, 1024, __SYCL_OVERRIDE_PI_OPENCL)
CONFIG(SYCL_OVERRIDE_PI_LEVEL_ZERO, 1024, __SYCL_OVERRIDE_PI_LEVEL_ZERO)
CONFIG(SYCL_OVERRIDE_PI_CUDA, 1024, __SYCL_OVERRIDE_PI_CUDA)
CONFIG(SYCL_OVERRIDE_PI_HIP, 1024, __SYCL_OVERRIDE_PI_HIP)
CONFIG(SYCL_ENABLE_DEFAULT_CONTEXTS, 1, __SYCL_ENABLE_DEFAULT_CONTEXTS)
32 changes: 10 additions & 22 deletions sycl/source/detail/pi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,26 +278,13 @@ std::vector<std::pair<std::string, backend>> findPlugins() {
// search is done for libpi_opencl.so/pi_opencl.dll file in LD_LIBRARY_PATH
// env only.
//
const char *OpenCLPluginName =
SYCLConfig<SYCL_OVERRIDE_PI_OPENCL>::get()
? SYCLConfig<SYCL_OVERRIDE_PI_OPENCL>::get()
: __SYCL_OPENCL_PLUGIN_NAME;
const char *L0PluginName =
SYCLConfig<SYCL_OVERRIDE_PI_LEVEL_ZERO>::get()
? SYCLConfig<SYCL_OVERRIDE_PI_LEVEL_ZERO>::get()
: __SYCL_LEVEL_ZERO_PLUGIN_NAME;
const char *CUDAPluginName = SYCLConfig<SYCL_OVERRIDE_PI_CUDA>::get()
? SYCLConfig<SYCL_OVERRIDE_PI_CUDA>::get()
: __SYCL_CUDA_PLUGIN_NAME;
const char *HIPPluginName = SYCLConfig<SYCL_OVERRIDE_PI_HIP>::get()
? SYCLConfig<SYCL_OVERRIDE_PI_HIP>::get()
: __SYCL_HIP_PLUGIN_NAME;
device_filter_list *FilterList = SYCLConfig<SYCL_DEVICE_FILTER>::get();
if (!FilterList) {
PluginNames.emplace_back(OpenCLPluginName, backend::opencl);
PluginNames.emplace_back(L0PluginName, backend::level_zero);
PluginNames.emplace_back(CUDAPluginName, backend::cuda);
PluginNames.emplace_back(HIPPluginName, backend::hip);
PluginNames.emplace_back(__SYCL_OPENCL_PLUGIN_NAME, backend::opencl);
PluginNames.emplace_back(__SYCL_LEVEL_ZERO_PLUGIN_NAME,
backend::level_zero);
PluginNames.emplace_back(__SYCL_CUDA_PLUGIN_NAME, backend::cuda);
PluginNames.emplace_back(__SYCL_HIP_PLUGIN_NAME, backend::hip);
} else {
std::vector<device_filter> Filters = FilterList->get();
bool OpenCLFound = false;
Expand All @@ -308,20 +295,21 @@ std::vector<std::pair<std::string, backend>> findPlugins() {
backend Backend = Filter.Backend;
if (!OpenCLFound &&
(Backend == backend::opencl || Backend == backend::all)) {
PluginNames.emplace_back(OpenCLPluginName, backend::opencl);
PluginNames.emplace_back(__SYCL_OPENCL_PLUGIN_NAME, backend::opencl);
OpenCLFound = true;
}
if (!LevelZeroFound &&
(Backend == backend::level_zero || Backend == backend::all)) {
PluginNames.emplace_back(L0PluginName, backend::level_zero);
PluginNames.emplace_back(__SYCL_LEVEL_ZERO_PLUGIN_NAME,
backend::level_zero);
LevelZeroFound = true;
}
if (!CudaFound && (Backend == backend::cuda || Backend == backend::all)) {
PluginNames.emplace_back(CUDAPluginName, backend::cuda);
PluginNames.emplace_back(__SYCL_CUDA_PLUGIN_NAME, backend::cuda);
CudaFound = true;
}
if (!HIPFound && (Backend == backend::hip || Backend == backend::all)) {
PluginNames.emplace_back(HIPPluginName, backend::hip);
PluginNames.emplace_back(__SYCL_HIP_PLUGIN_NAME, backend::hip);
HIPFound = true;
}
}
Expand Down
16 changes: 0 additions & 16 deletions sycl/test/basic_tests/plugin_overrides_negative.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions sycl/test/basic_tests/plugin_overrides_positive.cpp

This file was deleted.