ncGraphDestroy()

Info Value
Header mvnc.h
Library libmvnc.so
Version 2.0
See also struct ncGraphHandle_t, ncGraphCreate(), ncGraphAllocate(), ncGraphAllocateWithFifos(), ncGraphAllocateWithFifosEx()

Overview

This function destroys a handle for a graph and frees associated resources. This function must be called for every graph handle that was initialized with ncGraphCreate().

Upon successful return, the ncGraphHandle_t struct pointer will be set to NULL.

Prototype

ncStatus_t ncGraphDestroy(struct ncGraphHandle_t** graphHandle);

Parameters

Name Type Description
graphHandle struct ncGraphHandle_t** The address of a pointer to an initialized ncGraphHandle_t struct.

Return

An appropriate value from the ncStatus_t enumeration.

Notes

None.

Example

#include <stdio.h>
#include <mvnc.h>

int main(int argc, char** argv)
{
    ncStatus_t retCode;
    struct ncGraphHandle_t* graphHandlePtr;

    // Create a graph
    ncGraphCreate("My Graph", &graphHandlePtr);

    // Allocate the graph on a device then queue inferences
    

    // When done with graph, destroy it.
    ncGraphDestroy(&graphHandlePtr);
    if (retCode != NC_OK)
    {
            printf("Error destroying graph[%d]\n", retCode);
    }
    else
    {
        // Graph is destroyed and handle pointer set to NULL
        printf("Graph Destroyed OK!\n");
    }
}