P4 to Git Change 1610640 by gandryey@gera-w8 on 2018/09/25 17:34:09
SWDEV-79445 - OCL generic changes and code clean-up Program compilation clean-up. Step#4: - Add common method FindGlobalVarSize() and metadata setup to the abstraction layer Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#6 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#4 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#76 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#32 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#89 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#38 edit
This commit is contained in:
@@ -16,16 +16,21 @@
|
||||
namespace llvm {
|
||||
namespace AMDGPU {
|
||||
namespace HSAMD {
|
||||
struct Metadata;
|
||||
namespace Kernel {
|
||||
struct Metadata;
|
||||
}}}}
|
||||
|
||||
//typedef llvm::AMDGPU::HSAMD::Metadata CodeObjectMD;
|
||||
#define LC_METADATA 1
|
||||
typedef llvm::AMDGPU::HSAMD::Metadata CodeObjectMD;
|
||||
typedef llvm::AMDGPU::HSAMD::Kernel::Metadata KernelMD;
|
||||
//typedef llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata KernelArgMD;
|
||||
|
||||
#endif // defined(WITH_LIGHTNING_COMPILER)
|
||||
|
||||
#ifndef LC_METADATA
|
||||
typedef char CodeObjectMD;
|
||||
#endif
|
||||
|
||||
namespace amd {
|
||||
namespace hsa {
|
||||
namespace loader {
|
||||
@@ -106,6 +111,8 @@ class Program : public amd::HeapObject {
|
||||
size_t globalVariableTotalSize_;
|
||||
amd::option::Options* programOptions_;
|
||||
|
||||
CodeObjectMD* metadata_; //!< Runtime metadata
|
||||
|
||||
public:
|
||||
//! Construct a section.
|
||||
Program(amd::Device& device);
|
||||
@@ -186,6 +193,8 @@ class Program : public amd::HeapObject {
|
||||
//! Global variables are a part of the code segment
|
||||
bool hasGlobalStores() const { return hasGlobalStores_; }
|
||||
|
||||
const CodeObjectMD* metadata() const { return metadata_; }
|
||||
|
||||
protected:
|
||||
//! Compile the device program with LC path
|
||||
bool compileImplLC(const std::string& sourceCode,
|
||||
@@ -266,6 +275,9 @@ class Program : public amd::HeapObject {
|
||||
*/
|
||||
aclType getNextCompilationStageFromBinary(amd::option::Options* options);
|
||||
|
||||
//! Finds the total size of all global variables in the program
|
||||
bool FindGlobalVarSize(void* binary, size_t binSize);
|
||||
|
||||
private:
|
||||
//! Disable default copy constructor
|
||||
Program(const Program&);
|
||||
|
||||
Reference in New Issue
Block a user