From 4724bcc04c2f8088a985cfa8f996a542fa7699ed Mon Sep 17 00:00:00 2001 From: Sun Serega Date: Thu, 28 Dec 2023 13:30:09 +0200 Subject: [PATCH] Full repack --- .github/workflows/on commit.yaml | 2 +- DataScraping/Reps/OpenCL-Docs | 2 +- DataScraping/XML/OpenCL/funcs.bin | Bin 139823 -> 140110 bytes LastPack.log | 4 +- Log/FirstPack.log | 2 +- Log/OpenCL.log | 2 +- Modules.Packed/OpenCL.pas | 81 ++++++++++++++++++ Modules.Packed/OpenCLABC.pas | 57 ++++++++++-- Modules/OpenCLABC.pas | 49 +++++++++-- Packing/Descriptions/OpenCL.predoc | 81 ++++++++++++++++++ Packing/Descriptions/OpenCLABC.predoc | 57 ++++++++++-- .../!Def/WrapperProperties/02#CLDevice.dat | 1 + .../OpenCLABC/WrapperProperties.template | 8 +- .../LowLvl/OpenCL/Feature.Interface.template | 8 ++ .../OpenCL/Log/All EnumToTypeBinding's.log | 3 + .../LowLvl/OpenCL/Log/All Extension's.log | 6 ++ .../Template/LowLvl/OpenCL/Log/All Func's.log | 3 +- .../LowLvl/OpenCL/Log/All Group's.log | 6 ++ .../Template/LowLvl/OpenCL/Log/Essentials.log | 2 +- .../LowLvl/OpenCL/Types.Interface.template | 73 ++++++++++++++++ 20 files changed, 412 insertions(+), 35 deletions(-) diff --git a/.github/workflows/on commit.yaml b/.github/workflows/on commit.yaml index 02e78b07..8b0650a1 100644 --- a/.github/workflows/on commit.yaml +++ b/.github/workflows/on commit.yaml @@ -43,7 +43,7 @@ jobs: - name: Download and unpack Pascal compiler run: | - Invoke-WebRequest -Uri 'https://github.com/SunSerega/pascalabcnet/releases/download/unstable/PABCNETC.zip' -OutFile 'D:\PABCNETC.zip' + Invoke-WebRequest -Uri 'https://github.com/SunSerega/pascalabcnet/releases/download/custom-build-tag/PABCNETC.zip' -OutFile 'D:\PABCNETC.zip' Expand-Archive -Path 'D:\PABCNETC.zip' -DestinationPath 'D:\PABCNETC' -Force diff --git a/DataScraping/Reps/OpenCL-Docs b/DataScraping/Reps/OpenCL-Docs index 81ad45aa..2d470a4a 160000 --- a/DataScraping/Reps/OpenCL-Docs +++ b/DataScraping/Reps/OpenCL-Docs @@ -1 +1 @@ -Subproject commit 81ad45aa50a38268fd225f3cb57ad809c41e4e02 +Subproject commit 2d470a4ae5ebc7ba743e0334c731ed24d2730ce4 diff --git a/DataScraping/XML/OpenCL/funcs.bin b/DataScraping/XML/OpenCL/funcs.bin index e70ab6b0eb53b921101977672d730e20618850b9..ae9b3aacc5dc1f9fd70172dc52d912401523da89 100644 GIT binary patch delta 8427 zcmbu^2Ygh;zQFOFNj9Vq$U@rgCLtk&DxJ_vLMR3a5Co(nDk_Q;8|qa9s9;z4D@R0{ zpi-qNk)F_dFQK>4d(le~c)vMIc%b*b&wKCg=kuMJGc#w-oIYoE=8C{gs{+5Qt$NL_ z)2ESyHVO)Fn$fy#rygmkZBiSjw@h!B-t_Uj6d6=MeD2SUQtL++&uE&_BeiAA)@eP` z+O+RMoZ2$bA^HC(mlgisMa?NnOHF&UX%m0Py`O%%kK=)rO$~eHum>wdJlsT^w&@*G z+ck}Uu!{HLDo?acZ`ZU(TI-C)&h%DIwPUV+yHu>+lOnEB;eJ*3+Oe*-Z*KchnMIwg z{2Y$zGHr59P)(ukjkKW!St%x-Slj%i&YM(~{dH(Q2h;ldzqcrKV zD1$JN<#?315n7-bKB3KY;*W{VaR^C!zGvUQz529!vwtt@%a$pj=}DBALQT{_ZPY?F zBq9MN(E#;OAMCHAB9cj0M;+9iTYBnLB0uA#|~`7 zPVB~3Y(gHkVKa7N54K|+w#eY=W%WKk>37zx5Bf=^m2P!O24D2(3w|ZM3+j+m zo#9azr6u8EJLf22tc;sc*8LI9oWgmWz)2j()wzdfJfd7J>1!*rMh4o=KeB!R`lGc*>TD{mGzw*`2ZCB%$aaFrbwGPW7Q;>ZpNgsDflvf;nx$O?tiF`{`ckeV^@T+KvR9b*#gm zCPPurQ3VA*y9Z9GGH<9_A*qW!YMlwC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~3pq{gvp9oOR>KOqe!VYgD}?qv zm_v3+(ny$(>DF690^ z0&Nyq569`=&O?+2SWDyd=c<;~v!YI_HiVrILo-Uu|F;Gc4@Fxx>VS@DhvrslMb2(3 RvsJhi9j_CDA0oT>?;pS&Ha`FW diff --git a/LastPack.log b/LastPack.log index 92499fcf..62d4e19f 100644 --- a/LastPack.log +++ b/LastPack.log @@ -56,7 +56,7 @@ ScrapXML[OpenCL]: Parsing "cl" ScrapXML[OpenCL]: Constructing named items ScrapXML[OpenCL]: Saving as binary ScrapXML[OpenCL]: VendorSuffix: Saved 11 items -ScrapXML[OpenCL]: Enum: Saved 1119 items +ScrapXML[OpenCL]: Enum: Saved 1125 items ScrapXML[OpenCL]: BasicType: Saved 30 items ScrapXML[OpenCL]: Group: Saved 119 items ScrapXML[OpenCL]: IdClass: Saved 18 items @@ -249,7 +249,7 @@ Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Dumping Id Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Dumping Struct items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Dumping Delegate items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: PascalBasicType: Packed 12 items -Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Group: Packed 111 items +Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Group: Packed 112 items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: IdClass: Packed 28 items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Struct: Packed 17 items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Delegate: Packed 7 items diff --git a/Log/FirstPack.log b/Log/FirstPack.log index 5ac5fafa..a58cc91f 100644 --- a/Log/FirstPack.log +++ b/Log/FirstPack.log @@ -46,7 +46,7 @@ ScrapXML[OpenCL]: Parsing "cl" ScrapXML[OpenCL]: Constructing named items ScrapXML[OpenCL]: Saving as binary ScrapXML[OpenCL]: VendorSuffix: Saved 11 items -ScrapXML[OpenCL]: Enum: Saved 1119 items +ScrapXML[OpenCL]: Enum: Saved 1125 items ScrapXML[OpenCL]: BasicType: Saved 30 items ScrapXML[OpenCL]: Group: Saved 119 items ScrapXML[OpenCL]: IdClass: Saved 18 items diff --git a/Log/OpenCL.log b/Log/OpenCL.log index 0328cb92..8592f3b5 100644 --- a/Log/OpenCL.log +++ b/Log/OpenCL.log @@ -103,7 +103,7 @@ Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Dumping Id Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Dumping Struct items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Dumping Delegate items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: PascalBasicType: Packed 12 items -Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Group: Packed 111 items +Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Group: Packed 112 items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: IdClass: Packed 28 items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Struct: Packed 17 items Template[OpenCL]: TemplateCommand[LowLvl/OpenCL/Pack Essentials.exe]: Delegate: Packed 7 items diff --git a/Modules.Packed/OpenCL.pas b/Modules.Packed/OpenCL.pas index 0b042acb..740e0d0b 100644 --- a/Modules.Packed/OpenCL.pas +++ b/Modules.Packed/OpenCL.pas @@ -1832,6 +1832,7 @@ clDeviceInfo = record public static property DEVICE_PAGE_SIZE: clDeviceInfo read new clDeviceInfo($40A1); public static property DEVICE_SVM_CAPABILITIES_ARM: clDeviceInfo read new clDeviceInfo($40B6); public static property DEVICE_COMPUTE_UNITS_BITFIELD: clDeviceInfo read new clDeviceInfo($40BF); + public static property DEVICE_MEMORY_CAPABILITIES: clDeviceInfo read new clDeviceInfo($40D8); public static property DEVICE_SPIR_VERSIONS: clDeviceInfo read new clDeviceInfo($40E0); public static property DEVICE_SIMULTANEOUS_INTEROPS: clDeviceInfo read new clDeviceInfo($4104); public static property DEVICE_NUM_SIMULTANEOUS_INTEROPS: clDeviceInfo read new clDeviceInfo($4105); @@ -2203,6 +2204,8 @@ clDeviceInfo = record Result := 'DEVICE_SVM_CAPABILITIES_ARM' else if DEVICE_COMPUTE_UNITS_BITFIELD = self then Result := 'DEVICE_COMPUTE_UNITS_BITFIELD' else + if DEVICE_MEMORY_CAPABILITIES = self then + Result := 'DEVICE_MEMORY_CAPABILITIES' else if DEVICE_SPIR_VERSIONS = self then Result := 'DEVICE_SPIR_VERSIONS' else if DEVICE_SIMULTANEOUS_INTEROPS = self then @@ -5202,6 +5205,76 @@ clDevicePartitionPropertyEXT = record end; + /// + clMemAllocFlagsIMG = record + public val: UInt64; + public constructor(val: UInt64) := self.val := val; + + public static property MEM_ALLOC_RELAX_REQUIREMENTS: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 0); + public static property MEM_ALLOC_GPU_WRITE_COMBINE: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 1); + public static property MEM_ALLOC_GPU_CACHED: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 2); + public static property MEM_ALLOC_CPU_LOCAL: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 3); + public static property MEM_ALLOC_GPU_LOCAL: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 4); + public static property MEM_ALLOC_GPU_PRIVATE: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 5); + + public static function operator+(v1, v2: clMemAllocFlagsIMG) := new clMemAllocFlagsIMG(v1.val or v2.val); + public static function operator or(v1, v2: clMemAllocFlagsIMG) := new clMemAllocFlagsIMG(v1.val or v2.val); + + public static procedure operator+=(var v1: clMemAllocFlagsIMG; v2: clMemAllocFlagsIMG) := v1 := v1+v2; + + public static function operator in(v1, v2: clMemAllocFlagsIMG) := v1.val and v2.val = v1.val; + + public function ToString: string; override; + begin + var res := new StringBuilder; + var left_val := self.val; + if left_val=0 then + begin + Result := 'clMemAllocFlagsIMG[0]'; + exit; + end; + if MEM_ALLOC_RELAX_REQUIREMENTS in self then + begin + res += 'MEM_ALLOC_RELAX_REQUIREMENTS+'; + left_val := left_val and not MEM_ALLOC_RELAX_REQUIREMENTS.val; + end; + if MEM_ALLOC_GPU_WRITE_COMBINE in self then + begin + res += 'MEM_ALLOC_GPU_WRITE_COMBINE+'; + left_val := left_val and not MEM_ALLOC_GPU_WRITE_COMBINE.val; + end; + if MEM_ALLOC_GPU_CACHED in self then + begin + res += 'MEM_ALLOC_GPU_CACHED+'; + left_val := left_val and not MEM_ALLOC_GPU_CACHED.val; + end; + if MEM_ALLOC_CPU_LOCAL in self then + begin + res += 'MEM_ALLOC_CPU_LOCAL+'; + left_val := left_val and not MEM_ALLOC_CPU_LOCAL.val; + end; + if MEM_ALLOC_GPU_LOCAL in self then + begin + res += 'MEM_ALLOC_GPU_LOCAL+'; + left_val := left_val and not MEM_ALLOC_GPU_LOCAL.val; + end; + if MEM_ALLOC_GPU_PRIVATE in self then + begin + res += 'MEM_ALLOC_GPU_PRIVATE+'; + left_val := left_val and not MEM_ALLOC_GPU_PRIVATE.val; + end; + if left_val<>0 then + begin + res += 'clMemAllocFlagsIMG['; + res += self.val.ToString; + res += ']+'; + end; + res.Length -= 1; + Result := res.ToString; + end; + + end; + /// clMemAllocFlagsINTEL = record public val: UInt64; @@ -11099,6 +11172,14 @@ cl_queue_family_properties = record if param_value_validate_size and (param_value_ret_size<>param_value_sz) then raise new InvalidOperationException($'Implementation returned a size of {param_value_ret_size} instead of {param_value_sz}'); end; + public [MethodImpl(MethodImplOptions.AggressiveInlining)] static function GetDeviceInfo_DEVICE_MEMORY_CAPABILITIES(device: cl_device_id; var param_value: clMemAllocFlagsIMG; param_value_validate_size: boolean := false): clErrorCode; + begin + var param_value_sz := new UIntPtr(Marshal.SizeOf&); + var param_value_ret_size: UIntPtr; + Result := GetDeviceInfo(device, clDeviceInfo.DEVICE_MEMORY_CAPABILITIES, param_value_sz,param_value,param_value_ret_size); + if param_value_validate_size and (param_value_ret_size<>param_value_sz) then + raise new InvalidOperationException($'Implementation returned a size of {param_value_ret_size} instead of {param_value_sz}'); + end; public [MethodImpl(MethodImplOptions.AggressiveInlining)] static function GetDeviceInfo_DEVICE_SPIR_VERSIONS(device: cl_device_id; var param_value: string): clErrorCode; begin var param_value_sz: UIntPtr; diff --git a/Modules.Packed/OpenCLABC.pas b/Modules.Packed/OpenCLABC.pas index 36162783..ed64d621 100644 --- a/Modules.Packed/OpenCLABC.pas +++ b/Modules.Packed/OpenCLABC.pas @@ -57,6 +57,12 @@ //=================================== // Обязательно сделать до следующей стабильной версии: +//TODO Сеттеры параметров не всегда известно, нужны ли +// - Добавить параметр "unuse_is_error := true" + +//TODO При создании CLArray и т.п. указывается map_use, но влияет он и на .ReadArray и т.п. +// - Перетестить и переименовать... host_use? + //TODO Если кинуло AggEx, возвращать из тестов его внутренний массив исключений // - TestExecutor сейчас возвращает исключение текстом... Ужас //TODO Устечка памяти в виде ивентов после исключения в очереди @@ -1525,7 +1531,7 @@ EventRetainReleaseData = record CLMemoryObserver = static class - public static auto property &Default: MemoryObserver := new EmptyMemoryObserver; + public static auto property Current: MemoryObserver := new EmptyMemoryObserver; private static procedure ReportFree(ntv: cl_mem{$ifdef DEBUG}; mem_obj: object{$endif}); begin @@ -1533,7 +1539,7 @@ EventRetainReleaseData = record OpenCLABCInternalException.RaiseIfError( cl.GetMemObjectInfo_MEM_SIZE(ntv, sz) ); - &Default.RemoveMemoryUse(sz.ToUInt64, {$ifdef DEBUG}mem_obj{$else}ntv{$endif}); + Current.RemoveMemoryUse(sz.ToUInt64, {$ifdef DEBUG}mem_obj{$else}ntv{$endif}); end; end; @@ -2391,6 +2397,10 @@ CLDeviceProperties = class begin cl.GetDeviceInfo_DEVICE_FEATURE_CAPABILITIES(self.ntv, Result).RaiseIfError; end; + private function GetMemoryCapabilities: clMemAllocFlagsIMG; + begin + cl.GetDeviceInfo_DEVICE_MEMORY_CAPABILITIES(self.ntv, Result).RaiseIfError; + end; public property &Type: clDeviceType read GetType; public property VendorId: clKhronosVendorId read GetVendorId; @@ -2569,6 +2579,7 @@ CLDeviceProperties = class public property NumEusPerSubSlice: UInt32 read GetNumEusPerSubSlice; public property NumThreadsPerEu: UInt32 read GetNumThreadsPerEu; public property FeatureCapabilities: clDeviceFeatureCapabilities read GetFeatureCapabilities; + public property MemoryCapabilities: clMemAllocFlagsIMG read GetMemoryCapabilities; private static procedure AddProp(res: StringBuilder; get_prop: ()->T) := try @@ -2755,7 +2766,8 @@ CLDeviceProperties = class res += 'NumSubSlicesPerSlice = '; AddProp(res, GetNumSubSlicesPerSlice ); res += #10; res += 'NumEusPerSubSlice = '; AddProp(res, GetNumEusPerSubSlice ); res += #10; res += 'NumThreadsPerEu = '; AddProp(res, GetNumThreadsPerEu ); res += #10; - res += 'FeatureCapabilities = '; AddProp(res, GetFeatureCapabilities ); + res += 'FeatureCapabilities = '; AddProp(res, GetFeatureCapabilities ); res += #10; + res += 'MemoryCapabilities = '; AddProp(res, GetMemoryCapabilities ); end; public function ToString: string; override; begin @@ -4213,6 +4225,25 @@ CLProgramLinkOptions = class(CLProgramOptions) begin self.code := code; self.k_name := k_name; + + // Create one instance, to check if everything is valid + var ec: clErrorCode; + var k := cl.CreateKernel(code.ntv, k_name, ec); + + if ec.IS_ERROR then + begin + if ec=clErrorCode.INVALID_KERNEL_NAME then + begin + var names: string; + OpenCLABCInternalException.RaiseIfError( + cl.GetProgramInfo_PROGRAM_KERNEL_NAMES(code.ntv, names) + ); + raise new OpenCLABCInternalException($'Kernel [{k_name}] is not defined in {code}. Existing kernel names: {names}'); + end; + OpenCLABCInternalException.RaiseIfError(ec); + end; + + AddExistingNative(k); end; public constructor(ntv: cl_kernel); @@ -4369,7 +4400,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use), size, nil, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(size.ToUInt64, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(size.ToUInt64, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; public constructor(size: integer; c: CLContext; kernel_use: CLMemoryUsage := CLMemoryUsage.read_write_bits; map_use: CLMemoryUsage := CLMemoryUsage.read_write_bits) := @@ -5042,7 +5073,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use), new UIntPtr(ValueSize), nil, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; public constructor(c: CLContext; val: T; kernel_use: CLMemoryUsage := CLMemoryUsage.read_write_bits; map_use: CLMemoryUsage := CLMemoryUsage.read_write_bits); @@ -5052,7 +5083,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use) + clMemFlags.MEM_COPY_HOST_PTR, new UIntPtr(ValueSize), val, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; @@ -5172,7 +5203,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use), new UIntPtr(ByteSize), nil, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; private procedure InitByVal(c: CLContext; var els: T; kernel_use, map_use: CLMemoryUsage); @@ -5182,7 +5213,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use) + clMemFlags.MEM_COPY_HOST_PTR, new UIntPtr(ByteSize), els, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; @@ -37491,6 +37522,12 @@ GLIteropApiBlock = record var prev_ev := l.AttachInvokeActions(g{$ifdef EventDebug}, l{$endif}); var res_ev: cl_event; InvokeImpl(api_block, g.GetCQ(false), ntv_mem_objs, prev_ev, res_ev); + //TODO Проверить и сделать всё релевантное из EnqueueableCore + // - В частности что если enq_ev=0 из за предыдущих ошибок? Может ли тут NV тоже отказываться давать ивент? + // - И сделать issue в OpenCL-Docs об этом, типа кто прав (или оба?) + {$ifdef EventDebug} + EventDebug.RegisterEventRetain(res_ev, $'Enq by {TypeName(self)}, waiting on: {prev_ev.evs?.Take(prev_ev.count).JoinToString}'); + {$endif EventDebug} Result := new QueueResNil(prev_ev + res_ev); end; @@ -37954,7 +37991,9 @@ procedure CLArray.SetSliceProp(range: IntRange; value: array of T) := end; begin - var left_mem_objs := EmptyMemoryObserver(CLMemoryObserver.Default).impl.mem_uses.Keys; + var obs := CLMemoryObserver.Current as TrackingMemoryObserver; + if obs=nil then obs := EmptyMemoryObserver(CLMemoryObserver.Current).impl; + var left_mem_objs := obs.mem_uses.Keys; if left_mem_objs.Any then raise new OpenCLABCInternalException($'Not all memory objects were disposed: ' + left_mem_objs.JoinToString); end; diff --git a/Modules/OpenCLABC.pas b/Modules/OpenCLABC.pas index b310db85..741c38e5 100644 --- a/Modules/OpenCLABC.pas +++ b/Modules/OpenCLABC.pas @@ -47,6 +47,12 @@ //=================================== // Обязательно сделать до следующей стабильной версии: +//TODO Сеттеры параметров не всегда известно, нужны ли +// - Добавить параметр "unuse_is_error := true" + +//TODO При создании CLArray и т.п. указывается map_use, но влияет он и на .ReadArray и т.п. +// - Перетестить и переименовать... host_use? + //TODO Если кинуло AggEx, возвращать из тестов его внутренний массив исключений // - TestExecutor сейчас возвращает исключение текстом... Ужас //TODO Устечка памяти в виде ивентов после исключения в очереди @@ -1413,7 +1419,7 @@ EventRetainReleaseData = record CLMemoryObserver = static class - public static auto property &Default: MemoryObserver := new EmptyMemoryObserver; + public static auto property Current: MemoryObserver := new EmptyMemoryObserver; private static procedure ReportFree(ntv: cl_mem{$ifdef DEBUG}; mem_obj: object{$endif}); begin @@ -1421,7 +1427,7 @@ EventRetainReleaseData = record OpenCLABCInternalException.RaiseIfError( cl.GetMemObjectInfo_MEM_SIZE(ntv, sz) ); - &Default.RemoveMemoryUse(sz.ToUInt64, {$ifdef DEBUG}mem_obj{$else}ntv{$endif}); + Current.RemoveMemoryUse(sz.ToUInt64, {$ifdef DEBUG}mem_obj{$else}ntv{$endif}); end; end; @@ -2380,6 +2386,25 @@ CLProgramLinkOptions = class(CLProgramOptions) begin self.code := code; self.k_name := k_name; + + // Create one instance, to check if everything is valid + var ec: clErrorCode; + var k := cl.CreateKernel(code.ntv, k_name, ec); + + if ec.IS_ERROR then + begin + if ec=clErrorCode.INVALID_KERNEL_NAME then + begin + var names: string; + OpenCLABCInternalException.RaiseIfError( + cl.GetProgramInfo_PROGRAM_KERNEL_NAMES(code.ntv, names) + ); + raise new OpenCLABCInternalException($'Kernel [{k_name}] is not defined in {code}. Existing kernel names: {names}'); + end; + OpenCLABCInternalException.RaiseIfError(ec); + end; + + AddExistingNative(k); end; public constructor(ntv: cl_kernel); @@ -2525,7 +2550,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use), size, nil, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(size.ToUInt64, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(size.ToUInt64, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; public constructor(size: integer; c: CLContext; kernel_use: CLMemoryUsage := CLMemoryUsage.read_write_bits; map_use: CLMemoryUsage := CLMemoryUsage.read_write_bits) := @@ -2653,7 +2678,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use), new UIntPtr(ValueSize), nil, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; public constructor(c: CLContext; val: T; kernel_use: CLMemoryUsage := CLMemoryUsage.read_write_bits; map_use: CLMemoryUsage := CLMemoryUsage.read_write_bits); @@ -2663,7 +2688,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use) + clMemFlags.MEM_COPY_HOST_PTR, new UIntPtr(ValueSize), val, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; @@ -2730,7 +2755,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use), new UIntPtr(ByteSize), nil, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; private procedure InitByVal(c: CLContext; var els: T; kernel_use, map_use: CLMemoryUsage); @@ -2740,7 +2765,7 @@ CLMemoryUsage = record self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use) + clMemFlags.MEM_COPY_HOST_PTR, new UIntPtr(ByteSize), els, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; @@ -10979,6 +11004,12 @@ GLIteropApiBlock = record var prev_ev := l.AttachInvokeActions(g{$ifdef EventDebug}, l{$endif}); var res_ev: cl_event; InvokeImpl(api_block, g.GetCQ(false), ntv_mem_objs, prev_ev, res_ev); + //TODO Проверить и сделать всё релевантное из EnqueueableCore + // - В частности что если enq_ev=0 из за предыдущих ошибок? Может ли тут NV тоже отказываться давать ивент? + // - И сделать issue в OpenCL-Docs об этом, типа кто прав (или оба?) + {$ifdef EventDebug} + EventDebug.RegisterEventRetain(res_ev, $'Enq by {TypeName(self)}, waiting on: {prev_ev.evs?.Take(prev_ev.count).JoinToString}'); + {$endif EventDebug} Result := new QueueResNil(prev_ev + res_ev); end; @@ -11442,7 +11473,9 @@ procedure CLArray.SetSliceProp(range: IntRange; value: array of T) := end; begin - var left_mem_objs := EmptyMemoryObserver(CLMemoryObserver.Default).impl.mem_uses.Keys; + var obs := CLMemoryObserver.Current as TrackingMemoryObserver; + if obs=nil then obs := EmptyMemoryObserver(CLMemoryObserver.Current).impl; + var left_mem_objs := obs.mem_uses.Keys; if left_mem_objs.Any then raise new OpenCLABCInternalException($'Not all memory objects were disposed: ' + left_mem_objs.JoinToString); end; diff --git a/Packing/Descriptions/OpenCL.predoc b/Packing/Descriptions/OpenCL.predoc index b73802a6..97a3870e 100644 --- a/Packing/Descriptions/OpenCL.predoc +++ b/Packing/Descriptions/OpenCL.predoc @@ -1832,6 +1832,7 @@ type public static property DEVICE_PAGE_SIZE: clDeviceInfo read new clDeviceInfo($40A1); public static property DEVICE_SVM_CAPABILITIES_ARM: clDeviceInfo read new clDeviceInfo($40B6); public static property DEVICE_COMPUTE_UNITS_BITFIELD: clDeviceInfo read new clDeviceInfo($40BF); + public static property DEVICE_MEMORY_CAPABILITIES: clDeviceInfo read new clDeviceInfo($40D8); public static property DEVICE_SPIR_VERSIONS: clDeviceInfo read new clDeviceInfo($40E0); public static property DEVICE_SIMULTANEOUS_INTEROPS: clDeviceInfo read new clDeviceInfo($4104); public static property DEVICE_NUM_SIMULTANEOUS_INTEROPS: clDeviceInfo read new clDeviceInfo($4105); @@ -2203,6 +2204,8 @@ type Result := 'DEVICE_SVM_CAPABILITIES_ARM' else if DEVICE_COMPUTE_UNITS_BITFIELD = self then Result := 'DEVICE_COMPUTE_UNITS_BITFIELD' else + if DEVICE_MEMORY_CAPABILITIES = self then + Result := 'DEVICE_MEMORY_CAPABILITIES' else if DEVICE_SPIR_VERSIONS = self then Result := 'DEVICE_SPIR_VERSIONS' else if DEVICE_SIMULTANEOUS_INTEROPS = self then @@ -5202,6 +5205,76 @@ type end; + /// + clMemAllocFlagsIMG = record + public val: UInt64; + public constructor(val: UInt64) := self.val := val; + + public static property MEM_ALLOC_RELAX_REQUIREMENTS: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 0); + public static property MEM_ALLOC_GPU_WRITE_COMBINE: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 1); + public static property MEM_ALLOC_GPU_CACHED: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 2); + public static property MEM_ALLOC_CPU_LOCAL: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 3); + public static property MEM_ALLOC_GPU_LOCAL: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 4); + public static property MEM_ALLOC_GPU_PRIVATE: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 5); + + public static function operator+(v1, v2: clMemAllocFlagsIMG) := new clMemAllocFlagsIMG(v1.val or v2.val); + public static function operator or(v1, v2: clMemAllocFlagsIMG) := new clMemAllocFlagsIMG(v1.val or v2.val); + + public static procedure operator+=(var v1: clMemAllocFlagsIMG; v2: clMemAllocFlagsIMG) := v1 := v1+v2; + + public static function operator in(v1, v2: clMemAllocFlagsIMG) := v1.val and v2.val = v1.val; + + public function ToString: string; override; + begin + var res := new StringBuilder; + var left_val := self.val; + if left_val=0 then + begin + Result := 'clMemAllocFlagsIMG[0]'; + exit; + end; + if MEM_ALLOC_RELAX_REQUIREMENTS in self then + begin + res += 'MEM_ALLOC_RELAX_REQUIREMENTS+'; + left_val := left_val and not MEM_ALLOC_RELAX_REQUIREMENTS.val; + end; + if MEM_ALLOC_GPU_WRITE_COMBINE in self then + begin + res += 'MEM_ALLOC_GPU_WRITE_COMBINE+'; + left_val := left_val and not MEM_ALLOC_GPU_WRITE_COMBINE.val; + end; + if MEM_ALLOC_GPU_CACHED in self then + begin + res += 'MEM_ALLOC_GPU_CACHED+'; + left_val := left_val and not MEM_ALLOC_GPU_CACHED.val; + end; + if MEM_ALLOC_CPU_LOCAL in self then + begin + res += 'MEM_ALLOC_CPU_LOCAL+'; + left_val := left_val and not MEM_ALLOC_CPU_LOCAL.val; + end; + if MEM_ALLOC_GPU_LOCAL in self then + begin + res += 'MEM_ALLOC_GPU_LOCAL+'; + left_val := left_val and not MEM_ALLOC_GPU_LOCAL.val; + end; + if MEM_ALLOC_GPU_PRIVATE in self then + begin + res += 'MEM_ALLOC_GPU_PRIVATE+'; + left_val := left_val and not MEM_ALLOC_GPU_PRIVATE.val; + end; + if left_val<>0 then + begin + res += 'clMemAllocFlagsIMG['; + res += self.val.ToString; + res += ']+'; + end; + res.Length -= 1; + Result := res.ToString; + end; + + end; + /// clMemAllocFlagsINTEL = record public val: UInt64; @@ -11095,6 +11168,14 @@ type if param_value_validate_size and (param_value_ret_size<>param_value_sz) then raise new InvalidOperationException($'Implementation returned a size of {param_value_ret_size} instead of {param_value_sz}'); end; + public [MethodImpl(MethodImplOptions.AggressiveInlining)] static function GetDeviceInfo_DEVICE_MEMORY_CAPABILITIES(device: cl_device_id; var param_value: clMemAllocFlagsIMG; param_value_validate_size: boolean := false): clErrorCode; + begin + var param_value_sz := new UIntPtr(Marshal.SizeOf&); + var param_value_ret_size: UIntPtr; + Result := GetDeviceInfo(device, clDeviceInfo.DEVICE_MEMORY_CAPABILITIES, param_value_sz,param_value,param_value_ret_size); + if param_value_validate_size and (param_value_ret_size<>param_value_sz) then + raise new InvalidOperationException($'Implementation returned a size of {param_value_ret_size} instead of {param_value_sz}'); + end; public [MethodImpl(MethodImplOptions.AggressiveInlining)] static function GetDeviceInfo_DEVICE_SPIR_VERSIONS(device: cl_device_id; var param_value: string): clErrorCode; begin var param_value_sz: UIntPtr; diff --git a/Packing/Descriptions/OpenCLABC.predoc b/Packing/Descriptions/OpenCLABC.predoc index 000847c8..eb3bc670 100644 --- a/Packing/Descriptions/OpenCLABC.predoc +++ b/Packing/Descriptions/OpenCLABC.predoc @@ -57,6 +57,12 @@ unit OpenCLABC; //=================================== // Обязательно сделать до следующей стабильной версии: +//TODO Сеттеры параметров не всегда известно, нужны ли +// - Добавить параметр "unuse_is_error := true" + +//TODO При создании CLArray и т.п. указывается map_use, но влияет он и на .ReadArray и т.п. +// - Перетестить и переименовать... host_use? + //TODO Если кинуло AggEx, возвращать из тестов его внутренний массив исключений // - TestExecutor сейчас возвращает исключение текстом... Ужас //TODO Устечка памяти в виде ивентов после исключения в очереди @@ -1423,7 +1429,7 @@ type CLMemoryObserver = static class - public static auto property &Default: MemoryObserver := new EmptyMemoryObserver; + public static auto property Current: MemoryObserver := new EmptyMemoryObserver; private static procedure ReportFree(ntv: cl_mem{$ifdef DEBUG}; mem_obj: object{$endif}); begin @@ -1431,7 +1437,7 @@ type OpenCLABCInternalException.RaiseIfError( cl.GetMemObjectInfo_MEM_SIZE(ntv, sz) ); - &Default.RemoveMemoryUse(sz.ToUInt64, {$ifdef DEBUG}mem_obj{$else}ntv{$endif}); + Current.RemoveMemoryUse(sz.ToUInt64, {$ifdef DEBUG}mem_obj{$else}ntv{$endif}); end; end; @@ -2289,6 +2295,10 @@ type begin cl.GetDeviceInfo_DEVICE_FEATURE_CAPABILITIES(self.ntv, Result).RaiseIfError; end; + private function GetMemoryCapabilities: clMemAllocFlagsIMG; + begin + cl.GetDeviceInfo_DEVICE_MEMORY_CAPABILITIES(self.ntv, Result).RaiseIfError; + end; public property &Type: clDeviceType read GetType; public property VendorId: clKhronosVendorId read GetVendorId; @@ -2467,6 +2477,7 @@ type public property NumEusPerSubSlice: UInt32 read GetNumEusPerSubSlice; public property NumThreadsPerEu: UInt32 read GetNumThreadsPerEu; public property FeatureCapabilities: clDeviceFeatureCapabilities read GetFeatureCapabilities; + public property MemoryCapabilities: clMemAllocFlagsIMG read GetMemoryCapabilities; private static procedure AddProp(res: StringBuilder; get_prop: ()->T) := try @@ -2653,7 +2664,8 @@ type res += 'NumSubSlicesPerSlice = '; AddProp(res, GetNumSubSlicesPerSlice ); res += #10; res += 'NumEusPerSubSlice = '; AddProp(res, GetNumEusPerSubSlice ); res += #10; res += 'NumThreadsPerEu = '; AddProp(res, GetNumThreadsPerEu ); res += #10; - res += 'FeatureCapabilities = '; AddProp(res, GetFeatureCapabilities ); + res += 'FeatureCapabilities = '; AddProp(res, GetFeatureCapabilities ); res += #10; + res += 'MemoryCapabilities = '; AddProp(res, GetMemoryCapabilities ); end; public function ToString: string; override; begin @@ -4109,6 +4121,25 @@ type begin self.code := code; self.k_name := k_name; + + // Create one instance, to check if everything is valid + var ec: clErrorCode; + var k := cl.CreateKernel(code.ntv, k_name, ec); + + if ec.IS_ERROR then + begin + if ec=clErrorCode.INVALID_KERNEL_NAME then + begin + var names: string; + OpenCLABCInternalException.RaiseIfError( + cl.GetProgramInfo_PROGRAM_KERNEL_NAMES(code.ntv, names) + ); + raise new OpenCLABCInternalException($'Kernel [{k_name}] is not defined in {code}. Existing kernel names: {names}'); + end; + OpenCLABCInternalException.RaiseIfError(ec); + end; + + AddExistingNative(k); end; public constructor(ntv: cl_kernel); @@ -4264,7 +4295,7 @@ type self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use), size, nil, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(size.ToUInt64, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(size.ToUInt64, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; public constructor(size: integer; c: CLContext; kernel_use: CLMemoryUsage := CLMemoryUsage.read_write_bits; map_use: CLMemoryUsage := CLMemoryUsage.read_write_bits) := @@ -4692,7 +4723,7 @@ type self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use), new UIntPtr(ValueSize), nil, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; public constructor(c: CLContext; val: T; kernel_use: CLMemoryUsage := CLMemoryUsage.read_write_bits; map_use: CLMemoryUsage := CLMemoryUsage.read_write_bits); @@ -4702,7 +4733,7 @@ type self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use) + clMemFlags.MEM_COPY_HOST_PTR, new UIntPtr(ValueSize), val, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ValueSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; @@ -4803,7 +4834,7 @@ type self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use), new UIntPtr(ByteSize), nil, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; private procedure InitByVal(c: CLContext; var els: T; kernel_use, map_use: CLMemoryUsage); @@ -4813,7 +4844,7 @@ type self.ntv := cl.CreateBuffer(c.ntv, CLMemoryUsage.MakeCLFlags(kernel_use,map_use) + clMemFlags.MEM_COPY_HOST_PTR, new UIntPtr(ByteSize), els, ec); OpenCLABCInternalException.RaiseIfError(ec); - CLMemoryObserver.Default.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); + CLMemoryObserver.Current.AddMemoryUse(ByteSize, {$ifdef DEBUG}new CLMemoryAlloc(self, ntv){$else}ntv{$endif}); end; @@ -36425,6 +36456,12 @@ end; var prev_ev := l.AttachInvokeActions(g{$ifdef EventDebug}, l{$endif}); var res_ev: cl_event; InvokeImpl(api_block, g.GetCQ(false), ntv_mem_objs, prev_ev, res_ev); + //TODO Проверить и сделать всё релевантное из EnqueueableCore + // - В частности что если enq_ev=0 из за предыдущих ошибок? Может ли тут NV тоже отказываться давать ивент? + // - И сделать issue в OpenCL-Docs об этом, типа кто прав (или оба?) + {$ifdef EventDebug} + EventDebug.RegisterEventRetain(res_ev, $'Enq by {TypeName(self)}, waiting on: {prev_ev.evs?.Take(prev_ev.count).JoinToString}'); + {$endif EventDebug} Result := new QueueResNil(prev_ev + res_ev); end; @@ -36888,7 +36925,9 @@ type end; begin - var left_mem_objs := EmptyMemoryObserver(CLMemoryObserver.Default).impl.mem_uses.Keys; + var obs := CLMemoryObserver.Current as TrackingMemoryObserver; + if obs=nil then obs := EmptyMemoryObserver(CLMemoryObserver.Current).impl; + var left_mem_objs := obs.mem_uses.Keys; if left_mem_objs.Any then raise new OpenCLABCInternalException($'Not all memory objects were disposed: ' + left_mem_objs.JoinToString); end; diff --git a/Packing/Template/HighLvl/OpenCLABC/!Def/WrapperProperties/02#CLDevice.dat b/Packing/Template/HighLvl/OpenCLABC/!Def/WrapperProperties/02#CLDevice.dat index 6644b1ef..005d42c7 100644 --- a/Packing/Template/HighLvl/OpenCLABC/!Def/WrapperProperties/02#CLDevice.dat +++ b/Packing/Template/HighLvl/OpenCLABC/!Def/WrapperProperties/02#CLDevice.dat @@ -181,6 +181,7 @@ cl.GetDeviceInfo # NUM_EUS_PER_SUB_SLICE # NUM_THREADS_PER_EU # FEATURE_CAPABILITIES +# MEMORY_CAPABILITIES Flat diff --git a/Packing/Template/HighLvl/OpenCLABC/WrapperProperties.template b/Packing/Template/HighLvl/OpenCLABC/WrapperProperties.template index 315eb635..11a874c3 100644 --- a/Packing/Template/HighLvl/OpenCLABC/WrapperProperties.template +++ b/Packing/Template/HighLvl/OpenCLABC/WrapperProperties.template @@ -834,6 +834,10 @@ begin cl.GetDeviceInfo_DEVICE_FEATURE_CAPABILITIES(self.ntv, Result).RaiseIfError; end; + private function GetMemoryCapabilities: clMemAllocFlagsIMG; + begin + cl.GetDeviceInfo_DEVICE_MEMORY_CAPABILITIES(self.ntv, Result).RaiseIfError; + end; public property &Type: clDeviceType read GetType; public property VendorId: clKhronosVendorId read GetVendorId; @@ -1012,6 +1016,7 @@ public property NumEusPerSubSlice: UInt32 read GetNumEusPerSubSlice; public property NumThreadsPerEu: UInt32 read GetNumThreadsPerEu; public property FeatureCapabilities: clDeviceFeatureCapabilities read GetFeatureCapabilities; + public property MemoryCapabilities: clMemAllocFlagsIMG read GetMemoryCapabilities; private static procedure AddProp(res: StringBuilder; get_prop: ()->T) := try @@ -1198,7 +1203,8 @@ res += 'NumSubSlicesPerSlice = '; AddProp(res, GetNumSubSlicesPerSlice ); res += #10; res += 'NumEusPerSubSlice = '; AddProp(res, GetNumEusPerSubSlice ); res += #10; res += 'NumThreadsPerEu = '; AddProp(res, GetNumThreadsPerEu ); res += #10; - res += 'FeatureCapabilities = '; AddProp(res, GetFeatureCapabilities ); + res += 'FeatureCapabilities = '; AddProp(res, GetFeatureCapabilities ); res += #10; + res += 'MemoryCapabilities = '; AddProp(res, GetMemoryCapabilities ); end; public function ToString: string; override; begin diff --git a/Packing/Template/LowLvl/OpenCL/Feature.Interface.template b/Packing/Template/LowLvl/OpenCL/Feature.Interface.template index ffcb7a5a..8257b789 100644 --- a/Packing/Template/LowLvl/OpenCL/Feature.Interface.template +++ b/Packing/Template/LowLvl/OpenCL/Feature.Interface.template @@ -4911,6 +4911,14 @@ if param_value_validate_size and (param_value_ret_size<>param_value_sz) then raise new InvalidOperationException($'Implementation returned a size of {param_value_ret_size} instead of {param_value_sz}'); end; + public [MethodImpl(MethodImplOptions.AggressiveInlining)] static function GetDeviceInfo_DEVICE_MEMORY_CAPABILITIES(device: cl_device_id; var param_value: clMemAllocFlagsIMG; param_value_validate_size: boolean := false): clErrorCode; + begin + var param_value_sz := new UIntPtr(Marshal.SizeOf&); + var param_value_ret_size: UIntPtr; + Result := GetDeviceInfo(device, clDeviceInfo.DEVICE_MEMORY_CAPABILITIES, param_value_sz,param_value,param_value_ret_size); + if param_value_validate_size and (param_value_ret_size<>param_value_sz) then + raise new InvalidOperationException($'Implementation returned a size of {param_value_ret_size} instead of {param_value_sz}'); + end; public [MethodImpl(MethodImplOptions.AggressiveInlining)] static function GetDeviceInfo_DEVICE_SPIR_VERSIONS(device: cl_device_id; var param_value: string): clErrorCode; begin var param_value_sz: UIntPtr; diff --git a/Packing/Template/LowLvl/OpenCL/Log/All EnumToTypeBinding's.log b/Packing/Template/LowLvl/OpenCL/Log/All EnumToTypeBinding's.log index f8a4e5a0..07d6b97c 100644 --- a/Packing/Template/LowLvl/OpenCL/Log/All EnumToTypeBinding's.log +++ b/Packing/Template/LowLvl/OpenCL/Log/All EnumToTypeBinding's.log @@ -507,6 +507,9 @@ clDeviceSVMCapabilities --- DEVICE_COMPUTE_UNITS_BITFIELD !output UInt64 +--- DEVICE_MEMORY_CAPABILITIES +!output +clMemAllocFlagsIMG --- DEVICE_SPIR_VERSIONS !output string diff --git a/Packing/Template/LowLvl/OpenCL/Log/All Extension's.log b/Packing/Template/LowLvl/OpenCL/Log/All Extension's.log index a7028c5e..0a783d0e 100644 --- a/Packing/Template/LowLvl/OpenCL/Log/All Extension's.log +++ b/Packing/Template/LowLvl/OpenCL/Log/All Extension's.log @@ -205,7 +205,13 @@ # clMemPropertiesIMG (cl_img_mem_properties) Enum [cl::MEM_ALLOC_RELAX_REQUIREMENTS] + Enum [cl::MEM_ALLOC_GPU_WRITE_COMBINE] + Enum [cl::MEM_ALLOC_GPU_CACHED] + Enum [cl::MEM_ALLOC_CPU_LOCAL] + Enum [cl::MEM_ALLOC_GPU_LOCAL] + Enum [cl::MEM_ALLOC_GPU_PRIVATE] Enum [cl::MEM_ALLOC_FLAGS + IMG] + Enum [cl::DEVICE_MEMORY_CAPABILITIES] # clUseGrallocPtrIMG (cl_img_use_gralloc_ptr) Enum [cl::COMMAND_ACQUIRE_GRALLOC_OBJECTS] diff --git a/Packing/Template/LowLvl/OpenCL/Log/All Func's.log b/Packing/Template/LowLvl/OpenCL/Log/All Func's.log index 76f405ff..477301c1 100644 --- a/Packing/Template/LowLvl/OpenCL/Log/All Func's.log +++ b/Packing/Template/LowLvl/OpenCL/Log/All Func's.log @@ -1551,7 +1551,7 @@ param_value_size: UIntPtr param_value: pointer param_value_size_ret: var UIntPtr / IntPtr !ffo -204 +205 clErrorCode | cl_device_id | clDeviceInfo | UIntPtr | var T | var UIntPtr | clErrorCode | cl_device_id | clDeviceInfo | UIntPtr | var T | IntPtr | clErrorCode | cl_device_id | clDeviceInfo | UIntPtr | pointer | var UIntPtr | @@ -1720,6 +1720,7 @@ param_value_size_ret: var UIntPtr / IntPtr clErrorCode | cl_device_id | clDeviceInfo.DEVICE_ME_VERSION | * | var clDeviceMeVersion | * | clErrorCode | cl_device_id | clDeviceInfo.DEVICE_SVM_CAPABILITIES_ARM | * | var clDeviceSVMCapabilities | * | clErrorCode | cl_device_id | clDeviceInfo.DEVICE_COMPUTE_UNITS_BITFIELD | * | var UInt64 | * | + clErrorCode | cl_device_id | clDeviceInfo.DEVICE_MEMORY_CAPABILITIES | * | var clMemAllocFlagsIMG | * | clErrorCode | cl_device_id | clDeviceInfo.DEVICE_SPIR_VERSIONS | * | var string | * | clErrorCode | cl_device_id | clDeviceInfo.DEVICE_SIMULTANEOUS_INTEROPS | * | var array of UInt32 | * | clErrorCode | cl_device_id | clDeviceInfo.DEVICE_SIMULTANEOUS_INTEROPS | UInt32 | var UInt32 | * | diff --git a/Packing/Template/LowLvl/OpenCL/Log/All Group's.log b/Packing/Template/LowLvl/OpenCL/Log/All Group's.log index 3723f8a8..e85a3bef 100644 --- a/Packing/Template/LowLvl/OpenCL/Log/All Group's.log +++ b/Packing/Template/LowLvl/OpenCL/Log/All Group's.log @@ -523,6 +523,7 @@ DEVICE_PAGE_SIZE[$40A1] DEVICE_SVM_CAPABILITIES + ARM[$40B6] DEVICE_COMPUTE_UNITS_BITFIELD[$40BF] + DEVICE_MEMORY_CAPABILITIES[$40D8] DEVICE_SPIR_VERSIONS[$40E0] DEVICE_SIMULTANEOUS_INTEROPS[$4104] DEVICE_NUM_SIMULTANEOUS_INTEROPS[$4105] @@ -1205,6 +1206,11 @@ # clMemAllocFlagsIMG (cl::MemAllocFlags + img) : UInt64 (Bitfield) MEM_ALLOC_RELAX_REQUIREMENTS[1 shl 0] + MEM_ALLOC_GPU_WRITE_COMBINE[1 shl 1] + MEM_ALLOC_GPU_CACHED[1 shl 2] + MEM_ALLOC_CPU_LOCAL[1 shl 3] + MEM_ALLOC_GPU_LOCAL[1 shl 4] + MEM_ALLOC_GPU_PRIVATE[1 shl 5] # clMemAllocFlagsINTEL (cl::MemAllocFlags + intel) : UInt64 (Bitfield) MEM_ALLOC_WRITE_COMBINED[1 shl 0] diff --git a/Packing/Template/LowLvl/OpenCL/Log/Essentials.log b/Packing/Template/LowLvl/OpenCL/Log/Essentials.log index f07c7121..26abd565 100644 --- a/Packing/Template/LowLvl/OpenCL/Log/Essentials.log +++ b/Packing/Template/LowLvl/OpenCL/Log/Essentials.log @@ -104,7 +104,7 @@ Dumping IdClass items Dumping Struct items Dumping Delegate items PascalBasicType: Packed 12 items -Group: Packed 111 items +Group: Packed 112 items IdClass: Packed 28 items Struct: Packed 17 items Delegate: Packed 7 items diff --git a/Packing/Template/LowLvl/OpenCL/Types.Interface.template b/Packing/Template/LowLvl/OpenCL/Types.Interface.template index 4ccf568f..03d566b5 100644 --- a/Packing/Template/LowLvl/OpenCL/Types.Interface.template +++ b/Packing/Template/LowLvl/OpenCL/Types.Interface.template @@ -1798,6 +1798,7 @@ public static property DEVICE_PAGE_SIZE: clDeviceInfo read new clDeviceInfo($40A1); public static property DEVICE_SVM_CAPABILITIES_ARM: clDeviceInfo read new clDeviceInfo($40B6); public static property DEVICE_COMPUTE_UNITS_BITFIELD: clDeviceInfo read new clDeviceInfo($40BF); + public static property DEVICE_MEMORY_CAPABILITIES: clDeviceInfo read new clDeviceInfo($40D8); public static property DEVICE_SPIR_VERSIONS: clDeviceInfo read new clDeviceInfo($40E0); public static property DEVICE_SIMULTANEOUS_INTEROPS: clDeviceInfo read new clDeviceInfo($4104); public static property DEVICE_NUM_SIMULTANEOUS_INTEROPS: clDeviceInfo read new clDeviceInfo($4105); @@ -2169,6 +2170,8 @@ Result := 'DEVICE_SVM_CAPABILITIES_ARM' else if DEVICE_COMPUTE_UNITS_BITFIELD = self then Result := 'DEVICE_COMPUTE_UNITS_BITFIELD' else + if DEVICE_MEMORY_CAPABILITIES = self then + Result := 'DEVICE_MEMORY_CAPABILITIES' else if DEVICE_SPIR_VERSIONS = self then Result := 'DEVICE_SPIR_VERSIONS' else if DEVICE_SIMULTANEOUS_INTEROPS = self then @@ -5168,6 +5171,76 @@ end; + /// + clMemAllocFlagsIMG = record + public val: UInt64; + public constructor(val: UInt64) := self.val := val; + + public static property MEM_ALLOC_RELAX_REQUIREMENTS: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 0); + public static property MEM_ALLOC_GPU_WRITE_COMBINE: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 1); + public static property MEM_ALLOC_GPU_CACHED: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 2); + public static property MEM_ALLOC_CPU_LOCAL: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 3); + public static property MEM_ALLOC_GPU_LOCAL: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 4); + public static property MEM_ALLOC_GPU_PRIVATE: clMemAllocFlagsIMG read new clMemAllocFlagsIMG(1 shl 5); + + public static function operator+(v1, v2: clMemAllocFlagsIMG) := new clMemAllocFlagsIMG(v1.val or v2.val); + public static function operator or(v1, v2: clMemAllocFlagsIMG) := new clMemAllocFlagsIMG(v1.val or v2.val); + + public static procedure operator+=(var v1: clMemAllocFlagsIMG; v2: clMemAllocFlagsIMG) := v1 := v1+v2; + + public static function operator in(v1, v2: clMemAllocFlagsIMG) := v1.val and v2.val = v1.val; + + public function ToString: string; override; + begin + var res := new StringBuilder; + var left_val := self.val; + if left_val=0 then + begin + Result := 'clMemAllocFlagsIMG[0]'; + exit; + end; + if MEM_ALLOC_RELAX_REQUIREMENTS in self then + begin + res += 'MEM_ALLOC_RELAX_REQUIREMENTS+'; + left_val := left_val and not MEM_ALLOC_RELAX_REQUIREMENTS.val; + end; + if MEM_ALLOC_GPU_WRITE_COMBINE in self then + begin + res += 'MEM_ALLOC_GPU_WRITE_COMBINE+'; + left_val := left_val and not MEM_ALLOC_GPU_WRITE_COMBINE.val; + end; + if MEM_ALLOC_GPU_CACHED in self then + begin + res += 'MEM_ALLOC_GPU_CACHED+'; + left_val := left_val and not MEM_ALLOC_GPU_CACHED.val; + end; + if MEM_ALLOC_CPU_LOCAL in self then + begin + res += 'MEM_ALLOC_CPU_LOCAL+'; + left_val := left_val and not MEM_ALLOC_CPU_LOCAL.val; + end; + if MEM_ALLOC_GPU_LOCAL in self then + begin + res += 'MEM_ALLOC_GPU_LOCAL+'; + left_val := left_val and not MEM_ALLOC_GPU_LOCAL.val; + end; + if MEM_ALLOC_GPU_PRIVATE in self then + begin + res += 'MEM_ALLOC_GPU_PRIVATE+'; + left_val := left_val and not MEM_ALLOC_GPU_PRIVATE.val; + end; + if left_val<>0 then + begin + res += 'clMemAllocFlagsIMG['; + res += self.val.ToString; + res += ']+'; + end; + res.Length -= 1; + Result := res.ToString; + end; + + end; + /// clMemAllocFlagsINTEL = record public val: UInt64;