Skip to content

[ESIMD][NFC] Remove some obsolete ESIMD emulator related code #12300

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 1 commit into from
Jan 5, 2024
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

This file was deleted.

This file was deleted.

59 changes: 10 additions & 49 deletions sycl/source/esimd_emulator_device_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,62 +16,23 @@
/// \ingroup sycl_pi_esimd_emulator

#include <sycl/detail/common.hpp>
#include <sycl/ext/intel/esimd/emu/detail/esimd_emulator_device_interface.hpp>

namespace sycl {
inline namespace _V1 {
namespace detail {

__SYCL_EXPORT ESIMDDeviceInterface *getESIMDDeviceInterface() {
// TODO (performance) cache the interface pointer, can make a difference
// when calling fine-grained libCM APIs through it (like memory access in a
// tight loop)
void *PIOpaqueData = nullptr;

try {
PIOpaqueData =
getPluginOpaqueData<sycl::backend::ext_intel_esimd_emulator>(nullptr);
} catch (...) {
std::cerr << "ESIMD EMU plugin error or not loaded - try setting "
"SYCL_DEVICE_FILTER=esimd_emulator:gpu environment variable"
<< std::endl;
throw sycl::exception(sycl::errc::feature_not_supported);
}

ESIMDEmuPluginOpaqueData *OpaqueData =
reinterpret_cast<ESIMDEmuPluginOpaqueData *>(PIOpaqueData);

// First check if opaque data version is compatible.
if (OpaqueData->version != ESIMD_EMULATOR_PLUGIN_OPAQUE_DATA_VERSION) {
// NOTE: the version check should always be '!=' as layouts of different
// versions of PluginOpaqueData is not backward compatible, unlike
// layout of the ESIMDDeviceInterface.
struct ESIMDDeviceInterface {
uintptr_t version;
void *reserved;
ESIMDDeviceInterface();
};

std::cerr << __FUNCTION__ << std::endl
<< "Opaque data returned by ESIMD Emu plugin is incompatible with"
<< "the one used in current implementation." << std::endl
<< "Returned version : " << OpaqueData->version << std::endl
<< "Required version : "
<< ESIMD_EMULATOR_PLUGIN_OPAQUE_DATA_VERSION << std::endl;
throw sycl::exception(sycl::errc::feature_not_supported);
}
// Opaque data version is OK, can cast the 'data' field.
ESIMDDeviceInterface *Interface =
reinterpret_cast<ESIMDDeviceInterface *>(OpaqueData->data);

// Now check that device interface version is compatible.
if (Interface->version < ESIMD_DEVICE_INTERFACE_VERSION) {
std::cerr << __FUNCTION__ << std::endl
<< "The device interface version provided from plug-in "
<< "library is behind required device interface version"
<< std::endl
<< "Found version : " << Interface->version << std::endl
<< "Required version :" << ESIMD_DEVICE_INTERFACE_VERSION
<< std::endl;
throw sycl::exception(sycl::errc::feature_not_supported);
}
return Interface;
// TODO: this function is kept only for libsycl binary backward compatibility.
// Remove it when ABI breaking changes are allowed.
__SYCL_EXPORT ESIMDDeviceInterface *getESIMDDeviceInterface() {
return nullptr;
}

} // namespace detail
} // namespace _V1
} // namespace sycl