0af2c7043c
SWDEV-102726 - [OCL-LC-ROCm] Open source OpenCL Runtime - Changes required to use the Khronos ICD sources instead of ours. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/CMakeLists.txt#3 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#54 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_icd.cpp#29 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h#7 edit ... //depot/stg/opencl/drivers/opencl/runtime/CMakeLists.txt#2 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpubinary.cpp#12 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpubinary.hpp#5 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#319 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#127 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#233 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#239 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/object.hpp#18 edit
76 行
2.0 KiB
C++
76 行
2.0 KiB
C++
//
|
|
// Copyright (c) 2011 Advanced Micro Devices, Inc. All rights reserved.
|
|
//
|
|
|
|
#ifndef CPUBINARY_HPP_
|
|
#define CPUBINARY_HPP_
|
|
|
|
#include "top.hpp"
|
|
#include "device/device.hpp"
|
|
#include "device/cpu/cpudevice.hpp"
|
|
#include "elf/elf.hpp"
|
|
|
|
//! \namespace cpu CPU Device Implementation
|
|
namespace cpu {
|
|
|
|
class Device;
|
|
class Program;
|
|
|
|
//! \class CPU binary
|
|
class ClBinary : public device::ClBinary {
|
|
public:
|
|
//! Constructor
|
|
ClBinary(const Device& dev) : device::ClBinary(dev) {}
|
|
|
|
//! Destructor
|
|
~ClBinary() {}
|
|
|
|
//! Loads x86 executable code
|
|
bool loadX86(Program& prorgam, //!< CPU Program object
|
|
std::string& dllName, //!< Dll name of the CPU binary
|
|
bool& hasDLL //!< indicate if the OCL binary has DLL
|
|
);
|
|
|
|
//! Stores x86 executable code
|
|
bool storeX86(Program& program, //!< CPU Program object
|
|
std::string& dllName //!< Dll name for the binary
|
|
);
|
|
|
|
//! Loads x86 executable in-memory code
|
|
bool loadX86JIT(Program& prorgam, //!< CPU Program object
|
|
bool& hasJITBin //!< indicate if the OCL binary has JIT binary
|
|
);
|
|
|
|
//! Stores x86 executable in-memory code
|
|
bool storeX86JIT(Program& program //!< CPU Program object
|
|
);
|
|
|
|
//! Set elf header information for CPU target
|
|
bool setElfTarget() {
|
|
uint32_t target = dev().settings().cpuFeatures_;
|
|
assert(((0xFFFF8000 & target) == 0) && "ASIC target ID >= 2^15");
|
|
uint16_t elf_target = (uint16_t)(0x7FFF & target);
|
|
return elfOut()->setTarget(elf_target, amd::OclElf::CPU_PLATFORM);
|
|
}
|
|
|
|
bool storeX86Asm(const char* buffer, size_t size);
|
|
|
|
private:
|
|
enum FeatureCheckResult { fcERROR, fcRECOMPILE, fcOK };
|
|
|
|
FeatureCheckResult checkFeatures();
|
|
|
|
//! Disable default copy constructor
|
|
ClBinary(const ClBinary&);
|
|
|
|
//! Disable default operator=
|
|
ClBinary& operator=(const ClBinary&);
|
|
|
|
//! Returns the GPU device for this object
|
|
const Device& dev() { return static_cast<const Device&>(dev_); }
|
|
};
|
|
|
|
} // namespace cpu
|
|
|
|
#endif // CPUBINARY_HPP_
|