P4 to Git Change 1558704 by gandryey@gera-w8 on 2018/05/23 17:20:01
SWDEV-79445 - OCL generic changes and code clean-up - ABI clean-up. Stage 1: Separate kernel arguments and OCL objects. OCL objects will be passed in the new arrays of mem objects, samplers and device queue objects. The kernel arguments will contain GPU virtual addresses. http://ocltc.amd.com/reviews/r/14881/ Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_program.cpp#48 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#25 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#302 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#129 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#323 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#128 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.hpp#51 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#417 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#23 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#50 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.hpp#7 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#97 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.cpp#22 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.hpp#9 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#28 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.hpp#12 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#51 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#86 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.cpp#26 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.hpp#20 edit
Цей коміт міститься в:
@@ -1534,18 +1534,18 @@ RUNTIME_ENTRY(cl_int, clSetKernelArg,
|
||||
return CL_INVALID_ARG_INDEX;
|
||||
}
|
||||
|
||||
as_amd(kernel)->parameters().reset(static_cast<size_t>(arg_index));
|
||||
|
||||
const amd::KernelParameterDescriptor& desc = signature.at(arg_index);
|
||||
const bool is_local = desc.size_ == 0;
|
||||
if (((arg_value == NULL) && !is_local && (desc.type_ != T_POINTER)) ||
|
||||
((arg_value != NULL) && is_local)) {
|
||||
as_amd(kernel)->parameters().reset(static_cast<size_t>(arg_index));
|
||||
return CL_INVALID_ARG_VALUE;
|
||||
}
|
||||
if (!is_local && (desc.type_ == T_POINTER) && (arg_value != NULL)) {
|
||||
cl_mem memObj = *static_cast<const cl_mem*>(arg_value);
|
||||
amd::RuntimeObject* pObject = as_amd(memObj);
|
||||
if (NULL != memObj && amd::RuntimeObject::ObjectTypeMemory != pObject->objectType()) {
|
||||
as_amd(kernel)->parameters().reset(static_cast<size_t>(arg_index));
|
||||
return CL_INVALID_MEM_OBJECT;
|
||||
}
|
||||
} else if ((desc.type_ == T_SAMPLER) && !is_valid(*static_cast<const cl_sampler*>(arg_value))) {
|
||||
@@ -1553,13 +1553,16 @@ RUNTIME_ENTRY(cl_int, clSetKernelArg,
|
||||
} else if (desc.type_ == T_QUEUE) {
|
||||
cl_command_queue queue = *static_cast<const cl_command_queue*>(arg_value);
|
||||
if (!is_valid(queue)) {
|
||||
as_amd(kernel)->parameters().reset(static_cast<size_t>(arg_index));
|
||||
return CL_INVALID_DEVICE_QUEUE;
|
||||
}
|
||||
if (NULL == as_amd(queue)->asDeviceQueue()) {
|
||||
as_amd(kernel)->parameters().reset(static_cast<size_t>(arg_index));
|
||||
return CL_INVALID_DEVICE_QUEUE;
|
||||
}
|
||||
}
|
||||
if ((!is_local && (arg_size != desc.size_)) || (is_local && (arg_size == 0))) {
|
||||
as_amd(kernel)->parameters().reset(static_cast<size_t>(arg_index));
|
||||
return CL_INVALID_ARG_SIZE;
|
||||
}
|
||||
|
||||
|
||||
@@ -908,11 +908,10 @@ RUNTIME_ENTRY(cl_int, clSetKernelArgSVMPointer,
|
||||
const amd::KernelParameterDescriptor& desc = signature.at(arg_index);
|
||||
if (desc.type_ != T_POINTER ||
|
||||
!(desc.addressQualifier_ & (CL_KERNEL_ARG_ADDRESS_GLOBAL | CL_KERNEL_ARG_ADDRESS_CONSTANT))) {
|
||||
as_amd(kernel)->parameters().reset(static_cast<size_t>(arg_index));
|
||||
return CL_INVALID_ARG_VALUE;
|
||||
}
|
||||
|
||||
as_amd(kernel)->parameters().reset(static_cast<size_t>(arg_index));
|
||||
|
||||
//! @todo We need to check that the alignment of \a arg_value. For instance,
|
||||
// if the argument is of type 'global float4*', then \a arg_value must be
|
||||
// aligned to sizeof(float4*). Note that desc.size_ contains the size of the
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача