Skip to content

Commit

Permalink
Stabilize XML scrapping order
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Aug 14, 2024
1 parent 74b804b commit 829db0f
Show file tree
Hide file tree
Showing 9 changed files with 2,110 additions and 2,108 deletions.
10 changes: 6 additions & 4 deletions DataScraping/XML/ItemSources.pas
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,24 @@ implementation

uses '../../POCGL_Utils';

var source_create_callbacks: Action;
var source_create_callbacks := new Dictionary<string, Action>;

static constructor ItemSource<TSelf,TSourceName,TItem>.Create;
begin
// Println(TypeToTypeName(typeof(TSelf)));

source_create_callbacks += ()->
source_create_callbacks.Add(typeof(TSelf).Name, ()->
foreach var s in all_sources.Values do
s.GetItem;
s.GetItem
);

end;

procedure CreateAll;
begin
Otp($'Constructing named items');
source_create_callbacks();
foreach var kvp in source_create_callbacks.OrderBy(kvp->kvp.Key) do
kvp.Value();
end;

end.
8 changes: 4 additions & 4 deletions DataScraping/XML/NamedItems.pas
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
Result := ValueTuple.Create(item.NameApi, item.NameLocal);
end);

foreach var g in suffix_less_lookup do
foreach var g in suffix_less_lookup.OrderBy(g->g.Key) do
begin
var (api, lname) := g.Key;
var root := g.SingleOrDefault(item->(item as NamedItem<TSelf, TName>).NameSuffix=nil);
Expand All @@ -330,16 +330,16 @@
var cap := new TODO_2849<TSelf>(g.First, can_be_alias);
if g.Skip(1).Any(cap.lambda) then
begin
log_merge_fails.Otp($'Unable to merge items: {g.JoinToString}');
log_merge_fails.Otp($'Unable to merge items: {g.Order.JoinToString}');
continue;
end;
if copy_without_suffix=nil then
raise new NotImplementedException($'{TypeToTypeName(typeof(TSelf))} did not implement merge root creator, needed for: {g.JoinToString}');
raise new NotImplementedException($'{TypeToTypeName(typeof(TSelf))} did not implement merge root creator, needed for: {g.Order.JoinToString}');
root := copy_without_suffix(api, lname, g.First);
if root=nil then raise nil;
end;

