SWDEV-370659 - Add lock for HSAIL only

Add lock for HSAIL only in order to fix test failures
in math brute force and integer_ops tests.

Change-Id: I5f14cdcaa4ee9867fdae63fff197a0f21ee5f1d4
This commit is contained in:
Tao Sang
2022-12-01 21:40:20 -05:00
committad av Tao Sang
förälder a4576e0a60
incheckning f29d3bc3ac
2 ändrade filer med 30 tillägg och 0 borttagningar
+13
Visa fil
@@ -126,6 +126,19 @@ class Program : public RuntimeObject {
//! Clears the program object if the app attempts to rebuild the program
void clear();
#if defined(WITH_COMPILER_LIB)
//! Global HSAIL build lock (remove when HSAIL is thread-safe).
static Monitor buildLock_;
//! Check if any device uses HSAIL
bool useHsail(const std::vector<Device*>& devices) const {
for (const auto& it : devices) {
if (!it->settings().useLightning_) return true;
}
return false;
}
#endif
public:
//! Construct a new program to be compiled from the given source code.
Program(Context& context, const std::string& sourceCode, Language language,