2
0

P4 to Git Change 1329590 by gandryey@gera-w8 on 2016/10/20 18:27:28

SWDEV-86035 - Add PAL backend to OpenCL
	- Disable data segment load for internal blit kernels. It should affect V2 binaries only

	http://ocltc.amd.com/reviews/r/11630/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#9 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#7 edit


[ROCm/clr commit: abe89a3d9c]
Este cometimento está contido em:
foreman
2016-10-20 19:02:38 -04:00
ascendente 16e9dca0c7
cometimento f21a37f54e
2 ficheiros modificados com 18 adições e 6 eliminações
+8 -5
Ver ficheiro
@@ -28,7 +28,7 @@ HSAILProgram::HSAILProgram(Device& device)
, rawBinary_(nullptr)
, kernels_(nullptr)
, maxScratchRegs_(0)
, isNull_(false)
, flags_(0)
, executable_(nullptr)
, loaderContext_(this)
{
@@ -48,7 +48,7 @@ HSAILProgram::HSAILProgram(NullDevice& device)
, rawBinary_(nullptr)
, kernels_(nullptr)
, maxScratchRegs_(0)
, isNull_(true)
, flags_(0)
, executable_(nullptr)
, loaderContext_(this)
{
@@ -442,6 +442,9 @@ HSAILProgram::linkImpl(amd::option::Options* options)
aclType continueCompileFrom = ACL_TYPE_LLVMIR_BINARY;
bool finalize = true;
bool hsaLoad = true;
internal_ = (compileOptions_.find("-cl-internal-kernel") !=
std::string::npos) ? true : false;
// If !binaryElf_ then program must have been created using clCreateProgramWithBinary
if (!binaryElf_) {
continueCompileFrom = getNextCompilationStageFromBinary(options);
@@ -911,7 +914,7 @@ void* ORCAHSALoaderContext::GpuMemAlloc(size_t size, size_t align, bool zero) {
assert(size);
assert(align);
assert(sizeof(void*) == 8 || sizeof(void*) == 4);
if (program_->isNull()) {
if (program_->isNull() || program_->isInternal()) {
return new char[size];
}
@@ -937,7 +940,7 @@ bool ORCAHSALoaderContext::GpuMemCopy(void *dst, size_t offset, const void *src,
if (0 == size) {
return true;
}
if (program_->isNull()) {
if (program_->isNull() || program_->isInternal()) {
memcpy(reinterpret_cast<address>(dst) + offset, src, size);
return true;
}
@@ -949,7 +952,7 @@ bool ORCAHSALoaderContext::GpuMemCopy(void *dst, size_t offset, const void *src,
void ORCAHSALoaderContext::GpuMemFree(void *ptr, size_t size)
{
if (program_->isNull()) {
if (program_->isNull() || program_->isInternal()) {
delete[] reinterpret_cast<char*>(ptr);
}
else {
+10 -1
Ver ficheiro
@@ -178,6 +178,9 @@ public:
//! Returns TRUE if the program just compiled
bool isNull() const { return isNull_; }
//! Returns TRUE if the program used internally by runtime
bool isInternal() const { return internal_; }
//! Returns TRUE if the program contains static samplers
bool isStaticSampler() const { return (staticSamplers_.size() != 0); }
@@ -267,7 +270,13 @@ private:
Memory* kernels_; //!< Table with kernel object pointers
uint maxScratchRegs_; //!< Maximum number of scratch regs used in the program by individual kernel
std::list<Sampler*> staticSamplers_; //!< List od internal static samplers
bool isNull_; //!< Null program no memory allocations
union {
struct {
uint32_t isNull_ : 1; //!< Null program no memory allocations
uint32_t internal_ : 1; //!< Internal blit program
};
uint32_t flags_; //!< Program flags
};
amd::hsa::loader::Loader* loader_; //!< Loader object
amd::hsa::loader::Executable* executable_; //!< Executable for HSA Loader
ORCAHSALoaderContext loaderContext_; //!< Context for HSA Loader