cudnn_frontend_Filters.h
cudnn.h
cudnn_frontend_Heuristics.h
cudnn_frontend.h
cudnn.h
cudnn_frontend_Filters.h
cudnn_frontend_Heuristics.h
cudnn_frontend_get_plan.h
cudnn_frontend_EngineConfigGenerator.h
cudnn_frontend_Filters.h
cudnn_frontend.h
cudnn_frontend_find_plan.h
cudnn_frontend

    /*
    *Copyright(c)2021,NVIDIACORPORATION.Allrightsreserved.
    *
    *Permissionisherebygranted,freeofcharge,toanypersonobtaininga
    *copyofthissoftwareandassociateddocumentationfiles(the"Software"),
    *todealintheSoftwarewithoutrestriction,includingwithoutlimitation
    *therightstouse,copy,modify,merge,publish,distribute,sublicense,
    *and/orsellcopiesoftheSoftware,andtopermitpersonstowhomthe
    *Softwareisfurnishedtodoso,subjecttothefollowingconditions:
    *
    *Theabovecopyrightnoticeandthispermissionnoticeshallbeincludedin
    *allcopiesorsubstantialportionsoftheSoftware.
    *
    *THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND,EXPRESSOR
    *IMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOFMERCHANTABILITY,
    *FITNESSFORAPARTICULARPURPOSEANDNONINFRINGEMENT.INNOEVENTSHALL
    *THEAUTHORSORCOPYRIGHTHOLDERSBELIABLEFORANYCLAIM,DAMAGESOROTHER
    *LIABILITY,WHETHERINANACTIONOFCONTRACT,TORTOROTHERWISE,ARISING
    *FROM,OUTOFORINCONNECTIONWITHTHESOFTWAREORTHEUSEOROTHER
    *DEALINGSINTHESOFTWARE.
    */

    #pragmaonce

    #include<cudnn.h>

    namespacecudnn_frontend{

    //Iffilter_fnreturnstrue
    //Theengineconfigwillbefilteredoutandwill
    //notbepartofthetolist.
    staticvoid
    filter(EngineConfigList&from,EngineConfigList&to,std::function<bool(cudnnBackendDescriptor_t)>filter_fn){
    autop=std::stable_partition(from.begin(),from.end(),[filter_fn](ManagedOpaqueDescriptor&p){
    returnfilter_fn(const_cast<cudnnBackendDescriptor_t>(p->get_backend_descriptor()));
    });
    //rangeinsertwithmove
    to.insert(to.end(),std::make_move_iterator(p),std::make_move_iterator(from.end()));
    //erasethemoved-fromelements.
    from.erase(p,from.end());
    }

    template<cudnnBackendNumericalNote_tNUMERIC_NOTE>
    bool
    hasNumericalNote(cudnnBackendDescriptor_tengine_config){
    boolhasNumerics=false;
    autostatus=CUDNN_STATUS_SUCCESS;
    ManagedOpaqueDescriptorengine=make_shared_backend_pointer(CUDNN_BACKEND_ENGINE_DESCRIPTOR);
    cudnnBackendDescriptor_tengine_=engine->get_backend_descriptor();
    int64_tengine_count=-1;
    status=cudnnBackendGetAttribute(
    engine_config,CUDNN_ATTR_ENGINECFG_ENGINE,CUDNN_TYPE_BACKEND_DESCRIPTOR,1,&engine_count,&engine_);
    if(status==CUDNN_STATUS_SUCCESS){
    cudnnBackendNumericalNote_tnotes[CUDNN_NUMERICAL_NOTE_TYPE_COUNT];
    int64_telem_count=0;
    cudnnBackendGetAttribute(engine->get_backend_descriptor(),
    CUDNN_ATTR_ENGINE_NUMERICAL_NOTE,
    CUDNN_TYPE_NUMERICAL_NOTE,
    CUDNN_NUMERICAL_NOTE_TYPE_COUNT,
    &elem_count,
    notes);
    if(std::any_of(
    notes,notes+elem_count,[](cudnnBackendNumericalNote_tnote){returnnote==NUMERIC_NOTE;})){
    hasNumerics=true;
    }
    }
    returnhasNumerics;
    }

    #if(CUDNN_VERSION>=8200)
    template<cudnnBackendBehaviorNote_tBEHAVIOR_NOTE>
    bool
    hasBehaviorNote(cudnnBackendDescriptor_tengine_config){
    boolhasBehavior=false;
    autostatus=CUDNN_STATUS_SUCCESS;
    ManagedOpaqueDescriptorengine=make_shared_backend_pointer(CUDNN_BACKEND_ENGINE_DESCRIPTOR);
    cudnnBackendDescriptor_tengine_=engine->get_backend_descriptor();
    int64_tengine_count=-1;
    status=cudnnBackendGetAttribute(
    engine_config,CUDNN_ATTR_ENGINECFG_ENGINE,CUDNN_TYPE_BACKEND_DESCRIPTOR,1,&engine_count,&engine_);
    if(status==CUDNN_STATUS_SUCCESS){
    cudnnBackendBehaviorNote_tnotes[CUDNN_BEHAVIOR_NOTE_TYPE_COUNT];
    int64_telem_count=0;
    cudnnBackendGetAttribute(engine->get_backend_descriptor(),
    CUDNN_ATTR_ENGINE_BEHAVIOR_NOTE,
    CUDNN_TYPE_BEHAVIOR_NOTE,
    CUDNN_BEHAVIOR_NOTE_TYPE_COUNT,
    &elem_count,
    notes);
    if(std::any_of(
    notes,notes+elem_count,[](cudnnBackendBehaviorNote_tnote){returnnote==BEHAVIOR_NOTE;})){
    hasBehavior=true;
    }
    }
    returnhasBehavior;
    }
    #endif
    }