P4 to Git Change 1792742 by gandryey@gera-win10 on 2019/06/06 11:13:45
SWDEV-79445 - OCL generic changes and code clean-up - Update COMGR loader to avoid the build with device layers Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/comgrctx.cpp#3 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#244 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#23 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.hpp#16 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#45 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#25 edit
Этот коммит содержится в:
@@ -3,6 +3,7 @@
|
||||
//
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
#include "os/os.hpp"
|
||||
#include "utils/flags.hpp"
|
||||
#include "comgrctx.hpp"
|
||||
|
||||
namespace amd {
|
||||
@@ -12,6 +13,7 @@ bool Comgr::is_ready_ = false;
|
||||
|
||||
bool Comgr::LoadLib() {
|
||||
#if defined(COMGR_DYN_DLL)
|
||||
LogInfo("Loading COMGR library.");
|
||||
static const char* ComgrLibName =
|
||||
LP64_SWITCH(WINDOWS_SWITCH("amdcomgr.dll", "libamdcomgr32.so"),
|
||||
WINDOWS_SWITCH("amdcomgr64.dll", "libamdcomgr64.so"));
|
||||
@@ -69,4 +71,4 @@ bool Comgr::LoadLib() {
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "thread/atomic.hpp"
|
||||
#include "thread/monitor.hpp"
|
||||
#include "utils/options.hpp"
|
||||
#include "comgrctx.hpp"
|
||||
|
||||
#if defined(WITH_HSA_DEVICE)
|
||||
#include "device/rocm/rocdevice.hpp"
|
||||
@@ -232,7 +233,6 @@ bool Device::ValidateComgr() {
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
// Check if Lightning compiler was requested
|
||||
if (settings_->useLightning_) {
|
||||
LogInfo("Loading COMGR library.");
|
||||
std::call_once(amd::Comgr::initialized, amd::Comgr::LoadLib);
|
||||
// Use Lightning only if it's available
|
||||
settings_->useLightning_ = amd::Comgr::IsReady();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "utils/options.hpp"
|
||||
#include "utils/bif_section_labels.hpp"
|
||||
#include "utils/libUtils.h"
|
||||
#include "comgrctx.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
@@ -30,6 +31,19 @@ using llvm::AMDGPU::HSAMD::ValueType;
|
||||
namespace device {
|
||||
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
amd_comgr_status_t getMetaBuf(const amd_comgr_metadata_node_t meta,
|
||||
std::string* str) {
|
||||
size_t size = 0;
|
||||
amd_comgr_status_t status = amd::Comgr::get_metadata_string(meta, &size, NULL);
|
||||
|
||||
if (status == AMD_COMGR_STATUS_SUCCESS) {
|
||||
str->resize(size-1); // minus one to discount the null character
|
||||
status = amd::Comgr::get_metadata_string(meta, &size, &((*str)[0]));
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static amd_comgr_status_t populateArgs(const amd_comgr_metadata_node_t key,
|
||||
const amd_comgr_metadata_node_t value,
|
||||
void *data) {
|
||||
|
||||
@@ -26,6 +26,7 @@ struct RuntimeHandle {
|
||||
};
|
||||
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
#include "amd_comgr.h"
|
||||
#include "llvm/Support/AMDGPUMetadata.h"
|
||||
typedef llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata KernelArgMD;
|
||||
|
||||
@@ -383,6 +384,7 @@ class Kernel : public amd::HeapObject {
|
||||
std::string compileVecTypeHint_; //!< kernel compiled vector type hint
|
||||
bool uniformWorkGroupSize_; //!< uniform work group size option
|
||||
size_t wavesPerSimdHint_; //!< waves per simd hit
|
||||
int maxOccupancyPerCu_; //!< Max occupancy per compute unit in threads
|
||||
};
|
||||
|
||||
//! Default constructor
|
||||
@@ -560,17 +562,6 @@ class Kernel : public amd::HeapObject {
|
||||
};
|
||||
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
static amd_comgr_status_t getMetaBuf(const amd_comgr_metadata_node_t meta,
|
||||
std::string* str) {
|
||||
size_t size = 0;
|
||||
amd_comgr_status_t status = amd::Comgr::get_metadata_string(meta, &size, NULL);
|
||||
|
||||
if (status == AMD_COMGR_STATUS_SUCCESS) {
|
||||
str->resize(size-1); // minus one to discount the null character
|
||||
status = amd::Comgr::get_metadata_string(meta, &size, &((*str)[0]));
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
amd_comgr_status_t getMetaBuf(const amd_comgr_metadata_node_t meta, std::string* str);
|
||||
#endif // defined(USE_COMGR_LIBRARY)
|
||||
} // namespace device
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "utils/options.hpp"
|
||||
#include "utils/bif_section_labels.hpp"
|
||||
#include "utils/libUtils.h"
|
||||
#include "comgrctx.hpp"
|
||||
|
||||
#if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
|
||||
#ifndef USE_COMGR_LIBRARY
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
#include "platform/object.hpp"
|
||||
#include "platform/memory.hpp"
|
||||
#include "devwavelimiter.hpp"
|
||||
#include "comgrctx.hpp"
|
||||
|
||||
#if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
|
||||
#ifndef USE_COMGR_LIBRARY
|
||||
#include "driver/AmdCompiler.h"
|
||||
#else
|
||||
#include "amd_comgr.h"
|
||||
#endif
|
||||
//#include "llvm/Support/AMDGPUMetadata.h"
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user