SWDEV-241902 - Changes to pass file descriptor and offset to load code object.

Change-Id: I0243cccdeaa533b2a56fde42f12d5424c3b63a3b
This commit is contained in:
kjayapra-amd authored and Karthik Jayaprakash committed 2020-09-15 07:54:24 -04:00
1 parent de6e02f98b
commit a66c56d641
14 files changed
+220 -45

No files matched your search

+5 -9
View File
@@ -80,7 +80,6 @@ class Context;
//! A collection of binaries for devices in the associated context.
class Program : public RuntimeObject {
public:
typedef std::pair<const void* /* mmap_ptr */, const size_t /* mmap_size */> mmap_t;
typedef std::tuple<const uint8_t* /*image*/, size_t /*size*/, bool /*allocated*/> binary_t;
typedef std::set<Device const*> devicelist_t;
typedef std::unordered_map<Device const*, binary_t> devicebinary_t;
@@ -114,7 +113,6 @@ class Program : public RuntimeObject {
//! The device program objects included in this program
deviceprograms_t devicePrograms_;
devicelist_t deviceList_;
const mmap_t mmap_;
std::string programLog_; //!< Log for parsing options, etc.
@@ -135,16 +133,13 @@ class Program : public RuntimeObject {
sourceCode_(sourceCode),
language_(language),
symbolTable_(NULL),
mmap_({nullptr, 0}),
programLog_() {
}
//! Construct a new program associated with a context.
Program(Context& context, Language language = Binary,
const void* mmap_ptr = nullptr, const size_t mmap_size = 0)
Program(Context& context, Language language = Binary)
: context_(context), language_(language),
symbolTable_(NULL),
mmap_({mmap_ptr, mmap_size}) {}
symbolTable_(NULL) {}
//! Returns context, associated with the current program.
const Context& context() const { return context_(); }
@@ -175,8 +170,9 @@ class Program : public RuntimeObject {
//! Add a new device program with or without binary image and options.
int32_t addDeviceProgram(Device&, const void* image = NULL, size_t len = 0,
bool make_copy = true, amd::option::Options* options = NULL,
const amd::Program* same_prog = nullptr);
bool make_copy = true, amd::option::Options* options = NULL,
const amd::Program* same_prog = nullptr, amd::Os::FileDesc fdesc = -1,
size_t foffset = 0, std::string uri = std::string());
//! Find the section for the given device. Return NULL if not found.
device::Program* getDeviceProgram(const Device& device) const;