P4 to Git Change 1410373 by gandryey@gera-w8 on 2017/05/16 17:16:52
SWDEV-120180 - [amdgpu-pro] OpenCL support for SSG - Add initial support of DGMA memory under ROCr backend. - The implementation requires amdgpu-pro stack initialization and memory allocation. - An interop with HSA device is created for ROCr access Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/Makefile#10 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#153 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp#18 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#285 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#351 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile.oclrocm#16 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/lnxheaders.h#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodevice.cpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodevice.hpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodriver.hpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#51 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#21 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#19 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#18 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#38 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#11 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#101 edit ... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#41 edit
This commit is contained in:
@@ -5,15 +5,13 @@
|
||||
#include "cl_common.hpp"
|
||||
#include <CL/cl_ext.h>
|
||||
|
||||
#include <locale>
|
||||
#include <codecvt>
|
||||
#include "platform/object.hpp"
|
||||
|
||||
#include "cl_lqdflash_amd.h"
|
||||
|
||||
#if defined __linux__
|
||||
typedef wchar_t char_t;
|
||||
#endif // __linux__
|
||||
|
||||
#if !defined(BUILD_HSA_TARGET) && defined(_WIN32)
|
||||
#if (!defined(BUILD_HSA_TARGET) && defined(WITH_HSA_DEVICE)) || defined(_WIN32)
|
||||
#define WITH_LIQUID_FLASH 1
|
||||
#endif // _WIN32
|
||||
|
||||
@@ -21,7 +19,6 @@ typedef wchar_t char_t;
|
||||
#include "lf.h"
|
||||
#endif // WITH_LIQUID_FLASH
|
||||
|
||||
|
||||
namespace amd {
|
||||
|
||||
LiquidFlashFile::~LiquidFlashFile() { close(); }
|
||||
@@ -29,7 +26,7 @@ LiquidFlashFile::~LiquidFlashFile() { close(); }
|
||||
bool LiquidFlashFile::open() {
|
||||
#if defined WITH_LIQUID_FLASH
|
||||
lf_status err;
|
||||
lf_file_flags flags;
|
||||
lf_file_flags flags = 0;
|
||||
|
||||
switch (flags_) {
|
||||
case CL_FILE_READ_ONLY_AMD:
|
||||
@@ -42,8 +39,16 @@ bool LiquidFlashFile::open() {
|
||||
flags = LF_READ | LF_WRITE;
|
||||
break;
|
||||
}
|
||||
#ifdef ATI_OS_LINUX
|
||||
assert(sizeof(wchar_t) != sizeof(lf_char));
|
||||
std::string name_char;
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> cv;
|
||||
name_char = cv.to_bytes(name_);
|
||||
handle_ = lfOpenFile(name_char.c_str(), flags, &err);
|
||||
#else
|
||||
handle_ = lfOpenFile(name_.c_str(), flags, &err);
|
||||
#endif
|
||||
|
||||
handle_ = lfOpenFile(name_, flags, &err);
|
||||
if (err != lf_success) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user