|
16 | 16 | /// \ingroup sycl_pi_esimd_emulator
|
17 | 17 |
|
18 | 18 | #include <sycl/detail/common.hpp>
|
19 |
| -#include <sycl/ext/intel/esimd/emu/detail/esimd_emulator_device_interface.hpp> |
20 | 19 |
|
21 | 20 | namespace sycl {
|
22 | 21 | inline namespace _V1 {
|
23 | 22 | namespace detail {
|
24 | 23 |
|
25 |
| -__SYCL_EXPORT ESIMDDeviceInterface *getESIMDDeviceInterface() { |
26 |
| - // TODO (performance) cache the interface pointer, can make a difference |
27 |
| - // when calling fine-grained libCM APIs through it (like memory access in a |
28 |
| - // tight loop) |
29 |
| - void *PIOpaqueData = nullptr; |
30 |
| - |
31 |
| - try { |
32 |
| - PIOpaqueData = |
33 |
| - getPluginOpaqueData<sycl::backend::ext_intel_esimd_emulator>(nullptr); |
34 |
| - } catch (...) { |
35 |
| - std::cerr << "ESIMD EMU plugin error or not loaded - try setting " |
36 |
| - "SYCL_DEVICE_FILTER=esimd_emulator:gpu environment variable" |
37 |
| - << std::endl; |
38 |
| - throw sycl::exception(sycl::errc::feature_not_supported); |
39 |
| - } |
40 |
| - |
41 |
| - ESIMDEmuPluginOpaqueData *OpaqueData = |
42 |
| - reinterpret_cast<ESIMDEmuPluginOpaqueData *>(PIOpaqueData); |
43 |
| - |
44 |
| - // First check if opaque data version is compatible. |
45 |
| - if (OpaqueData->version != ESIMD_EMULATOR_PLUGIN_OPAQUE_DATA_VERSION) { |
46 |
| - // NOTE: the version check should always be '!=' as layouts of different |
47 |
| - // versions of PluginOpaqueData is not backward compatible, unlike |
48 |
| - // layout of the ESIMDDeviceInterface. |
| 24 | +struct ESIMDDeviceInterface { |
| 25 | + uintptr_t version; |
| 26 | + void *reserved; |
| 27 | + ESIMDDeviceInterface(); |
| 28 | +}; |
49 | 29 |
|
50 |
| - std::cerr << __FUNCTION__ << std::endl |
51 |
| - << "Opaque data returned by ESIMD Emu plugin is incompatible with" |
52 |
| - << "the one used in current implementation." << std::endl |
53 |
| - << "Returned version : " << OpaqueData->version << std::endl |
54 |
| - << "Required version : " |
55 |
| - << ESIMD_EMULATOR_PLUGIN_OPAQUE_DATA_VERSION << std::endl; |
56 |
| - throw sycl::exception(sycl::errc::feature_not_supported); |
57 |
| - } |
58 |
| - // Opaque data version is OK, can cast the 'data' field. |
59 |
| - ESIMDDeviceInterface *Interface = |
60 |
| - reinterpret_cast<ESIMDDeviceInterface *>(OpaqueData->data); |
61 |
| - |
62 |
| - // Now check that device interface version is compatible. |
63 |
| - if (Interface->version < ESIMD_DEVICE_INTERFACE_VERSION) { |
64 |
| - std::cerr << __FUNCTION__ << std::endl |
65 |
| - << "The device interface version provided from plug-in " |
66 |
| - << "library is behind required device interface version" |
67 |
| - << std::endl |
68 |
| - << "Found version : " << Interface->version << std::endl |
69 |
| - << "Required version :" << ESIMD_DEVICE_INTERFACE_VERSION |
70 |
| - << std::endl; |
71 |
| - throw sycl::exception(sycl::errc::feature_not_supported); |
72 |
| - } |
73 |
| - return Interface; |
| 30 | +// TODO: this function is kept only for libsycl binary backward compatibility. |
| 31 | +// Remove it when ABI breaking changes are allowed. |
| 32 | +__SYCL_EXPORT ESIMDDeviceInterface *getESIMDDeviceInterface() { |
| 33 | + return nullptr; |
74 | 34 | }
|
| 35 | + |
75 | 36 | } // namespace detail
|
76 | 37 | } // namespace _V1
|
77 | 38 | } // namespace sycl
|
0 commit comments