File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 41
41
42
42
if 'SYCL_DEVICELIB_NO_FALLBACK' in os .environ :
43
43
config .environment ['SYCL_DEVICELIB_NO_FALLBACK' ] = os .environ ['SYCL_DEVICELIB_NO_FALLBACK' ]
44
- else :
45
- # Disable device library fallback for unit tests by default.
46
- config . environment [ 'SYCL_DEVICELIB_NO_FALLBACK' ] = "1"
44
+ # We do not have any default for SYCL_DEVICELIB_NO_FALLBACK, which means that
45
+ # env variable won't be defined. That is ok, because we expect tests to pass
46
+ # even without it.
47
47
48
48
# Propagate path to symbolizer for ASan/MSan.
49
49
for symbolizer in ['ASAN_SYMBOLIZER_PATH' , 'MSAN_SYMBOLIZER_PATH' ]:
Original file line number Diff line number Diff line change @@ -160,7 +160,27 @@ template <typename T> class PiArray {
160
160
// / Convenience wrapper for pi_device_binary_property_set.
161
161
class PiPropertySet {
162
162
public:
163
- PiPropertySet () = default ;
163
+ PiPropertySet () {
164
+ // Most of unit-tests are statically linked with SYCL RT. On Linux and Mac
165
+ // systems that causes incorrect RT installation directory detection, which
166
+ // prevents proper loading of fallback libraries. See intel/llvm#6945
167
+ //
168
+ // Fallback libraries are automatically loaded and linked into device image
169
+ // unless there is a special property attached to it or special env variable
170
+ // is set which forces RT to skip fallback libraries.
171
+ //
172
+ // Setting this property here so unit-tests can be launched under any
173
+ // environment.
174
+
175
+ std::vector<char > Data (/* eight elements */ 8 ,
176
+ /* each element is zero */ 0 );
177
+ // Name doesn't matter here, it is not used by RT
178
+ // Value must be an all-zero 32-bit mask, which would mean that no fallback
179
+ // libraries are needed to be loaded.
180
+ PiProperty DeviceLibReqMask (" " , Data, PI_PROPERTY_TYPE_UINT32);
181
+ insert (__SYCL_PI_PROPERTY_SET_DEVICELIB_REQ_MASK,
182
+ PiArray{DeviceLibReqMask});
183
+ }
164
184
165
185
// / Adds a new array of properties to the set.
166
186
// /
You can’t perform that action at this time.
0 commit comments