some small changes

This commit is contained in:
Nickiel12 2024-10-11 23:54:36 +00:00
parent 8a9870fe26
commit 7fd740b8fc

View file

@ -24,8 +24,8 @@ pub fn main() void {
var hef : hlo.hailo_hef = undefined; var hef : hlo.hailo_hef = undefined;
var device_params: hlo.hailo_vdevice_params_t = undefined; var device_params: hlo.hailo_vdevice_params_t = undefined;
var network_group: hlo.hailo_configured_network_group = undefined; var network_group: hlo.hailo_configured_network_group = undefined;
const input_vstream_params : [max_edge_layers]hlo.hailo_input_vstream_params_by_name_t = undefined; const input_vstream_params : [max_edge_layers]hlo.hailo_input_vstream_params_by_name_t = undefined;
const output_vstream_params: [max_edge_layers]hlo.hailo_output_vstream_params_by_name_t = undefined; const output_vstream_params : [max_edge_layers]hlo.hailo_output_vstream_params_by_name_t = undefined;
const output_vstreams : [max_edge_layers]hlo.hailo_output_vstream = undefined; const output_vstreams : [max_edge_layers]hlo.hailo_output_vstream = undefined;
const input_vstreams : [max_edge_layers]hlo.hailo_input_vstream = undefined; const input_vstreams : [max_edge_layers]hlo.hailo_input_vstream = undefined;
var input_vstream_size = max_edge_layers; var input_vstream_size = max_edge_layers;
@ -54,6 +54,8 @@ pub fn main() void {
output_vstream_params, &output_vstream_size); output_vstream_params, &output_vstream_size);
assert(status == hlo.HAILO_SUCCESS); assert(status == hlo.HAILO_SUCCESS);
assert(input_vstream_size <= max_edge_layers);
status = hlo.hailo_create_input_vstreams(network_group, input_vstream_params, input_vstream_size, input_vstreams); status = hlo.hailo_create_input_vstreams(network_group, input_vstream_params, input_vstream_size, input_vstreams);
assert(status == hlo.HAILO_SUCCESS); assert(status == hlo.HAILO_SUCCESS);
@ -63,6 +65,13 @@ pub fn main() void {
status = hlo.activate_network_group(network_group, null, &activated_network_group); status = hlo.activate_network_group(network_group, null, &activated_network_group);
assert(status == hlo.HAILO_SUCCESS); assert(status == hlo.HAILO_SUCCESS);
defer hlo.hailo_release_output_vstreams(output_vstreams, output_vstream_size);
defer hlo.hailo_release_input_vstreams(input_vstreams, input_vstream_size);
defer hlo.hailo_release_hef(hef);
defer hlo.hailo_release_vdevice(vdevice);
std.debug.print("output vstream size is: {any}", .{output_vstream_size});
for (0..output_vstream_size) |i| { for (0..output_vstream_size) |i| {
hlo.hailo_get_output_vstream_info(output_vstreams[i], &output_vstreams_info[i]); hlo.hailo_get_output_vstream_info(output_vstreams[i], &output_vstreams_info[i]);
} }