SWDEV-306410 - Remove program lock
Remove global program lock in order to fix too long kernel launch overhead with multi-threads on MGPUs. This patch depends on a compiler patch that makes LC thread safe. Change-Id: Ic8a7374d19112764d6de5d483ec5d07a56661d1b
This commit is contained in:
@@ -227,8 +227,6 @@ device::Program* Program::getDeviceProgram(const Device& device) const {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
Monitor Program::buildLock_("OCL build program", true);
|
||||
|
||||
static bool adjustOptionsOnIgnoreEnv(std::string &cppstr) {
|
||||
// if there is a -ignore-env, adjust options.
|
||||
bool optionChangable = true;
|
||||
@@ -250,8 +248,6 @@ int32_t Program::compile(const std::vector<Device*>& devices, size_t numHeaders,
|
||||
const char** headerIncludeNames, const char* options,
|
||||
void(CL_CALLBACK* notifyFptr)(cl_program, void*), void* data,
|
||||
bool optionChangable) {
|
||||
ScopedLock sl(buildLock_);
|
||||
|
||||
int32_t retval = CL_SUCCESS;
|
||||
|
||||
// Clear the program object
|
||||
@@ -321,7 +317,6 @@ int32_t Program::link(const std::vector<Device*>& devices, size_t numInputs,
|
||||
const std::vector<Program*>& inputPrograms, const char* options,
|
||||
void(CL_CALLBACK* notifyFptr)(cl_program, void*), void* data,
|
||||
bool optionChangable) {
|
||||
ScopedLock sl(buildLock_);
|
||||
int32_t retval = CL_SUCCESS;
|
||||
|
||||
if (symbolTable_ == NULL) {
|
||||
@@ -489,7 +484,6 @@ void Program::StubProgramSource(const std::string& app_name) {
|
||||
int32_t Program::build(const std::vector<Device*>& devices, const char* options,
|
||||
void(CL_CALLBACK* notifyFptr)(cl_program, void*), void* data,
|
||||
bool optionChangable, bool newDevProg) {
|
||||
ScopedLock sl(buildLock_);
|
||||
int32_t retval = CL_SUCCESS;
|
||||
|
||||
if (symbolTable_ == NULL) {
|
||||
@@ -596,8 +590,6 @@ int32_t Program::build(const std::vector<Device*>& devices, const char* options,
|
||||
}
|
||||
|
||||
bool Program::load(const std::vector<Device*>& devices) {
|
||||
ScopedLock sl(buildLock_);
|
||||
|
||||
for (const auto& it : devicePrograms_) {
|
||||
const Device& device = *(it.first);
|
||||
|
||||
|
||||
@@ -126,9 +126,6 @@ class Program : public RuntimeObject {
|
||||
//! Clears the program object if the app attempts to rebuild the program
|
||||
void clear();
|
||||
|
||||
//! Global build lock (remove when LLVM is thread-safe).
|
||||
static Monitor buildLock_;
|
||||
|
||||
public:
|
||||
//! Construct a new program to be compiled from the given source code.
|
||||
Program(Context& context, const std::string& sourceCode, Language language,
|
||||
|
||||
Reference in New Issue
Block a user