SWDEV-421102 - make clr compatible with c++20
Change-Id: Ia692817232caa3ee97dc0b2139645a0474b582e1
Este commit está contenido en:
@@ -440,7 +440,7 @@ hipError_t CodeObject::ExtractCodeObjectFromFile(
|
||||
std::vector<std::pair<const void*, size_t>>& code_objs) {
|
||||
hipError_t hip_error = hipSuccess;
|
||||
|
||||
if (fdesc < 0) {
|
||||
if (!amd::Os::isValidFileDesc(fdesc)) {
|
||||
return hipErrorFileNotFound;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ FatBinaryInfo::~FatBinaryInfo() {
|
||||
|
||||
} else {
|
||||
// Using Runtime Unbundler
|
||||
if (fdesc_ > 0) {
|
||||
if (amd::Os::isValidFileDesc(fdesc_)) {
|
||||
if (fsize_ && !amd::Os::MemoryUnmapFile(image_, fsize_)) {
|
||||
LogPrintfError("Cannot unmap file for fdesc: %d fsize: %d", fdesc_, fsize_);
|
||||
assert(false);
|
||||
@@ -183,7 +183,7 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vector<hip::Devi
|
||||
|
||||
#if !defined(_WIN32)
|
||||
// Using the file descriptor and file size, map the data object.
|
||||
if (fdesc_ > 0) {
|
||||
if (amd::Os::isValidFileDesc(fdesc_)) {
|
||||
guarantee(fsize_ > 0, "Cannot have a file size of 0, fdesc: %d fname: %s \n",
|
||||
fdesc_, fname_.c_str());
|
||||
if ((comgr_status = amd_comgr_set_data_from_file_slice(data_object, fdesc_, foffset_,
|
||||
|
||||
@@ -37,6 +37,16 @@
|
||||
|
||||
namespace amd {
|
||||
|
||||
bool Os::isValidFileDesc(const amd::Os::FileDesc& desc) {
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int>(desc) > 0;
|
||||
#else
|
||||
return static_cast<int>(desc) > 0;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void* Os::loadLibrary(const char* libraryname) {
|
||||
void* handle;
|
||||
|
||||
|
||||
@@ -292,6 +292,8 @@ class Os : AllStatic {
|
||||
//
|
||||
typedef bool (*SymbolCallback)(std::string, const void*, void*);
|
||||
|
||||
//! checks if file descriptor is valid
|
||||
static bool isValidFileDesc(const amd::Os::FileDesc& desc);
|
||||
//! Load the shared library named by \a filename
|
||||
static void* loadLibrary(const char* filename);
|
||||
//! Unload the shared library.
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
if(pQuery_) pQuery_->Release();
|
||||
// Check if this resource has already been used for interop
|
||||
if(resources_.size()) {
|
||||
for(auto& it = resources_.cbegin(); it != resources_.cend(); it++) {
|
||||
for(auto it = resources_.cbegin(); it != resources_.cend(); it++) {
|
||||
if(((pD3D10ResOrig_ && (*it).first == (void*) pD3D10ResOrig_)
|
||||
|| ((*it).first == (void*) pD3D10Res_))
|
||||
&& (*it).second == subRes_) {
|
||||
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
if(pQuery_) pQuery_->Release();
|
||||
// Check if this resource has already been used for interop
|
||||
if(resources_.size()) {
|
||||
for(auto& it = resources_.cbegin(); it != resources_.cend(); it++) {
|
||||
for(auto it = resources_.cbegin(); it != resources_.cend(); it++) {
|
||||
if(((pD3D11ResOrig_ && (*it).first == (void*) pD3D11ResOrig_)
|
||||
|| ((*it).first == (void*) pD3D11Res_))
|
||||
&& (*it).second.first == subRes_
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
if(pQuery_) pQuery_->Release();
|
||||
//if the resouce is being used
|
||||
if(resources_.size()) {
|
||||
for(auto& it = resources_.cbegin(); it != resources_.cend(); it++) {
|
||||
for(auto it = resources_.cbegin(); it != resources_.cend(); it++) {
|
||||
if( surfInfo_.resource &&
|
||||
((*it).first.surfInfo.resource == surfInfo_.resource) &&
|
||||
((*it).first.surfPlane == surfPlane_)) {
|
||||
|
||||
Referencia en una nueva incidencia
Block a user