if root<>nil then foreach var item in g do
if root<>nil then foreach var item in g.Order do
begin
if item=root then continue;
if not can_be_alias(item, root, log_merge_fails.Otp) then
Expand Down
42 changes: 21 additions & 21 deletions DataScraping/XML/OpenCL/merge_fails.log
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
Unable to merge Enum [cl::DEVICE_PARTITION_FAILED + EXT] => Enum [cl::DEVICE_PARTITION_FAILED + /core\]
Unable to merge items: Enum [cl::MEM_RESERVED0 + ARM] Enum [cl::MEM_RESERVED0 + QCOM]
Unable to merge items: Enum [cl::MEM_RESERVED1 + ARM] Enum [cl::MEM_RESERVED1 + QCOM]
Unable to merge items: Enum [cl::MEM_RESERVED2 + ARM] Enum [cl::MEM_RESERVED2 + QCOM]
Unable to merge items: Enum [cl::MEM_RESERVED3 + ARM] Enum [cl::MEM_RESERVED3 + QCOM]
Unable to merge Enum [cl::COMMAND_SVM_FREE + ARM] => Enum [cl::COMMAND_SVM_FREE + /core\]
Unable to merge Enum [cl::COMMAND_SVM_MAP + ARM] => Enum [cl::COMMAND_SVM_MAP + /core\]
Unable to merge Enum [cl::COMMAND_SVM_MEMCPY + ARM] => Enum [cl::COMMAND_SVM_MEMCPY + /core\]
Unable to merge Enum [cl::COMMAND_SVM_MEMFILL + ARM] => Enum [cl::COMMAND_SVM_MEMFILL + /core\]
Unable to merge Enum [cl::COMMAND_SVM_UNMAP + ARM] => Enum [cl::COMMAND_SVM_UNMAP + /core\]
Unable to merge Enum [cl::DEVICE_MAX_WORK_GROUP_SIZE + AMD] => Enum [cl::DEVICE_MAX_WORK_GROUP_SIZE + /core\]
Unable to merge Enum [cl::DEVICE_PARENT_DEVICE + EXT] => Enum [cl::DEVICE_PARENT_DEVICE + /core\]
Unable to merge Enum [cl::DEVICE_PARTITION_BY_AFFINITY_DOMAIN + EXT] => Enum [cl::DEVICE_PARTITION_BY_AFFINITY_DOMAIN + /core\]
Unable to merge Enum [cl::DEVICE_PARTITION_BY_COUNTS + EXT] => Enum [cl::DEVICE_PARTITION_BY_COUNTS + /core\]
Unable to merge Enum [cl::DEVICE_PARTITION_EQUALLY + EXT] => Enum [cl::DEVICE_PARTITION_EQUALLY + /core\]
Unable to merge Enum [cl::DEVICE_PARTITION_FAILED + EXT] => Enum [cl::DEVICE_PARTITION_FAILED + /core\]
Unable to merge Enum [cl::DEVICE_REFERENCE_COUNT + EXT] => Enum [cl::DEVICE_REFERENCE_COUNT + /core\]
Unable to merge Enum [cl::DEVICE_SVM_CAPABILITIES + ARM] => Enum [cl::DEVICE_SVM_CAPABILITIES + /core\]
Unable to merge Enum [cl::DEVICE_PARTITION_EQUALLY + EXT] => Enum [cl::DEVICE_PARTITION_EQUALLY + /core\]
Unable to merge Enum [cl::DEVICE_PARTITION_BY_COUNTS + EXT] => Enum [cl::DEVICE_PARTITION_BY_COUNTS + /core\]
Unable to merge Enum [cl::DEVICE_PARTITION_BY_AFFINITY_DOMAIN + EXT] => Enum [cl::DEVICE_PARTITION_BY_AFFINITY_DOMAIN + /core\]
Unable to merge Enum [cl::MEM_USES_SVM_POINTER + ARM] => Enum [cl::MEM_USES_SVM_POINTER + /core\]
Unable to merge Enum [cl::KERNEL_EXEC_INFO_SVM_PTRS + ARM] => Enum [cl::KERNEL_EXEC_INFO_SVM_PTRS + /core\]
Unable to merge Enum [cl::KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM + ARM] => Enum [cl::KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM + /core\]
Unable to merge Enum [cl::COMMAND_SVM_FREE + ARM] => Enum [cl::COMMAND_SVM_FREE + /core\]
Unable to merge Enum [cl::COMMAND_SVM_MEMCPY + ARM] => Enum [cl::COMMAND_SVM_MEMCPY + /core\]
Unable to merge Enum [cl::COMMAND_SVM_MEMFILL + ARM] => Enum [cl::COMMAND_SVM_MEMFILL + /core\]
Unable to merge Enum [cl::COMMAND_SVM_MAP + ARM] => Enum [cl::COMMAND_SVM_MAP + /core\]
Unable to merge Enum [cl::COMMAND_SVM_UNMAP + ARM] => Enum [cl::COMMAND_SVM_UNMAP + /core\]
Unable to merge Enum [cl::KERNEL_EXEC_INFO_SVM_PTRS + ARM] => Enum [cl::KERNEL_EXEC_INFO_SVM_PTRS + /core\]
Unable to merge items: Enum [cl::MEM_ALLOC_FLAGS + IMG] Enum [cl::MEM_ALLOC_FLAGS + INTEL]
Unable to merge items: Enum [cl::MEM_RESERVED0 + ARM] Enum [cl::MEM_RESERVED0 + QCOM]
Unable to merge items: Enum [cl::MEM_RESERVED1 + ARM] Enum [cl::MEM_RESERVED1 + QCOM]
Unable to merge items: Enum [cl::MEM_RESERVED2 + ARM] Enum [cl::MEM_RESERVED2 + QCOM]
Unable to merge items: Enum [cl::MEM_RESERVED3 + ARM] Enum [cl::MEM_RESERVED3 + QCOM]
Unable to merge Enum [cl::MEM_USES_SVM_POINTER + ARM] => Enum [cl::MEM_USES_SVM_POINTER + /core\]
No castable_to in common: [BasicType [uint64_t]] vs [BasicType [intptr_t]]
Unable to merge Group [cl::DevicePartitionProperty + ext] => Group [cl::DevicePartitionProperty + /core\]
No enums in common
Unable to merge items: Group [cl::MemAllocFlags + img] Group [cl::MemAllocFlags + intel]
Unable to merge Group [cl::KernelExecInfo + arm] => Group [cl::KernelExecInfo + /core\]
No enums in common
Unable to merge Group [cl::MemProperties + intel] => Group [cl::MemProperties + /core\]
Unable to merge items: Group [cl::MemAllocFlags + img] Group [cl::MemAllocFlags + intel]
No enums in common
Unable to merge Group [cl::MemInfo + intel] => Group [cl::MemInfo + /core\]
No enums in common
Unable to merge Group [cl::KernelExecInfo + arm] => Group [cl::KernelExecInfo + /core\]
Unable to merge Group [cl::MemProperties + intel] => Group [cl::MemProperties + /core\]
Different param#2
Unable to merge Func [cl::CreateBufferWithProperties + INTEL] => Func [cl::CreateBufferWithProperties + /core\]
Different param#3
Unable to merge Func [cl::CreateCommandQueueWithProperties + KHR] => Func [cl::CreateCommandQueueWithProperties + /core\]
Different param#2
Unable to merge Func [cl::CreateSubDevices + EXT] => Func [cl::CreateSubDevices + /core\]
Different param#2
Unable to merge Func [cl::SVMAlloc + ARM] => Func [cl::SVMAlloc + /core\]
Different param#2
Unable to merge Func [cl::SetKernelExecInfo + ARM] => Func [cl::SetKernelExecInfo + /core\]
Different param#2
Unable to merge Func [cl::CreateBufferWithProperties + INTEL] => Func [cl::CreateBufferWithProperties + /core\]
Unable to merge Func [cl::SVMAlloc + ARM] => Func [cl::SVMAlloc + /core\]
60 changes: 30 additions & 30 deletions DataScraping/XML/OpenCL/missing_alias.log
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
Enum [cl::VERSION_MAJOR_BITS + KHR] => Enum [cl::VERSION_MAJOR_BITS + /core\]
Enum [cl::VERSION_MINOR_BITS + KHR] => Enum [cl::VERSION_MINOR_BITS + /core\]
Enum [cl::VERSION_PATCH_BITS + KHR] => Enum [cl::VERSION_PATCH_BITS + /core\]
Enum [cl::NAME_VERSION_MAX_NAME_SIZE + KHR] => Enum [cl::NAME_VERSION_MAX_NAME_SIZE + /core\]
Enum [cl::PARTITION_BY_NAMES_LIST_END + EXT] => Enum [cl::PARTITION_BY_NAMES_LIST_END + /core\]
Enum [cl::PARTITION_BY_NAMES_LIST_END + INTEL] => Enum [cl::PARTITION_BY_NAMES_LIST_END + /core\]
Enum [cl::DEVICE_BUILT_IN_KERNELS_WITH_VERSION + KHR] => Enum [cl::DEVICE_BUILT_IN_KERNELS_WITH_VERSION + /core\]
Enum [cl::DEVICE_EXTENSIONS_WITH_VERSION + KHR] => Enum [cl::DEVICE_EXTENSIONS_WITH_VERSION + /core\]
Enum [cl::DEVICE_IL_VERSION + KHR] => Enum [cl::DEVICE_IL_VERSION + /core\]
Enum [cl::DEVICE_ILS_WITH_VERSION + KHR] => Enum [cl::DEVICE_ILS_WITH_VERSION + /core\]
Enum [cl::DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT + KHR] => Enum [cl::DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT + /core\]
Enum [cl::DEVICE_IMAGE_PITCH_ALIGNMENT + KHR] => Enum [cl::DEVICE_IMAGE_PITCH_ALIGNMENT + /core\]
Enum [cl::DEVICE_NUMERIC_VERSION + KHR] => Enum [cl::DEVICE_NUMERIC_VERSION + /core\]
Enum [cl::DEVICE_PARTITION_BY_NAMES + EXT] => Enum [cl::DEVICE_PARTITION_BY_NAMES + /core\]
Enum [cl::DEVICE_PARTITION_BY_NAMES + INTEL] => Enum [cl::DEVICE_PARTITION_BY_NAMES + /core\]
Enum [cl::DEVICE_SVM_ATOMICS + ARM] => Enum [cl::DEVICE_SVM_ATOMICS + /core\]
Enum [cl::DEVICE_SVM_COARSE_GRAIN_BUFFER + ARM] => Enum [cl::DEVICE_SVM_COARSE_GRAIN_BUFFER + /core\]
Enum [cl::DEVICE_SVM_FINE_GRAIN_BUFFER + ARM] => Enum [cl::DEVICE_SVM_FINE_GRAIN_BUFFER + /core\]
Enum [cl::DEVICE_SVM_FINE_GRAIN_SYSTEM + ARM] => Enum [cl::DEVICE_SVM_FINE_GRAIN_SYSTEM + /core\]
Enum [cl::DEVICE_SVM_ATOMICS + ARM] => Enum [cl::DEVICE_SVM_ATOMICS + /core\]
Enum [cl::MEM_SVM_FINE_GRAIN_BUFFER + ARM] => Enum [cl::MEM_SVM_FINE_GRAIN_BUFFER + /core\]
Enum [cl::KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE + KHR] => Enum [cl::KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE + /core\]
Enum [cl::KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE + KHR] => Enum [cl::KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE + /core\]
Enum [cl::MEM_SVM_ATOMICS + ARM] => Enum [cl::MEM_SVM_ATOMICS + /core\]
Enum [cl::MEM_SVM_FINE_GRAIN_BUFFER + ARM] => Enum [cl::MEM_SVM_FINE_GRAIN_BUFFER + /core\]
Enum [cl::MIGRATE_MEM_OBJECT_HOST + EXT] => Enum [cl::MIGRATE_MEM_OBJECT_HOST + /core\]
Enum [cl::PLATFORM_NUMERIC_VERSION + KHR] => Enum [cl::PLATFORM_NUMERIC_VERSION + /core\]
Enum [cl::NAME_VERSION_MAX_NAME_SIZE + KHR] => Enum [cl::NAME_VERSION_MAX_NAME_SIZE + /core\]
Enum [cl::NV21 + IMG] => Enum [cl::NV21 + /core\]
Enum [cl::PARTITION_BY_NAMES_LIST_END + EXT] => Enum [cl::PARTITION_BY_NAMES_LIST_END + /core\]
Enum [cl::PARTITION_BY_NAMES_LIST_END + INTEL] => Enum [cl::PARTITION_BY_NAMES_LIST_END + /core\]
Enum [cl::PLATFORM_EXTENSIONS_WITH_VERSION + KHR] => Enum [cl::PLATFORM_EXTENSIONS_WITH_VERSION + /core\]
Enum [cl::DEVICE_IMAGE_PITCH_ALIGNMENT + KHR] => Enum [cl::DEVICE_IMAGE_PITCH_ALIGNMENT + /core\]
Enum [cl::DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT + KHR] => Enum [cl::DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT + /core\]
Enum [cl::DEVICE_IL_VERSION + KHR] => Enum [cl::DEVICE_IL_VERSION + /core\]
Enum [cl::DEVICE_NUMERIC_VERSION + KHR] => Enum [cl::DEVICE_NUMERIC_VERSION + /core\]
Enum [cl::DEVICE_EXTENSIONS_WITH_VERSION + KHR] => Enum [cl::DEVICE_EXTENSIONS_WITH_VERSION + /core\]
Enum [cl::DEVICE_ILS_WITH_VERSION + KHR] => Enum [cl::DEVICE_ILS_WITH_VERSION + /core\]
Enum [cl::DEVICE_BUILT_IN_KERNELS_WITH_VERSION + KHR] => Enum [cl::DEVICE_BUILT_IN_KERNELS_WITH_VERSION + /core\]
Enum [cl::SAMPLER_MIP_FILTER_MODE + KHR] => Enum [cl::SAMPLER_MIP_FILTER_MODE + /core\]
Enum [cl::SAMPLER_LOD_MIN + KHR] => Enum [cl::SAMPLER_LOD_MIN + /core\]
Enum [cl::SAMPLER_LOD_MAX + KHR] => Enum [cl::SAMPLER_LOD_MAX + /core\]
Enum [cl::PLATFORM_NUMERIC_VERSION + KHR] => Enum [cl::PLATFORM_NUMERIC_VERSION + /core\]
Enum [cl::PROGRAM_IL + KHR] => Enum [cl::PROGRAM_IL + /core\]
Enum [cl::KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE + KHR] => Enum [cl::KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE + /core\]
Enum [cl::KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE + KHR] => Enum [cl::KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE + /core\]
Enum [cl::DEVICE_PARTITION_BY_NAMES + EXT] => Enum [cl::DEVICE_PARTITION_BY_NAMES + /core\]
Enum [cl::DEVICE_PARTITION_BY_NAMES + INTEL] => Enum [cl::DEVICE_PARTITION_BY_NAMES + /core\]
Enum [cl::NV21 + IMG] => Enum [cl::NV21 + /core\]
Enum [cl::SAMPLER_LOD_MAX + KHR] => Enum [cl::SAMPLER_LOD_MAX + /core\]
Enum [cl::SAMPLER_LOD_MIN + KHR] => Enum [cl::SAMPLER_LOD_MIN + /core\]
Enum [cl::SAMPLER_MIP_FILTER_MODE + KHR] => Enum [cl::SAMPLER_MIP_FILTER_MODE + /core\]
Enum [cl::VERSION_MAJOR_BITS + KHR] => Enum [cl::VERSION_MAJOR_BITS + /core\]
Enum [cl::VERSION_MINOR_BITS + KHR] => Enum [cl::VERSION_MINOR_BITS + /core\]
Enum [cl::VERSION_PATCH_BITS + KHR] => Enum [cl::VERSION_PATCH_BITS + /core\]
Enum [cl::YV12 + IMG] => Enum [cl::YV12 + /core\]
Group [cl::DeviceSvmCapabilities + arm] => Group [cl::DeviceSvmCapabilities + /core\]
Group [cl::SvmMemFlags + arm] => Group [cl::SvmMemFlags + /core\]
Group [cl::MemMigrationFlags + ext] => Group [cl::MemMigrationFlags + /core\]
Group [cl::SvmMemFlags + arm] => Group [cl::SvmMemFlags + /core\]
Struct [cl::name_version + khr] => Struct [cl::name_version + /core\]
Func [cl::CreateProgramWithIL + KHR] => Func [cl::CreateProgramWithIL + /core\]
Func [cl::ReleaseDevice + EXT] => Func [cl::ReleaseDevice + /core\]
Func [cl::RetainDevice + EXT] => Func [cl::RetainDevice + /core\]
Func [cl::GetKernelSubGroupInfo + KHR] => Func [cl::GetKernelSubGroupInfo + /core\]
Func [cl::SVMFree + ARM] => Func [cl::SVMFree + /core\]
Func [cl::EnqueueSVMFree + ARM] => Func [cl::EnqueueSVMFree + /core\]
Func [cl::EnqueueSVMMap + ARM] => Func [cl::EnqueueSVMMap + /core\]
Func [cl::EnqueueSVMMemcpy + ARM] => Func [cl::EnqueueSVMMemcpy + /core\]
Func [cl::EnqueueSVMMemFill + ARM] => Func [cl::EnqueueSVMMemFill + /core\]
Func [cl::EnqueueSVMMap + ARM] => Func [cl::EnqueueSVMMap + /core\]
Func [cl::EnqueueSVMUnmap + ARM] => Func [cl::EnqueueSVMUnmap + /core\]
Func [cl::GetKernelSubGroupInfo + KHR] => Func [cl::GetKernelSubGroupInfo + /core\]
Func [cl::ReleaseDevice + EXT] => Func [cl::ReleaseDevice + /core\]
Func [cl::RetainDevice + EXT] => Func [cl::RetainDevice + /core\]
Func [cl::SetKernelArgSVMPointer + ARM] => Func [cl::SetKernelArgSVMPointer + /core\]
Func [cl::SVMFree + ARM] => Func [cl::SVMFree + /core\]
2 changes: 1 addition & 1 deletion DataScraping/XML/OpenCL/xml.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Extension [cl::loader_layers + /core\]: No suffix
Extension [cl::loader_info + /core\]: No suffix
Enum [cl::ACCELERATOR_DESCRIPTOR + INTEL]: "void[]" extra type
Enum [cl::DEVICE_PROFILING_TIMER_OFFSET + AMD]: "void[]" extra type
Enum [cl::DEVICE_TOPOLOGY + AMD]: "void[]" extra type
Enum [cl::DEVICE_BOARD_NAME + AMD]: "void[]" extra type
Expand All @@ -23,4 +24,3 @@ Enum [cl::DEVICE_PREFERRED_CONSTANT_BUFFER_SIZE + AMD]: "void[]" extra type
Enum [cl::DEVICE_PCIE_ID + AMD]: "void[]" extra type
Enum [cl::DEVICE_EXT_MEM_PADDING_IN_BYTES + QCOM]: "void[]" extra type
Enum [cl::DEVICE_PAGE_SIZE + QCOM]: "void[]" extra type
Enum [cl::ACCELERATOR_DESCRIPTOR + INTEL]: "void[]" extra type
Loading

0 comments on commit 829db0f

Please sign in to comment.