Compare commits

..

No commits in common. "89370b7ff2d52569f9880208c3bef58160b8a522" and "14c23be58128e54e1d741eeba82d01b266f2c4ee" have entirely different histories.

3 changed files with 7 additions and 20 deletions

View file

@ -47,8 +47,7 @@ pub fn build(b: *std.Build) void {
exe.addIncludePath(.{ .cwd_relative = b.fmt("{s}/lib/glib-2.0/include", .{glib_path.?}) });
exe.addIncludePath(.{ .cwd_relative = "/usr/include/hailo" });
// exe.addLibraryPath(.{ .cwd_relative = "/usr/lib"});
exe.addLibraryPath(.{ .cwd_relative = "/home/nixolas/Documents/hailort/build/hailort/libhailort/src"});
exe.addLibraryPath(.{ .cwd_relative = "/usr/lib"});
exe.linkSystemLibrary("hailort");

View file

@ -15,10 +15,6 @@
in
{
devShell = pkgs.mkShell {
packages = with pkgs; [
valgrind
bat
];
buildInputs = with pkgs; [
zig_exe
glib

View file

@ -26,9 +26,9 @@ pub fn main() void {
var status: hlo.hailo_status = undefined;
var vdevice : hlo.hailo_vdevice = undefined;
var hef : hlo.hailo_hef = undefined;
var config_params: hlo.hailo_configure_params_t = undefined; // std.mem.zeroInit(hlo.hailo_vdevice_params_t, .{});
var network_group: hlo.hailo_configured_network_group = undefined;
var network_group_size : usize = 1;
var device_params: hlo.hailo_vdevice_params_t = undefined; // std.mem.zeroInit(hlo.hailo_vdevice_params_t, .{});
var network_group: hlo.hailo_configured_network_group = null;
const network_group_size : usize = 1;
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_vstreams : [max_edge_layers]hlo.hailo_output_vstream = undefined;
@ -36,11 +36,10 @@ pub fn main() void {
var input_vstream_size : usize = max_edge_layers;
var output_vstream_size : usize = max_edge_layers;
// const net_ptr: [*c]usize = &network_group_size;
// @memset(&input_vstream_params, 0);
// @memset(&output_vstream_params, 0);
status = hlo.hailo_create_vdevice(null, &vdevice);
assert(status == hlo.HAILO_SUCCESS);
@ -49,19 +48,12 @@ pub fn main() void {
std.debug.print("vdevice inited, hef file created!\n", .{});
status = hlo.hailo_init_configure_params_by_vdevice(hef, vdevice, &config_params);
status = hlo.hailo_init_configure_params(hef, hlo.HAILO_STREAM_INTERFACE_PCIE, @ptrCast(&device_params));
assert(status == hlo.HAILO_SUCCESS);
std.debug.print("Size of network_group: {any}\n", .{ @sizeOf(hlo.hailo_configured_network_group) });
std.debug.print("Init configure params complete\n", .{});
assert(vdevice != null);
assert(hef != null);
// assert(&config_params != null);
// assert(network_group != null); // configure inits this var
assert(network_group_size != 0);
status = hlo.hailo_configure_vdevice(vdevice, hef, &config_params, &network_group, &network_group_size);
status = hlo.hailo_configure_vdevice(vdevice, hef, @ptrCast(&device_params), &network_group, @constCast(&network_group_size));
assert(status == hlo.HAILO_SUCCESS);
std.debug.print("Configure vdevice complete!\n", .{});