Updated amdFileRead/Write in rocdevice to support windows build (#1435)
* Updated amdFileRead in rocdevice to support windows build * Updated amdFileRead in rocdevice to support windows build
This commit is contained in:
@@ -1700,15 +1700,16 @@ bool Device::globalFreeMemory(size_t* freeMemory) const {
|
||||
bool Device::amdFileRead(amd::Os::FileDesc handle, void* devicePtr, uint64_t size, int64_t file_offset,
|
||||
uint64_t* size_copied, int32_t* status) {
|
||||
hsa_amd_ais_file_handle_t fh{};
|
||||
hsa_status_t ret = HSA_STATUS_ERROR;
|
||||
#if defined(_WIN32)
|
||||
fh.handle = handle;
|
||||
#else
|
||||
fh.fd = handle;
|
||||
ret = Hsa::ais_file_read(fh, devicePtr, size, file_offset, size_copied, status);
|
||||
#endif
|
||||
hsa_status_t ret = Hsa::ais_file_read(fh,
|
||||
devicePtr, size, file_offset, size_copied, status);
|
||||
|
||||
if (HSA_STATUS_SUCCESS != ret) {
|
||||
LogPrintfError("hsa_amd_ais_file_read operation failed with err 0x%xh", ret);
|
||||
LogPrintfError("amdFileRead operation failed with err 0x%xh", ret);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -1717,15 +1718,16 @@ bool Device::amdFileRead(amd::Os::FileDesc handle, void* devicePtr, uint64_t siz
|
||||
bool Device::amdFileWrite(amd::Os::FileDesc handle, void* devicePtr, uint64_t size, int64_t file_offset,
|
||||
uint64_t* size_copied, int32_t* status) {
|
||||
hsa_amd_ais_file_handle_t fh{};
|
||||
hsa_status_t ret = HSA_STATUS_ERROR;
|
||||
#if defined(_WIN32)
|
||||
fh.handle = handle;
|
||||
#else
|
||||
fh.fd = handle;
|
||||
ret = Hsa::ais_file_write(fh, devicePtr, size, file_offset, size_copied, status);
|
||||
#endif
|
||||
hsa_status_t ret = Hsa::ais_file_write(fh,
|
||||
devicePtr, size, file_offset, size_copied, status);
|
||||
|
||||
if (HSA_STATUS_SUCCESS != ret) {
|
||||
LogPrintfError("hsa_amd_ais_file_write operation failed with err 0x%xh", ret);
|
||||
LogPrintfError("amdFileWrite operation failed with err 0x%xh", ret);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user