mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-10 15:12:56 +08:00
refactor: move add kernel arg stateful buffer to experimental implementation
Related-To: NEO-10492 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0c15dcbd05
commit
b62813297d
@@ -201,25 +201,9 @@ ze_result_t Variable::addKernelArgUsage(const NEO::ArgDescriptor &kernelArg, Ind
|
||||
}
|
||||
}
|
||||
|
||||
if (sshOffset != undefined<SurfaceStateHeapOffset>) {
|
||||
if (NEO::isValidOffset(arg.bufferOffset)) {
|
||||
if (NEO::isValidOffset(arg.bindful)) {
|
||||
bufferUsages.bindful.push_back(sshOffset + arg.bindful);
|
||||
} else if (NEO::isValidOffset(arg.bindless)) {
|
||||
bufferUsages.bindless.push_back(iohOffset + arg.bindless);
|
||||
} else {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
bufferUsages.bufferOffset.push_back(iohOffset + arg.bufferOffset);
|
||||
} else {
|
||||
if (NEO::isValidOffset(arg.bindful)) {
|
||||
bufferUsages.bindfulWithoutOffset.push_back(sshOffset + arg.bindful);
|
||||
} else if (NEO::isValidOffset(arg.bindless)) {
|
||||
bufferUsages.bindlessWithoutOffset.push_back(iohOffset + arg.bindless);
|
||||
} else {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
}
|
||||
auto ret = addKernelArgUsageStatefulBuffer(kernelArg, iohOffset, sshOffset);
|
||||
if (ret != ZE_RESULT_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
desc.size = sizeof(void *);
|
||||
|
||||
@@ -280,6 +280,7 @@ struct Variable : public VariableHandle {
|
||||
CommandBufferOffset walkerCmdOffset, MutableComputeWalker *mutableComputeWalker, bool inlineData);
|
||||
ze_result_t addKernelArgUsageImmediateAsContinuous(const NEO::ArgDescriptor &kernelArg, IndirectObjectHeapOffset iohOffset, IndirectObjectHeapOffset iohFullOffset,
|
||||
CommandBufferOffset walkerCmdOffset, MutableComputeWalker *mutableComputeWalker, bool inlineData);
|
||||
ze_result_t addKernelArgUsageStatefulBuffer(const NEO::ArgDescriptor &kernelArg, IndirectObjectHeapOffset iohOffset, SurfaceStateHeapOffset sshOffset);
|
||||
void handleFlags(uint32_t flags);
|
||||
ze_result_t selectImmediateSetValueHandler(size_t size, const void *argVal);
|
||||
ze_result_t selectImmediateAddKernelArgUsageHandler(const NEO::ArgDescriptor &kernelArg, IndirectObjectHeapOffset iohOffset, IndirectObjectHeapOffset iohFullOffset,
|
||||
|
||||
@@ -195,4 +195,29 @@ void Variable::setDescExperimentalValues(const InterfaceVariableDescriptor *ifac
|
||||
}
|
||||
}
|
||||
|
||||
ze_result_t Variable::addKernelArgUsageStatefulBuffer(const NEO::ArgDescriptor &kernelArg, IndirectObjectHeapOffset iohOffset, SurfaceStateHeapOffset sshOffset) {
|
||||
const auto &arg = kernelArg.as<NEO::ArgDescPointer>();
|
||||
if (sshOffset != undefined<SurfaceStateHeapOffset>) {
|
||||
if (NEO::isValidOffset(arg.bufferOffset)) {
|
||||
if (NEO::isValidOffset(arg.bindful)) {
|
||||
bufferUsages.bindful.push_back(sshOffset + arg.bindful);
|
||||
} else if (NEO::isValidOffset(arg.bindless)) {
|
||||
bufferUsages.bindless.push_back(iohOffset + arg.bindless);
|
||||
} else {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
bufferUsages.bufferOffset.push_back(iohOffset + arg.bufferOffset);
|
||||
} else {
|
||||
if (NEO::isValidOffset(arg.bindful)) {
|
||||
bufferUsages.bindfulWithoutOffset.push_back(sshOffset + arg.bindful);
|
||||
} else if (NEO::isValidOffset(arg.bindless)) {
|
||||
bufferUsages.bindlessWithoutOffset.push_back(iohOffset + arg.bindless);
|
||||
} else {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
} // namespace L0::MCL
|
||||
|
||||
Reference in New Issue
Block a user