ae3a15d331
ECR #333753 - part of the changes to use llvm 3.6
Testing: smoke, precheckin
Reviewed by Brian Sumner
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_8/acl.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/linker.cpp#122 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/sync.cpp#1 add
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/sync.hpp#1 add
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#63 edit
[ROCm/clr commit: 7168d24210]
25 строки
418 B
C++
25 строки
418 B
C++
//
|
|
// Copyright (c) 2008 Advanced Micro Devices, Inc. All rights reserved.
|
|
//
|
|
#include "sync.hpp"
|
|
#include "llvm/Support/Mutex.h"
|
|
#include "llvm/Support/Threading.h"
|
|
|
|
|
|
static llvm::sys::MutexImpl mtx;
|
|
|
|
namespace amdcl
|
|
{
|
|
|
|
void acquire_global_lock() {
|
|
if (llvm::llvm_is_multithreaded())
|
|
mtx.acquire();
|
|
}
|
|
|
|
void release_global_lock() {
|
|
if (llvm::llvm_is_multithreaded())
|
|
mtx.release();
|
|
}
|
|
|
|
} // namespace amdcl
|