P4 to Git Change 1600140 by gandryey@gera-w8 on 2018/08/30 15:10:58
SWDEV-79445 - OCL generic changes and code clean-up
- It's not necessary to have backend specific binary objects in HSAIL or LC paths.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#228 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#316 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpubinary.hpp#28 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#239 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.hpp#72 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbinary.cpp#3 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbinary.hpp#4 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#66 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocbinary.hpp#7 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#82 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#33 edit
[ROCm/clr commit: 5c4478fa22]
Bu işleme şunda yer alıyor:
@@ -41,7 +41,8 @@ class ClBinary : public device::ClBinary {
|
||||
#pragma pack(pop)
|
||||
|
||||
//! Constructor
|
||||
ClBinary(const NullDevice& dev) : device::ClBinary(dev) {}
|
||||
ClBinary(const NullDevice& dev, BinaryImageFormat bifVer = BIF_VERSION2)
|
||||
: device::ClBinary(dev, bifVer) {}
|
||||
|
||||
//! Destructor
|
||||
~ClBinary() {}
|
||||
@@ -91,36 +92,6 @@ class ClBinary : public device::ClBinary {
|
||||
const NullDevice& dev() const { return static_cast<const NullDevice&>(dev_); }
|
||||
};
|
||||
|
||||
class ClBinaryHsa : public device::ClBinary {
|
||||
public:
|
||||
ClBinaryHsa(const Device& dev, BinaryImageFormat bifVer = BIF_VERSION3)
|
||||
: device::ClBinary(dev, bifVer) {}
|
||||
|
||||
//! Destructor
|
||||
~ClBinaryHsa() {}
|
||||
|
||||
|
||||
protected:
|
||||
bool setElfTarget() {
|
||||
uint32_t target = static_cast<uint32_t>(21); // dev().calTarget());
|
||||
assert(((0xFFFF8000 & target) == 0) && "ASIC target ID >= 2^15");
|
||||
uint16_t elf_target = (uint16_t)(0x7FFF & target);
|
||||
return elfOut()->setTarget(elf_target, amd::OclElf::CAL_PLATFORM);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
//! Disable default copy constructor
|
||||
ClBinaryHsa(const ClBinaryHsa&);
|
||||
|
||||
//! Disable default operator=
|
||||
ClBinaryHsa& operator=(const ClBinaryHsa&);
|
||||
|
||||
//! Returns the HSA device for this object
|
||||
const Device& dev() const { return static_cast<const Device&>(dev_); }
|
||||
};
|
||||
|
||||
|
||||
} // namespace gpu
|
||||
|
||||
#endif // GPUBINARY_HPP_
|
||||
|
||||
@@ -834,13 +834,6 @@ bool NullProgram::initClBinary() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void NullProgram::releaseClBinary() {
|
||||
if (clBinary_ != NULL) {
|
||||
delete clBinary_;
|
||||
clBinary_ = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool NullProgram::loadBinary(bool* hasRecompiled) {
|
||||
if (!clBinary()->loadKernels(*this, hasRecompiled)) {
|
||||
clear();
|
||||
@@ -2087,23 +2080,6 @@ bool HSAILProgram::linkImpl(amd::option::Options* options) {
|
||||
|
||||
bool HSAILProgram::createBinary(amd::option::Options* options) { return true; }
|
||||
|
||||
bool HSAILProgram::initClBinary() {
|
||||
if (clBinary_ == NULL) {
|
||||
clBinary_ = new ClBinaryHsa(static_cast<const Device&>(device()));
|
||||
if (clBinary_ == NULL) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void HSAILProgram::releaseClBinary() {
|
||||
if (clBinary_ != NULL) {
|
||||
delete clBinary_;
|
||||
clBinary_ = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
std::string HSAILProgram::hsailOptions() {
|
||||
std::string hsailOptions;
|
||||
// Set options for the standard device specific options
|
||||
|
||||
@@ -114,8 +114,6 @@ class NullProgram : public device::Program {
|
||||
|
||||
// Initialize Binary for GPU
|
||||
virtual bool initClBinary();
|
||||
// Release Binary for GPU
|
||||
virtual void releaseClBinary();
|
||||
|
||||
//! Returns global constant buffers
|
||||
const std::vector<uint>& glbCb() const { return glbCb_; }
|
||||
@@ -520,12 +518,6 @@ class HSAILProgram : public device::Program {
|
||||
|
||||
virtual bool createBinary(amd::option::Options* options);
|
||||
|
||||
//! Initialize Binary
|
||||
virtual bool initClBinary();
|
||||
|
||||
//! Release the Binary
|
||||
virtual void releaseClBinary();
|
||||
|
||||
virtual const aclTargetInfo& info(const char* str = "");
|
||||
|
||||
virtual bool isElf(const char* bin) const {
|
||||
@@ -533,14 +525,6 @@ class HSAILProgram : public device::Program {
|
||||
// return false;
|
||||
}
|
||||
|
||||
//! Returns the binary
|
||||
// This should ensure that the binary is updated with all the kernels
|
||||
// ClBinary& clBinary() { return binary_; }
|
||||
ClBinary* clBinary() { return static_cast<ClBinary*>(device::Program::clBinary()); }
|
||||
const ClBinary* clBinary() const {
|
||||
return static_cast<const ClBinary*>(device::Program::clBinary());
|
||||
}
|
||||
|
||||
private:
|
||||
//! Disable default copy constructor
|
||||
HSAILProgram(const HSAILProgram&);
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle