P4 to Git Change 1599157 by gandryey@gera-ocl-lc on 2018/08/28 17:11:04
SWDEV-79445 - OCL generic changes and code clean-up - Add devkerenle.cpp/hpp files for device::Kernel object - Move generic code for the arguments setup from the device layer to the abstraction layer - Update ROCr and PAL paths to utilize the generic logic for the arguments setup Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#226 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#313 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.hpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#328 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#130 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#61 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#20 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#40 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.hpp#24 edit ... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#51 edit
This commit is contained in:
@@ -585,86 +585,6 @@ Settings::Settings() {
|
||||
//!< concurrent Virtual GPUs for default
|
||||
}
|
||||
|
||||
bool Kernel::createSignature(
|
||||
const parameters_t& params, uint32_t numParameters,
|
||||
uint32_t version) {
|
||||
std::stringstream attribs;
|
||||
if (workGroupInfo_.compileSize_[0] != 0) {
|
||||
attribs << "reqd_work_group_size(";
|
||||
for (size_t i = 0; i < 3; ++i) {
|
||||
if (i != 0) {
|
||||
attribs << ",";
|
||||
}
|
||||
|
||||
attribs << workGroupInfo_.compileSize_[i];
|
||||
}
|
||||
attribs << ")";
|
||||
}
|
||||
if (workGroupInfo_.compileSizeHint_[0] != 0) {
|
||||
attribs << " work_group_size_hint(";
|
||||
for (size_t i = 0; i < 3; ++i) {
|
||||
if (i != 0) {
|
||||
attribs << ",";
|
||||
}
|
||||
|
||||
attribs << workGroupInfo_.compileSizeHint_[i];
|
||||
}
|
||||
attribs << ")";
|
||||
}
|
||||
|
||||
if (!workGroupInfo_.compileVecTypeHint_.empty()) {
|
||||
attribs << " vec_type_hint(" << workGroupInfo_.compileVecTypeHint_ << ")";
|
||||
}
|
||||
|
||||
// Destroy old signature if it was allocated before
|
||||
// (offline devices path)
|
||||
delete signature_;
|
||||
signature_ = new amd::KernelSignature(params, attribs.str(), numParameters, version);
|
||||
if (NULL != signature_) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Kernel::~Kernel() { delete signature_; }
|
||||
|
||||
std::string Kernel::openclMangledName(const std::string& name) {
|
||||
const oclBIFSymbolStruct* bifSym = findBIF30SymStruct(symOpenclKernel);
|
||||
assert(bifSym && "symbol not found");
|
||||
return std::string("&") + bifSym->str[bif::PRE] + name + bifSym->str[bif::POST];
|
||||
}
|
||||
|
||||
void Memory::saveMapInfo(const void* mapAddress, const amd::Coord3D origin,
|
||||
const amd::Coord3D region, uint mapFlags, bool entire,
|
||||
amd::Image* baseMip) {
|
||||
// Map/Unmap must be serialized.
|
||||
amd::ScopedLock lock(owner()->lockMemoryOps());
|
||||
|
||||
WriteMapInfo info = {};
|
||||
WriteMapInfo* pInfo = &info;
|
||||
auto it = writeMapInfo_.find(mapAddress);
|
||||
if (it != writeMapInfo_.end()) {
|
||||
LogWarning("Double map of the same or overlapped region!");
|
||||
pInfo = &it->second;
|
||||
}
|
||||
|
||||
if (mapFlags & (CL_MAP_WRITE | CL_MAP_WRITE_INVALIDATE_REGION)) {
|
||||
pInfo->origin_ = origin;
|
||||
pInfo->region_ = region;
|
||||
pInfo->entire_ = entire;
|
||||
pInfo->unmapWrite_ = true;
|
||||
}
|
||||
if (mapFlags & CL_MAP_READ) {
|
||||
pInfo->unmapRead_ = true;
|
||||
}
|
||||
pInfo->baseMip_ = baseMip;
|
||||
|
||||
// Insert into the map if it's the first region
|
||||
if (++pInfo->count_ == 1) {
|
||||
writeMapInfo_.insert({mapAddress, info});
|
||||
}
|
||||
}
|
||||
|
||||
Program::Program(amd::Device& device)
|
||||
: device_(device),
|
||||
type_(TYPE_NONE),
|
||||
|
||||
Reference in New Issue
Block a user