P4 to Git Change 1567428 by gandryey@gera-w8 on 2018/06/12 18:39:23
SWDEV-79445 - OCL generic changes and code clean-up
- Optimize setup of kernel arguments. Stage 2.
- Add HW ABI support in the abstraction layer
- Remove arguments parsing loop from the kernel launch. Memory processing will be responsible for dependency tracking and patching of arguments.
http://ocltc.amd.com/reviews/r/15122/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#221 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#307 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#325 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#24 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#53 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#17 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.hpp#9 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#107 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#53 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#36 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.hpp#23 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#95 edit
[ROCm/clr commit: 1be400ff01]
This commit is contained in:
@@ -943,24 +943,30 @@ static void setArgument(amd::Kernel* kernel, size_t index, size_t size, const vo
|
||||
|
||||
uint32_t uint32_value = 0;
|
||||
uint64_t uint64_value = 0;
|
||||
size_t argSize = desc.size_;
|
||||
|
||||
if (desc.type_ == T_POINTER && desc.size_ != 0) {
|
||||
if ((value == NULL) || (static_cast<const cl_mem*>(value) == NULL)) {
|
||||
LP64_SWITCH(uint32_value, uint64_value) = 0;
|
||||
reinterpret_cast<Memory**>(kernel->parameters().values() +
|
||||
kernel->parameters().memoryObjOffset())[desc.info_.arrayIndex_] = nullptr;
|
||||
} else {
|
||||
// convert cl_mem to amd::Memory*, return false if invalid.
|
||||
LP64_SWITCH(uint32_value, uint64_value) = static_cast<uintptr_t>((
|
||||
*static_cast<Memory* const*>(value))->vmAddress());
|
||||
*static_cast<Memory* const*>(value))->virtualAddress());
|
||||
reinterpret_cast<Memory**>(kernel->parameters().values() +
|
||||
kernel->parameters().memoryObjOffset())[desc.info_.arrayIndex_] =
|
||||
*static_cast<Memory* const*>(value);
|
||||
// Note: Special case for image SRD, which is 64 bit always
|
||||
if (LP64_SWITCH(true, false) &&
|
||||
(desc.info_.oclObject_ == amd::KernelParameterDescriptor::ImageObject)) {
|
||||
uint64_value = uint32_value;
|
||||
argSize = sizeof(uint64_t);
|
||||
}
|
||||
}
|
||||
} else if (desc.type_ == T_SAMPLER) {
|
||||
assert(false && "No sampler support in blit manager! Use internal samplers!");
|
||||
} else
|
||||
switch (desc.size_) {
|
||||
switch (argSize) {
|
||||
case 1:
|
||||
uint32_value = *static_cast<const uint8_t*>(value);
|
||||
break;
|
||||
@@ -977,7 +983,7 @@ static void setArgument(amd::Kernel* kernel, size_t index, size_t size, const vo
|
||||
break;
|
||||
}
|
||||
|
||||
switch (desc.size_) {
|
||||
switch (argSize) {
|
||||
case 0 /*local mem*/:
|
||||
*static_cast<size_t*>(param) = size;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user