device/gpu/api_internal/nn_device_interface_0_functions.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
//Routine checking if corresposing load_item to given flow_item should have output data encapsulated in CL image
Routine checking if corresposing load_item to given flow_item should have output data encapsulated in CL image
Routine checking if corresposing load_item to given flow_item should have output data encapsulated in CL image
bool is_image_as_output_needed(nn_workflow_item_t * flow_item, uint32_t batch, nn_device_t *device)
{
    uint_least32_t input_width, input_height, input_depth;
    uint_least32_t num_outputs;
    if( (flow_item->use_count >= 1) && (flow_item->use[0].item->type == NN_WORK_ITEM_TYPE_FULLY_CONNECTED)) {
        input_width  = flow_item->output_format[0].format_1d.size[0];
        input_height = flow_item->output_format[0].format >= NN_DATA_FORMAT_2D ? flow_item->output_format[0].format_2d.size[1] : 1;
        input_depth = flow_item->output_format[0].format >= NN_DATA_FORMAT_3D ? flow_item->output_format[0].format_3d.size[2] : 1;
        num_outputs = ( flow_item->use[0].item->output_format[0].format_1d.size[0] *
              ( flow_item->use[0].item->output_format[0].format >=
                NN_DATA_FORMAT_2D ? flow_item->use[0].item->output_format[0].format_2d.size[1] : 1 ) *
              ( flow_item->use[0].item->output_format[0].format >=
                NN_DATA_FORMAT_3D ? flow_item->use[0].item->output_format[0].format_3d.size[2] : 1 ) );
        return use_fully_connected_8x8(input_width * input_height * input_depth, num_outputs, batch, device);
    }
    return false;
}
bool is_image_as_output_needed ( nn_workflow_item_t * flow_item , uint32_t batch , nn_device_t * device ) { uint_least32_t input_width , input_height , input_depth ; uint_least32_t num_outputs ; if ( ( flow_item -> use_count >= 1 ) && ( flow_item -> use [ 0 ] . item -> type == NN_WORK_ITEM_TYPE_FULLY_CONNECTED ) ) { input_width = flow_item -> output_format [ 0 ] . format_1d . size [ 0 ] ; input_height = flow_item -> output_format [ 0 ] . format >= NN_DATA_FORMAT_2D ? flow_item -> output_format [ 0 ] . format_2d . size [ 1 ] : 1 ; input_depth = flow_item -> output_format [ 0 ] . format >= NN_DATA_FORMAT_3D ? flow_item -> output_format [ 0 ] . format_3d . size [ 2 ] : 1 ; num_outputs = ( flow_item -> use [ 0 ] . item -> output_format [ 0 ] . format_1d . size [ 0 ] * ( flow_item -> use [ 0 ] . item -> output_format [ 0 ] . format >= NN_DATA_FORMAT_2D ? flow_item -> use [ 0 ] . item -> output_format [ 0 ] . format_2d . size [ 1 ] : 1 ) * ( flow_item -> use [ 0 ] . item -> output_format [ 0 ] . format >= NN_DATA_FORMAT_3D ? flow_item -> use [ 0 ] . item -> output_format [ 0 ] . format_3d . size [ 2 ] : 1 ) ) ; return use_fully_connected_8x8 ( input_width * input_height * input_depth , num_outputs , batch , device ) ; } return false ; }
Routine checking if corresposing load_item to given flow_item should have output data encapsulated in CL image
Routine checking if corresposing load_item to given flow_item should have output data encapsulated in CL image
// If next Layer is Fully connected and is to use images as input // then make current layer to produce image as output