yum-mirror/VkFFT
git clone https://git.yummers.dev/yum-mirror/VkFFT
ba7001c
v1.2.31
1//------------------------------------------------------------------------------------------------------------------------------------------------------------- 2// 3// Metal/MTLComputePipeline.hpp 4// 5// Copyright 2020-2021 Apple Inc. 6// 7// Licensed under the Apache License, Version 2.0 (the "License"); 8// you may not use this file except in compliance with the License. 9// You may obtain a copy of the License at 10// 11// http://www.apache.org/licenses/LICENSE-2.0 12// 13// Unless required by applicable law or agreed to in writing, software 14// distributed under the License is distributed on an "AS IS" BASIS, 15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16// See the License for the specific language governing permissions and 17// limitations under the License. 18// 19//------------------------------------------------------------------------------------------------------------------------------------------------------------- 20 21#pragma once 22 23#include "MTLDefines.hpp" 24#include "MTLHeaderBridge.hpp" 25#include "MTLPrivate.hpp" 26 27#include <Foundation/Foundation.hpp> 28 29#include "MTLTypes.hpp" 30 31namespace MTL 32{ 33class ComputePipelineReflection : public NS :: Referencing < ComputePipelineReflection > 34{ 35public : 36static class ComputePipelineReflection * alloc () ; 37 38class ComputePipelineReflection * init () ; 39 40NS :: Array * arguments () const ; 41} ; 42 43class ComputePipelineDescriptor : public NS :: Copying < ComputePipelineDescriptor > 44{ 45public : 46static class ComputePipelineDescriptor * alloc () ; 47 48class ComputePipelineDescriptor * init () ; 49 50NS :: String * label () const ; 51void setLabel ( const NS :: String * label ) ; 52 53class Function * computeFunction () const ; 54void setComputeFunction ( const class Function * computeFunction ) ; 55 56bool threadGroupSizeIsMultipleOfThreadExecutionWidth () const ; 57void setThreadGroupSizeIsMultipleOfThreadExecutionWidth ( bool threadGroupSizeIsMultipleOfThreadExecutionWidth ) ; 58 59NS :: UInteger maxTotalThreadsPerThreadgroup () const ; 60void setMaxTotalThreadsPerThreadgroup ( NS :: UInteger maxTotalThreadsPerThreadgroup ) ; 61 62class StageInputOutputDescriptor * stageInputDescriptor () const ; 63void setStageInputDescriptor ( const class StageInputOutputDescriptor * stageInputDescriptor ) ; 64 65class PipelineBufferDescriptorArray * buffers () const ; 66 67bool supportIndirectCommandBuffers () const ; 68void setSupportIndirectCommandBuffers ( bool supportIndirectCommandBuffers ) ; 69 70NS :: Array * insertLibraries () const ; 71void setInsertLibraries ( const NS :: Array * insertLibraries ) ; 72 73NS :: Array * preloadedLibraries () const ; 74void setPreloadedLibraries ( const NS :: Array * preloadedLibraries ) ; 75 76NS :: Array * binaryArchives () const ; 77void setBinaryArchives ( const NS :: Array * binaryArchives ) ; 78 79void reset () ; 80 81class LinkedFunctions * linkedFunctions () const ; 82void setLinkedFunctions ( const class LinkedFunctions * linkedFunctions ) ; 83 84bool supportAddingBinaryFunctions () const ; 85void setSupportAddingBinaryFunctions ( bool supportAddingBinaryFunctions ) ; 86 87NS :: UInteger maxCallStackDepth () const ; 88void setMaxCallStackDepth ( NS :: UInteger maxCallStackDepth ) ; 89} ; 90 91class ComputePipelineState : public NS :: Referencing < ComputePipelineState > 92{ 93public : 94NS :: String * label () const ; 95 96class Device * device () const ; 97 98NS :: UInteger maxTotalThreadsPerThreadgroup () const ; 99 100NS :: UInteger threadExecutionWidth () const ; 101 102NS :: UInteger staticThreadgroupMemoryLength () const ; 103 104NS :: UInteger imageblockMemoryLength ( MTL :: Size imageblockDimensions ) ; 105 106bool supportIndirectCommandBuffers () const ; 107 108class FunctionHandle * functionHandle ( const class Function * function ) ; 109 110class ComputePipelineState * newComputePipelineState ( const NS :: Array * functions , NS :: Error ** error ) ; 111 112class VisibleFunctionTable * newVisibleFunctionTable ( const class VisibleFunctionTableDescriptor * descriptor ) ; 113 114class IntersectionFunctionTable * newIntersectionFunctionTable ( const class IntersectionFunctionTableDescriptor * descriptor ) ; 115} ; 116 117} 118 119// static method: alloc 120_MTL_INLINE MTL :: ComputePipelineReflection * MTL :: ComputePipelineReflection :: alloc () 121{ 122return NS :: Object :: alloc < MTL :: ComputePipelineReflection > ( _MTL_PRIVATE_CLS ( MTLComputePipelineReflection )) ; 123} 124 125// method: init 126_MTL_INLINE MTL :: ComputePipelineReflection * MTL :: ComputePipelineReflection :: init () 127{ 128return NS :: Object :: init < MTL :: ComputePipelineReflection > () ; 129} 130 131// property: arguments 132_MTL_INLINE NS :: Array * MTL :: ComputePipelineReflection :: arguments () const 133{ 134return Object :: sendMessage < NS :: Array *> ( this , _MTL_PRIVATE_SEL ( arguments )) ; 135} 136 137// static method: alloc 138_MTL_INLINE MTL :: ComputePipelineDescriptor * MTL :: ComputePipelineDescriptor :: alloc () 139{ 140return NS :: Object :: alloc < MTL :: ComputePipelineDescriptor > ( _MTL_PRIVATE_CLS ( MTLComputePipelineDescriptor )) ; 141} 142 143// method: init 144_MTL_INLINE MTL :: ComputePipelineDescriptor * MTL :: ComputePipelineDescriptor :: init () 145{ 146return NS :: Object :: init < MTL :: ComputePipelineDescriptor > () ; 147} 148 149// property: label 150_MTL_INLINE NS :: String * MTL :: ComputePipelineDescriptor :: label () const 151{ 152return Object :: sendMessage < NS :: String *> ( this , _MTL_PRIVATE_SEL ( label )) ; 153} 154 155_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setLabel ( const NS :: String * label ) 156{ 157Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setLabel_ ) , label ) ; 158} 159 160// property: computeFunction 161_MTL_INLINE MTL :: Function * MTL :: ComputePipelineDescriptor :: computeFunction () const 162{ 163return Object :: sendMessage < MTL :: Function *> ( this , _MTL_PRIVATE_SEL ( computeFunction )) ; 164} 165 166_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setComputeFunction ( const MTL :: Function * computeFunction ) 167{ 168Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setComputeFunction_ ) , computeFunction ) ; 169} 170 171// property: threadGroupSizeIsMultipleOfThreadExecutionWidth 172_MTL_INLINE bool MTL :: ComputePipelineDescriptor :: threadGroupSizeIsMultipleOfThreadExecutionWidth () const 173{ 174return Object :: sendMessage < bool > ( this , _MTL_PRIVATE_SEL ( threadGroupSizeIsMultipleOfThreadExecutionWidth )) ; 175} 176 177_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setThreadGroupSizeIsMultipleOfThreadExecutionWidth ( bool threadGroupSizeIsMultipleOfThreadExecutionWidth ) 178{ 179Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setThreadGroupSizeIsMultipleOfThreadExecutionWidth_ ) , threadGroupSizeIsMultipleOfThreadExecutionWidth ) ; 180} 181 182// property: maxTotalThreadsPerThreadgroup 183_MTL_INLINE NS :: UInteger MTL :: ComputePipelineDescriptor :: maxTotalThreadsPerThreadgroup () const 184{ 185return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( maxTotalThreadsPerThreadgroup )) ; 186} 187 188_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setMaxTotalThreadsPerThreadgroup ( NS :: UInteger maxTotalThreadsPerThreadgroup ) 189{ 190Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setMaxTotalThreadsPerThreadgroup_ ) , maxTotalThreadsPerThreadgroup ) ; 191} 192 193// property: stageInputDescriptor 194_MTL_INLINE MTL :: StageInputOutputDescriptor * MTL :: ComputePipelineDescriptor :: stageInputDescriptor () const 195{ 196return Object :: sendMessage < MTL :: StageInputOutputDescriptor *> ( this , _MTL_PRIVATE_SEL ( stageInputDescriptor )) ; 197} 198 199_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setStageInputDescriptor ( const MTL :: StageInputOutputDescriptor * stageInputDescriptor ) 200{ 201Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setStageInputDescriptor_ ) , stageInputDescriptor ) ; 202} 203 204// property: buffers 205_MTL_INLINE MTL :: PipelineBufferDescriptorArray * MTL :: ComputePipelineDescriptor :: buffers () const 206{ 207return Object :: sendMessage < MTL :: PipelineBufferDescriptorArray *> ( this , _MTL_PRIVATE_SEL ( buffers )) ; 208} 209 210// property: supportIndirectCommandBuffers 211_MTL_INLINE bool MTL :: ComputePipelineDescriptor :: supportIndirectCommandBuffers () const 212{ 213return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportIndirectCommandBuffers )) ; 214} 215 216_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setSupportIndirectCommandBuffers ( bool supportIndirectCommandBuffers ) 217{ 218Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setSupportIndirectCommandBuffers_ ) , supportIndirectCommandBuffers ) ; 219} 220 221// property: insertLibraries 222_MTL_INLINE NS :: Array * MTL :: ComputePipelineDescriptor :: insertLibraries () const 223{ 224return Object :: sendMessage < NS :: Array *> ( this , _MTL_PRIVATE_SEL ( insertLibraries )) ; 225} 226 227_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setInsertLibraries ( const NS :: Array * insertLibraries ) 228{ 229Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setInsertLibraries_ ) , insertLibraries ) ; 230} 231 232// property: preloadedLibraries 233_MTL_INLINE NS :: Array * MTL :: ComputePipelineDescriptor :: preloadedLibraries () const 234{ 235return Object :: sendMessage < NS :: Array *> ( this , _MTL_PRIVATE_SEL ( preloadedLibraries )) ; 236} 237 238_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setPreloadedLibraries ( const NS :: Array * preloadedLibraries ) 239{ 240Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setPreloadedLibraries_ ) , preloadedLibraries ) ; 241} 242 243// property: binaryArchives 244_MTL_INLINE NS :: Array * MTL :: ComputePipelineDescriptor :: binaryArchives () const 245{ 246return Object :: sendMessage < NS :: Array *> ( this , _MTL_PRIVATE_SEL ( binaryArchives )) ; 247} 248 249_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setBinaryArchives ( const NS :: Array * binaryArchives ) 250{ 251Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setBinaryArchives_ ) , binaryArchives ) ; 252} 253 254// method: reset 255_MTL_INLINE void MTL :: ComputePipelineDescriptor :: reset () 256{ 257Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( reset )) ; 258} 259 260// property: linkedFunctions 261_MTL_INLINE MTL :: LinkedFunctions * MTL :: ComputePipelineDescriptor :: linkedFunctions () const 262{ 263return Object :: sendMessage < MTL :: LinkedFunctions *> ( this , _MTL_PRIVATE_SEL ( linkedFunctions )) ; 264} 265 266_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setLinkedFunctions ( const MTL :: LinkedFunctions * linkedFunctions ) 267{ 268Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setLinkedFunctions_ ) , linkedFunctions ) ; 269} 270 271// property: supportAddingBinaryFunctions 272_MTL_INLINE bool MTL :: ComputePipelineDescriptor :: supportAddingBinaryFunctions () const 273{ 274return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportAddingBinaryFunctions )) ; 275} 276 277_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setSupportAddingBinaryFunctions ( bool supportAddingBinaryFunctions ) 278{ 279Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setSupportAddingBinaryFunctions_ ) , supportAddingBinaryFunctions ) ; 280} 281 282// property: maxCallStackDepth 283_MTL_INLINE NS :: UInteger MTL :: ComputePipelineDescriptor :: maxCallStackDepth () const 284{ 285return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( maxCallStackDepth )) ; 286} 287 288_MTL_INLINE void MTL :: ComputePipelineDescriptor :: setMaxCallStackDepth ( NS :: UInteger maxCallStackDepth ) 289{ 290Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setMaxCallStackDepth_ ) , maxCallStackDepth ) ; 291} 292 293// property: label 294_MTL_INLINE NS :: String * MTL :: ComputePipelineState :: label () const 295{ 296return Object :: sendMessage < NS :: String *> ( this , _MTL_PRIVATE_SEL ( label )) ; 297} 298 299// property: device 300_MTL_INLINE MTL :: Device * MTL :: ComputePipelineState :: device () const 301{ 302return Object :: sendMessage < MTL :: Device *> ( this , _MTL_PRIVATE_SEL ( device )) ; 303} 304 305// property: maxTotalThreadsPerThreadgroup 306_MTL_INLINE NS :: UInteger MTL :: ComputePipelineState :: maxTotalThreadsPerThreadgroup () const 307{ 308return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( maxTotalThreadsPerThreadgroup )) ; 309} 310 311// property: threadExecutionWidth 312_MTL_INLINE NS :: UInteger MTL :: ComputePipelineState :: threadExecutionWidth () const 313{ 314return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( threadExecutionWidth )) ; 315} 316 317// property: staticThreadgroupMemoryLength 318_MTL_INLINE NS :: UInteger MTL :: ComputePipelineState :: staticThreadgroupMemoryLength () const 319{ 320return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( staticThreadgroupMemoryLength )) ; 321} 322 323// method: imageblockMemoryLengthForDimensions: 324_MTL_INLINE NS :: UInteger MTL :: ComputePipelineState :: imageblockMemoryLength ( MTL :: Size imageblockDimensions ) 325{ 326return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( imageblockMemoryLengthForDimensions_ ) , imageblockDimensions ) ; 327} 328 329// property: supportIndirectCommandBuffers 330_MTL_INLINE bool MTL :: ComputePipelineState :: supportIndirectCommandBuffers () const 331{ 332return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportIndirectCommandBuffers )) ; 333} 334 335// method: functionHandleWithFunction: 336_MTL_INLINE MTL :: FunctionHandle * MTL :: ComputePipelineState :: functionHandle ( const MTL :: Function * function ) 337{ 338return Object :: sendMessage < MTL :: FunctionHandle *> ( this , _MTL_PRIVATE_SEL ( functionHandleWithFunction_ ) , function ) ; 339} 340 341// method: newComputePipelineStateWithAdditionalBinaryFunctions:error: 342_MTL_INLINE MTL :: ComputePipelineState * MTL :: ComputePipelineState :: newComputePipelineState ( const NS :: Array * functions , NS :: Error ** error ) 343{ 344return Object :: sendMessage < MTL :: ComputePipelineState *> ( this , _MTL_PRIVATE_SEL ( newComputePipelineStateWithAdditionalBinaryFunctions_error_ ) , functions , error ) ; 345} 346 347// method: newVisibleFunctionTableWithDescriptor: 348_MTL_INLINE MTL :: VisibleFunctionTable * MTL :: ComputePipelineState :: newVisibleFunctionTable ( const MTL :: VisibleFunctionTableDescriptor * descriptor ) 349{ 350return Object :: sendMessage < MTL :: VisibleFunctionTable *> ( this , _MTL_PRIVATE_SEL ( newVisibleFunctionTableWithDescriptor_ ) , descriptor ) ; 351} 352 353// method: newIntersectionFunctionTableWithDescriptor: 354_MTL_INLINE MTL :: IntersectionFunctionTable * MTL :: ComputePipelineState :: newIntersectionFunctionTable ( const MTL :: IntersectionFunctionTableDescriptor * descriptor ) 355{ 356return Object :: sendMessage < MTL :: IntersectionFunctionTable *> ( this , _MTL_PRIVATE_SEL ( newIntersectionFunctionTableWithDescriptor_ ) , descriptor ) ; 357}