SPB Git

spb/forge Public MIT

Forge — LLM training from scratch in pure C++20 + Metal on Apple Silicon.

C++ 61.2% C 23% Python 7.6% TeX 7.2% CMake 1.1%
23.4 KB · 841 lines cpp
Raw Blame History
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------2//3// Metal/MTLArgument.hpp4//5// Copyright 2020-2025 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 at10//11//     http://www.apache.org/licenses/LICENSE-2.012//13// Unless required by applicable law or agreed to in writing, software14// 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 and17// limitations under the License.18//19//-------------------------------------------------------------------------------------------------------------------------------------------------------------2021#pragma once2223#include "../Foundation/Foundation.hpp"24#include "MTLDataType.hpp"25#include "MTLDefines.hpp"26#include "MTLHeaderBridge.hpp"27#include "MTLPrivate.hpp"28#include "MTLTensor.hpp"29#include "MTLTexture.hpp"3031namespace MTL32{33class Argument;34class ArrayType;35class PointerType;36class StructMember;37class StructType;38class TensorAuxiliaryPlaneType;39class TensorExtents;40class TensorReferenceType;41class TextureReferenceType;42class Type;43_MTL_ENUM(NS::UInteger, IndexType) {44    IndexTypeUInt16 = 0,45    IndexTypeUInt32 = 1,46};4748_MTL_ENUM(NS::Integer, BindingType) {49    BindingTypeBuffer = 0,50    BindingTypeThreadgroupMemory = 1,51    BindingTypeTexture = 2,52    BindingTypeSampler = 3,53    BindingTypeImageblockData = 16,54    BindingTypeImageblock = 17,55    BindingTypeVisibleFunctionTable = 24,56    BindingTypePrimitiveAccelerationStructure = 25,57    BindingTypeInstanceAccelerationStructure = 26,58    BindingTypeIntersectionFunctionTable = 27,59    BindingTypeObjectPayload = 34,60    BindingTypeTensor = 37,61};6263_MTL_ENUM(NS::UInteger, ArgumentType) {64    ArgumentTypeBuffer = 0,65    ArgumentTypeThreadgroupMemory = 1,66    ArgumentTypeTexture = 2,67    ArgumentTypeSampler = 3,68    ArgumentTypeImageblockData = 16,69    ArgumentTypeImageblock = 17,70    ArgumentTypeVisibleFunctionTable = 24,71    ArgumentTypePrimitiveAccelerationStructure = 25,72    ArgumentTypeInstanceAccelerationStructure = 26,73    ArgumentTypeIntersectionFunctionTable = 27,74};7576_MTL_ENUM(NS::UInteger, BindingAccess) {77    BindingAccessReadOnly = 0,78    BindingAccessReadWrite = 1,79    BindingAccessWriteOnly = 2,80    ArgumentAccessReadOnly = 0,81    ArgumentAccessReadWrite = 1,82    ArgumentAccessWriteOnly = 2,83};8485class Type : public NS::Referencing<Type>86{87public:88    static Type* alloc();8990    DataType     dataType() const;9192    Type*        init();93};94class StructMember : public NS::Referencing<StructMember>95{96public:97    static StructMember*  alloc();9899    NS::UInteger          argumentIndex() const;100101    ArrayType*            arrayType();102103    DataType              dataType() const;104105    StructMember*         init();106107    NS::String*           name() const;108109    NS::UInteger          offset() const;110111    PointerType*          pointerType();112113    StructType*           structType();114115    TensorReferenceType*  tensorReferenceType();116117    TextureReferenceType* textureReferenceType();118};119class StructType : public NS::Referencing<StructType, Type>120{121public:122    static StructType* alloc();123124    StructType*        init();125126    StructMember*      memberByName(const NS::String* name);127128    NS::Array*         members() const;129};130class ArrayType : public NS::Referencing<ArrayType, Type>131{132public:133    static ArrayType*     alloc();134135    NS::UInteger          argumentIndexStride() const;136137    NS::UInteger          arrayLength() const;138139    ArrayType*            elementArrayType();140141    PointerType*          elementPointerType();142143    StructType*           elementStructType();144145    TensorReferenceType*  elementTensorReferenceType();146147    TextureReferenceType* elementTextureReferenceType();148149    DataType              elementType() const;150151    ArrayType*            init();152153    NS::UInteger          stride() const;154};155class PointerType : public NS::Referencing<PointerType, Type>156{157public:158    BindingAccess       access() const;159160    NS::UInteger        alignment() const;161162    static PointerType* alloc();163164    NS::UInteger        dataSize() const;165166    ArrayType*          elementArrayType();167168    bool                elementIsArgumentBuffer() const;169170    StructType*         elementStructType();171172    DataType            elementType() const;173174    PointerType*        init();175};176class TextureReferenceType : public NS::Referencing<TextureReferenceType, Type>177{178public:179    BindingAccess                access() const;180181    static TextureReferenceType* alloc();182183    TextureReferenceType*        init();184185    bool                         isDepthTexture() const;186187    DataType                     textureDataType() const;188189    TextureType                  textureType() const;190};191class TensorAuxiliaryPlaneType : public NS::Referencing<TensorAuxiliaryPlaneType>192{193public:194    static TensorAuxiliaryPlaneType* alloc();195196    TensorExtents*                   blockFactors() const;197198    TensorDataType                   dataType() const;199200    TensorAuxiliaryPlaneType*        init();201202    TensorPlaneType                  planeType() const;203};204class TensorReferenceType : public NS::Referencing<TensorReferenceType, Type>205{206public:207    BindingAccess               access() const;208209    static TensorReferenceType* alloc();210211    NS::Array*                  auxiliaryPlanes() const;212213    TensorExtents*              dimensions() const;214215    DataType                    indexType() const;216217    TensorReferenceType*        init();218219    TensorDataType              tensorDataType() const;220};221class Argument : public NS::Referencing<Argument>222{223public:224    BindingAccess access() const;225226    [[deprecated("please use isActive instead")]]227    bool             active() const;228229    static Argument* alloc();230231    NS::UInteger     arrayLength() const;232233    NS::UInteger     bufferAlignment() const;234235    NS::UInteger     bufferDataSize() const;236237    DataType         bufferDataType() const;238239    PointerType*     bufferPointerType() const;240241    StructType*      bufferStructType() const;242243    NS::UInteger     index() const;244245    Argument*        init();246247    bool             isActive() const;248249    bool             isDepthTexture() const;250251    NS::String*      name() const;252253    DataType         textureDataType() const;254255    TextureType      textureType() const;256257    NS::UInteger     threadgroupMemoryAlignment() const;258259    NS::UInteger     threadgroupMemoryDataSize() const;260261    ArgumentType     type() const;262};263class Binding : public NS::Referencing<Binding>264{265public:266    BindingAccess access() const;267268    [[deprecated("please use isArgument instead")]]269    bool         argument() const;270271    NS::UInteger index() const;272273    bool         isArgument() const;274275    bool         isUsed() const;276277    NS::String*  name() const;278279    BindingType  type() const;280281    [[deprecated("please use isUsed instead")]]282    bool used() const;283};284class BufferBinding : public NS::Referencing<BufferBinding, Binding>285{286public:287    NS::UInteger bufferAlignment() const;288289    NS::UInteger bufferDataSize() const;290291    DataType     bufferDataType() const;292293    PointerType* bufferPointerType() const;294295    StructType*  bufferStructType() const;296};297class ThreadgroupBinding : public NS::Referencing<ThreadgroupBinding, Binding>298{299public:300    NS::UInteger threadgroupMemoryAlignment() const;301302    NS::UInteger threadgroupMemoryDataSize() const;303};304class TextureBinding : public NS::Referencing<TextureBinding, Binding>305{306public:307    NS::UInteger arrayLength() const;308309    [[deprecated("please use isDepthTexture instead")]]310    bool        depthTexture() const;311    bool        isDepthTexture() const;312313    DataType    textureDataType() const;314315    TextureType textureType() const;316};317class ObjectPayloadBinding : public NS::Referencing<ObjectPayloadBinding, Binding>318{319public:320    NS::UInteger objectPayloadAlignment() const;321322    NS::UInteger objectPayloadDataSize() const;323};324class TensorBinding : public NS::Referencing<TensorBinding, Binding>325{326public:327    NS::Array*     auxiliaryPlanes() const;328329    TensorExtents* dimensions() const;330331    DataType       indexType() const;332333    TensorDataType tensorDataType() const;334};335336}337_MTL_INLINE MTL::Type* MTL::Type::alloc()338{339    return NS::Object::alloc<MTL::Type>(_MTL_PRIVATE_CLS(MTLType));340}341342_MTL_INLINE MTL::DataType MTL::Type::dataType() const343{344    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(dataType));345}346347_MTL_INLINE MTL::Type* MTL::Type::init()348{349    return NS::Object::init<MTL::Type>();350}351352_MTL_INLINE MTL::StructMember* MTL::StructMember::alloc()353{354    return NS::Object::alloc<MTL::StructMember>(_MTL_PRIVATE_CLS(MTLStructMember));355}356357_MTL_INLINE NS::UInteger MTL::StructMember::argumentIndex() const358{359    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(argumentIndex));360}361362_MTL_INLINE MTL::ArrayType* MTL::StructMember::arrayType()363{364    return Object::sendMessage<MTL::ArrayType*>(this, _MTL_PRIVATE_SEL(arrayType));365}366367_MTL_INLINE MTL::DataType MTL::StructMember::dataType() const368{369    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(dataType));370}371372_MTL_INLINE MTL::StructMember* MTL::StructMember::init()373{374    return NS::Object::init<MTL::StructMember>();375}376377_MTL_INLINE NS::String* MTL::StructMember::name() const378{379    return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(name));380}381382_MTL_INLINE NS::UInteger MTL::StructMember::offset() const383{384    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(offset));385}386387_MTL_INLINE MTL::PointerType* MTL::StructMember::pointerType()388{389    return Object::sendMessage<MTL::PointerType*>(this, _MTL_PRIVATE_SEL(pointerType));390}391392_MTL_INLINE MTL::StructType* MTL::StructMember::structType()393{394    return Object::sendMessage<MTL::StructType*>(this, _MTL_PRIVATE_SEL(structType));395}396397_MTL_INLINE MTL::TensorReferenceType* MTL::StructMember::tensorReferenceType()398{399    return Object::sendMessage<MTL::TensorReferenceType*>(this, _MTL_PRIVATE_SEL(tensorReferenceType));400}401402_MTL_INLINE MTL::TextureReferenceType* MTL::StructMember::textureReferenceType()403{404    return Object::sendMessage<MTL::TextureReferenceType*>(this, _MTL_PRIVATE_SEL(textureReferenceType));405}406407_MTL_INLINE MTL::StructType* MTL::StructType::alloc()408{409    return NS::Object::alloc<MTL::StructType>(_MTL_PRIVATE_CLS(MTLStructType));410}411412_MTL_INLINE MTL::StructType* MTL::StructType::init()413{414    return NS::Object::init<MTL::StructType>();415}416417_MTL_INLINE MTL::StructMember* MTL::StructType::memberByName(const NS::String* name)418{419    return Object::sendMessage<MTL::StructMember*>(this, _MTL_PRIVATE_SEL(memberByName_), name);420}421422_MTL_INLINE NS::Array* MTL::StructType::members() const423{424    return Object::sendMessage<NS::Array*>(this, _MTL_PRIVATE_SEL(members));425}426427_MTL_INLINE MTL::ArrayType* MTL::ArrayType::alloc()428{429    return NS::Object::alloc<MTL::ArrayType>(_MTL_PRIVATE_CLS(MTLArrayType));430}431432_MTL_INLINE NS::UInteger MTL::ArrayType::argumentIndexStride() const433{434    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(argumentIndexStride));435}436437_MTL_INLINE NS::UInteger MTL::ArrayType::arrayLength() const438{439    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(arrayLength));440}441442_MTL_INLINE MTL::ArrayType* MTL::ArrayType::elementArrayType()443{444    return Object::sendMessage<MTL::ArrayType*>(this, _MTL_PRIVATE_SEL(elementArrayType));445}446447_MTL_INLINE MTL::PointerType* MTL::ArrayType::elementPointerType()448{449    return Object::sendMessage<MTL::PointerType*>(this, _MTL_PRIVATE_SEL(elementPointerType));450}451452_MTL_INLINE MTL::StructType* MTL::ArrayType::elementStructType()453{454    return Object::sendMessage<MTL::StructType*>(this, _MTL_PRIVATE_SEL(elementStructType));455}456457_MTL_INLINE MTL::TensorReferenceType* MTL::ArrayType::elementTensorReferenceType()458{459    return Object::sendMessage<MTL::TensorReferenceType*>(this, _MTL_PRIVATE_SEL(elementTensorReferenceType));460}461462_MTL_INLINE MTL::TextureReferenceType* MTL::ArrayType::elementTextureReferenceType()463{464    return Object::sendMessage<MTL::TextureReferenceType*>(this, _MTL_PRIVATE_SEL(elementTextureReferenceType));465}466467_MTL_INLINE MTL::DataType MTL::ArrayType::elementType() const468{469    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(elementType));470}471472_MTL_INLINE MTL::ArrayType* MTL::ArrayType::init()473{474    return NS::Object::init<MTL::ArrayType>();475}476477_MTL_INLINE NS::UInteger MTL::ArrayType::stride() const478{479    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(stride));480}481482_MTL_INLINE MTL::BindingAccess MTL::PointerType::access() const483{484    return Object::sendMessage<MTL::BindingAccess>(this, _MTL_PRIVATE_SEL(access));485}486487_MTL_INLINE NS::UInteger MTL::PointerType::alignment() const488{489    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(alignment));490}491492_MTL_INLINE MTL::PointerType* MTL::PointerType::alloc()493{494    return NS::Object::alloc<MTL::PointerType>(_MTL_PRIVATE_CLS(MTLPointerType));495}496497_MTL_INLINE NS::UInteger MTL::PointerType::dataSize() const498{499    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(dataSize));500}501502_MTL_INLINE MTL::ArrayType* MTL::PointerType::elementArrayType()503{504    return Object::sendMessage<MTL::ArrayType*>(this, _MTL_PRIVATE_SEL(elementArrayType));505}506507_MTL_INLINE bool MTL::PointerType::elementIsArgumentBuffer() const508{509    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(elementIsArgumentBuffer));510}511512_MTL_INLINE MTL::StructType* MTL::PointerType::elementStructType()513{514    return Object::sendMessage<MTL::StructType*>(this, _MTL_PRIVATE_SEL(elementStructType));515}516517_MTL_INLINE MTL::DataType MTL::PointerType::elementType() const518{519    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(elementType));520}521522_MTL_INLINE MTL::PointerType* MTL::PointerType::init()523{524    return NS::Object::init<MTL::PointerType>();525}526527_MTL_INLINE MTL::BindingAccess MTL::TextureReferenceType::access() const528{529    return Object::sendMessage<MTL::BindingAccess>(this, _MTL_PRIVATE_SEL(access));530}531532_MTL_INLINE MTL::TextureReferenceType* MTL::TextureReferenceType::alloc()533{534    return NS::Object::alloc<MTL::TextureReferenceType>(_MTL_PRIVATE_CLS(MTLTextureReferenceType));535}536537_MTL_INLINE MTL::TextureReferenceType* MTL::TextureReferenceType::init()538{539    return NS::Object::init<MTL::TextureReferenceType>();540}541542_MTL_INLINE bool MTL::TextureReferenceType::isDepthTexture() const543{544    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isDepthTexture));545}546547_MTL_INLINE MTL::DataType MTL::TextureReferenceType::textureDataType() const548{549    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(textureDataType));550}551552_MTL_INLINE MTL::TextureType MTL::TextureReferenceType::textureType() const553{554    return Object::sendMessage<MTL::TextureType>(this, _MTL_PRIVATE_SEL(textureType));555}556557_MTL_INLINE MTL::TensorAuxiliaryPlaneType* MTL::TensorAuxiliaryPlaneType::alloc()558{559    return NS::Object::alloc<MTL::TensorAuxiliaryPlaneType>(_MTL_PRIVATE_CLS(MTLTensorAuxiliaryPlaneType));560}561562_MTL_INLINE MTL::TensorExtents* MTL::TensorAuxiliaryPlaneType::blockFactors() const563{564    return Object::sendMessage<MTL::TensorExtents*>(this, _MTL_PRIVATE_SEL(blockFactors));565}566567_MTL_INLINE MTL::TensorDataType MTL::TensorAuxiliaryPlaneType::dataType() const568{569    return Object::sendMessage<MTL::TensorDataType>(this, _MTL_PRIVATE_SEL(dataType));570}571572_MTL_INLINE MTL::TensorAuxiliaryPlaneType* MTL::TensorAuxiliaryPlaneType::init()573{574    return NS::Object::init<MTL::TensorAuxiliaryPlaneType>();575}576577_MTL_INLINE MTL::TensorPlaneType MTL::TensorAuxiliaryPlaneType::planeType() const578{579    return Object::sendMessage<MTL::TensorPlaneType>(this, _MTL_PRIVATE_SEL(planeType));580}581582_MTL_INLINE MTL::BindingAccess MTL::TensorReferenceType::access() const583{584    return Object::sendMessage<MTL::BindingAccess>(this, _MTL_PRIVATE_SEL(access));585}586587_MTL_INLINE MTL::TensorReferenceType* MTL::TensorReferenceType::alloc()588{589    return NS::Object::alloc<MTL::TensorReferenceType>(_MTL_PRIVATE_CLS(MTLTensorReferenceType));590}591592_MTL_INLINE NS::Array* MTL::TensorReferenceType::auxiliaryPlanes() const593{594    return Object::sendMessage<NS::Array*>(this, _MTL_PRIVATE_SEL(auxiliaryPlanes));595}596597_MTL_INLINE MTL::TensorExtents* MTL::TensorReferenceType::dimensions() const598{599    return Object::sendMessage<MTL::TensorExtents*>(this, _MTL_PRIVATE_SEL(dimensions));600}601602_MTL_INLINE MTL::DataType MTL::TensorReferenceType::indexType() const603{604    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(indexType));605}606607_MTL_INLINE MTL::TensorReferenceType* MTL::TensorReferenceType::init()608{609    return NS::Object::init<MTL::TensorReferenceType>();610}611612_MTL_INLINE MTL::TensorDataType MTL::TensorReferenceType::tensorDataType() const613{614    return Object::sendMessage<MTL::TensorDataType>(this, _MTL_PRIVATE_SEL(tensorDataType));615}616617_MTL_INLINE MTL::BindingAccess MTL::Argument::access() const618{619    return Object::sendMessage<MTL::BindingAccess>(this, _MTL_PRIVATE_SEL(access));620}621622_MTL_INLINE bool MTL::Argument::active() const623{624    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isActive));625}626627_MTL_INLINE MTL::Argument* MTL::Argument::alloc()628{629    return NS::Object::alloc<MTL::Argument>(_MTL_PRIVATE_CLS(MTLArgument));630}631632_MTL_INLINE NS::UInteger MTL::Argument::arrayLength() const633{634    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(arrayLength));635}636637_MTL_INLINE NS::UInteger MTL::Argument::bufferAlignment() const638{639    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(bufferAlignment));640}641642_MTL_INLINE NS::UInteger MTL::Argument::bufferDataSize() const643{644    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(bufferDataSize));645}646647_MTL_INLINE MTL::DataType MTL::Argument::bufferDataType() const648{649    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(bufferDataType));650}651652_MTL_INLINE MTL::PointerType* MTL::Argument::bufferPointerType() const653{654    return Object::sendMessage<MTL::PointerType*>(this, _MTL_PRIVATE_SEL(bufferPointerType));655}656657_MTL_INLINE MTL::StructType* MTL::Argument::bufferStructType() const658{659    return Object::sendMessage<MTL::StructType*>(this, _MTL_PRIVATE_SEL(bufferStructType));660}661662_MTL_INLINE NS::UInteger MTL::Argument::index() const663{664    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(index));665}666667_MTL_INLINE MTL::Argument* MTL::Argument::init()668{669    return NS::Object::init<MTL::Argument>();670}671672_MTL_INLINE bool MTL::Argument::isActive() const673{674    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isActive));675}676677_MTL_INLINE bool MTL::Argument::isDepthTexture() const678{679    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isDepthTexture));680}681682_MTL_INLINE NS::String* MTL::Argument::name() const683{684    return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(name));685}686687_MTL_INLINE MTL::DataType MTL::Argument::textureDataType() const688{689    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(textureDataType));690}691692_MTL_INLINE MTL::TextureType MTL::Argument::textureType() const693{694    return Object::sendMessage<MTL::TextureType>(this, _MTL_PRIVATE_SEL(textureType));695}696697_MTL_INLINE NS::UInteger MTL::Argument::threadgroupMemoryAlignment() const698{699    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(threadgroupMemoryAlignment));700}701702_MTL_INLINE NS::UInteger MTL::Argument::threadgroupMemoryDataSize() const703{704    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(threadgroupMemoryDataSize));705}706707_MTL_INLINE MTL::ArgumentType MTL::Argument::type() const708{709    return Object::sendMessage<MTL::ArgumentType>(this, _MTL_PRIVATE_SEL(type));710}711712_MTL_INLINE MTL::BindingAccess MTL::Binding::access() const713{714    return Object::sendMessage<MTL::BindingAccess>(this, _MTL_PRIVATE_SEL(access));715}716717_MTL_INLINE bool MTL::Binding::argument() const718{719    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isArgument));720}721722_MTL_INLINE NS::UInteger MTL::Binding::index() const723{724    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(index));725}726727_MTL_INLINE bool MTL::Binding::isArgument() const728{729    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isArgument));730}731732_MTL_INLINE bool MTL::Binding::isUsed() const733{734    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isUsed));735}736737_MTL_INLINE NS::String* MTL::Binding::name() const738{739    return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(name));740}741742_MTL_INLINE MTL::BindingType MTL::Binding::type() const743{744    return Object::sendMessage<MTL::BindingType>(this, _MTL_PRIVATE_SEL(type));745}746747_MTL_INLINE bool MTL::Binding::used() const748{749    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isUsed));750}751752_MTL_INLINE NS::UInteger MTL::BufferBinding::bufferAlignment() const753{754    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(bufferAlignment));755}756757_MTL_INLINE NS::UInteger MTL::BufferBinding::bufferDataSize() const758{759    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(bufferDataSize));760}761762_MTL_INLINE MTL::DataType MTL::BufferBinding::bufferDataType() const763{764    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(bufferDataType));765}766767_MTL_INLINE MTL::PointerType* MTL::BufferBinding::bufferPointerType() const768{769    return Object::sendMessage<MTL::PointerType*>(this, _MTL_PRIVATE_SEL(bufferPointerType));770}771772_MTL_INLINE MTL::StructType* MTL::BufferBinding::bufferStructType() const773{774    return Object::sendMessage<MTL::StructType*>(this, _MTL_PRIVATE_SEL(bufferStructType));775}776777_MTL_INLINE NS::UInteger MTL::ThreadgroupBinding::threadgroupMemoryAlignment() const778{779    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(threadgroupMemoryAlignment));780}781782_MTL_INLINE NS::UInteger MTL::ThreadgroupBinding::threadgroupMemoryDataSize() const783{784    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(threadgroupMemoryDataSize));785}786787_MTL_INLINE NS::UInteger MTL::TextureBinding::arrayLength() const788{789    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(arrayLength));790}791792_MTL_INLINE bool MTL::TextureBinding::depthTexture() const793{794    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isDepthTexture));795}796797_MTL_INLINE bool MTL::TextureBinding::isDepthTexture() const798{799    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isDepthTexture));800}801802_MTL_INLINE MTL::DataType MTL::TextureBinding::textureDataType() const803{804    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(textureDataType));805}806807_MTL_INLINE MTL::TextureType MTL::TextureBinding::textureType() const808{809    return Object::sendMessage<MTL::TextureType>(this, _MTL_PRIVATE_SEL(textureType));810}811812_MTL_INLINE NS::UInteger MTL::ObjectPayloadBinding::objectPayloadAlignment() const813{814    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(objectPayloadAlignment));815}816817_MTL_INLINE NS::UInteger MTL::ObjectPayloadBinding::objectPayloadDataSize() const818{819    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(objectPayloadDataSize));820}821822_MTL_INLINE NS::Array* MTL::TensorBinding::auxiliaryPlanes() const823{824    return Object::sendMessage<NS::Array*>(this, _MTL_PRIVATE_SEL(auxiliaryPlanes));825}826827_MTL_INLINE MTL::TensorExtents* MTL::TensorBinding::dimensions() const828{829    return Object::sendMessage<MTL::TensorExtents*>(this, _MTL_PRIVATE_SEL(dimensions));830}831832_MTL_INLINE MTL::DataType MTL::TensorBinding::indexType() const833{834    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(indexType));835}836837_MTL_INLINE MTL::TensorDataType MTL::TensorBinding::tensorDataType() const838{839    return Object::sendMessage<MTL::TensorDataType>(this, _MTL_PRIVATE_SEL(tensorDataType));840}841