From e87d1168837df3d639d8a27bec3465bfda326808 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Sat, 12 Oct 2024 00:09:47 +0000 Subject: [PATCH] error message hunting #1 --- src/main.zig | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main.zig b/src/main.zig index 2d49c88..afaebeb 100644 --- a/src/main.zig +++ b/src/main.zig @@ -28,10 +28,9 @@ pub fn main() void { 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 input_vstreams : [max_edge_layers]hlo.hailo_input_vstream = undefined; - var input_vstream_size = max_edge_layers; - var output_vstream_size = max_edge_layers; + var input_vstream_size : usize = max_edge_layers; + var output_vstream_size : usize = max_edge_layers; var activated_network_group: hlo.hailo_activated_network_group = undefined; - var output_vstreams_info : [max_edge_layers]hlo.hailo_vstreams_info = undefined; status = hlo.hailo_create_vdevice(null, &vdevice); @@ -40,26 +39,26 @@ pub fn main() void { status = hlo.hailo_create_hef_file(&hef, hef_file); assert(status == hlo.HAILO_SUCCESS); - status = hlo.hailo_init_configure_params(hef, hlo.HAILO_STREAM_INTERFACE_PCIE, &device_params); + status = hlo.hailo_init_configure_params(hef, hlo.HAILO_STREAM_INTERFACE_PCIE, @ptrCast(&device_params)); assert(status == hlo.HAILO_SUCCESS); - status = hlo.hailo_configure_vdevice(vdevice, hef, &device_params, &network_group, 1); + status = hlo.hailo_configure_vdevice(vdevice, hef, @ptrCast(&device_params), &network_group, 1); assert(status == hlo.HAILO_SUCCESS); status = hlo.hailo_make_input_vstream_params(network_group, true, hlo.HAILO_FORMAT_TYPE_AUTO, - input_vstream_params, &input_vstream_size); + @constCast(&input_vstream_params), &input_vstream_size); assert(status == hlo.HAILO_SUCCESS); status = hlo.hailo_make_output_vstream_params(network_group, true, hlo.HAILO_FORMAT_TYPE_AUTO, - output_vstream_params, &output_vstream_size); + @constCast(&output_vstream_params), &output_vstream_size); 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, @constCast(&input_vstream_params), input_vstream_size, input_vstreams); assert(status == hlo.HAILO_SUCCESS); - status = hlo.hailo_create_output_vstreams(network_group, output_vstream_params, output_vstream_size, output_vstreams); + status = hlo.hailo_create_output_vstreams(network_group, @constCast(&output_vstream_params), output_vstream_size, output_vstreams); assert(status == hlo.HAILO_SUCCESS); status = hlo.activate_network_group(network_group, null, &activated_network_group); @@ -72,10 +71,6 @@ pub fn main() void { std.debug.print("output vstream size is: {any}", .{output_vstream_size}); - for (0..output_vstream_size) |i| { - hlo.hailo_get_output_vstream_info(output_vstreams[i], &output_vstreams_info[i]); - } - // write_to_hlo(_, alloc); }