diff --git a/test_common/harness/kernelHelpers.cpp b/test_common/harness/kernelHelpers.cpp index bfe7f3aa..194de05c 100644 --- a/test_common/harness/kernelHelpers.cpp +++ b/test_common/harness/kernelHelpers.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #if defined(_WIN32) std::string slash = "\\"; @@ -35,6 +36,8 @@ std::string slash = "\\"; std::string slash = "/"; #endif +static std::mutex gCompilerMutex; + static cl_int get_first_device_id(const cl_context context, cl_device_id &device); long get_file_size(const std::string &fileName) @@ -717,6 +720,8 @@ static int create_single_kernel_helper_create_program(cl_context context, const bool openclCXX, CompilationMode compilationMode) { + std::lock_guard compiler_lock(gCompilerMutex); + std::string filePrefix = get_unique_filename_prefix(numKernelLines, kernelProgram, buildOptions);