error message hunting #1

This commit is contained in:
Nickiel12 2024-10-12 00:09:47 +00:00
parent 170ace6fa3
commit e87d116883

View file

@ -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_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 : usize = max_edge_layers;
var output_vstream_size = max_edge_layers; var output_vstream_size : usize = max_edge_layers;
var activated_network_group: hlo.hailo_activated_network_group = undefined; 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); status = hlo.hailo_create_vdevice(null, &vdevice);
@ -40,26 +39,26 @@ pub fn main() void {
status = hlo.hailo_create_hef_file(&hef, hef_file); status = hlo.hailo_create_hef_file(&hef, hef_file);
assert(status == hlo.HAILO_SUCCESS); 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); 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); assert(status == hlo.HAILO_SUCCESS);
status = hlo.hailo_make_input_vstream_params(network_group, true, hlo.HAILO_FORMAT_TYPE_AUTO, 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); assert(status == hlo.HAILO_SUCCESS);
status = hlo.hailo_make_output_vstream_params(network_group, true, hlo.HAILO_FORMAT_TYPE_AUTO, 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(status == hlo.HAILO_SUCCESS);
assert(input_vstream_size <= max_edge_layers); 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); 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); assert(status == hlo.HAILO_SUCCESS);
status = hlo.activate_network_group(network_group, null, &activated_network_group); 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}); 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); // write_to_hlo(_, alloc);
} }