Compare commits
2 commits
14c23be581
...
89370b7ff2
Author | SHA1 | Date | |
---|---|---|---|
|
89370b7ff2 | ||
|
65d224db1a |
3 changed files with 20 additions and 7 deletions
|
@ -47,7 +47,8 @@ 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 = b.fmt("{s}/lib/glib-2.0/include", .{glib_path.?}) });
|
||||||
|
|
||||||
exe.addIncludePath(.{ .cwd_relative = "/usr/include/hailo" });
|
exe.addIncludePath(.{ .cwd_relative = "/usr/include/hailo" });
|
||||||
exe.addLibraryPath(.{ .cwd_relative = "/usr/lib"});
|
// exe.addLibraryPath(.{ .cwd_relative = "/usr/lib"});
|
||||||
|
exe.addLibraryPath(.{ .cwd_relative = "/home/nixolas/Documents/hailort/build/hailort/libhailort/src"});
|
||||||
exe.linkSystemLibrary("hailort");
|
exe.linkSystemLibrary("hailort");
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
|
packages = with pkgs; [
|
||||||
|
valgrind
|
||||||
|
bat
|
||||||
|
];
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
zig_exe
|
zig_exe
|
||||||
glib
|
glib
|
||||||
|
|
20
src/main.zig
20
src/main.zig
|
@ -26,9 +26,9 @@ pub fn main() void {
|
||||||
var status: hlo.hailo_status = undefined;
|
var status: hlo.hailo_status = undefined;
|
||||||
var vdevice : hlo.hailo_vdevice = undefined;
|
var vdevice : hlo.hailo_vdevice = undefined;
|
||||||
var hef : hlo.hailo_hef = undefined;
|
var hef : hlo.hailo_hef = undefined;
|
||||||
var device_params: hlo.hailo_vdevice_params_t = undefined; // std.mem.zeroInit(hlo.hailo_vdevice_params_t, .{});
|
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 = null;
|
var network_group: hlo.hailo_configured_network_group = undefined;
|
||||||
const network_group_size : usize = 1;
|
var network_group_size : usize = 1;
|
||||||
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;
|
||||||
|
@ -36,10 +36,11 @@ pub fn main() void {
|
||||||
var input_vstream_size : usize = max_edge_layers;
|
var input_vstream_size : usize = max_edge_layers;
|
||||||
var output_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(&input_vstream_params, 0);
|
||||||
// @memset(&output_vstream_params, 0);
|
// @memset(&output_vstream_params, 0);
|
||||||
|
|
||||||
|
|
||||||
status = hlo.hailo_create_vdevice(null, &vdevice);
|
status = hlo.hailo_create_vdevice(null, &vdevice);
|
||||||
assert(status == hlo.HAILO_SUCCESS);
|
assert(status == hlo.HAILO_SUCCESS);
|
||||||
|
|
||||||
|
@ -48,12 +49,19 @@ pub fn main() void {
|
||||||
|
|
||||||
std.debug.print("vdevice inited, hef file created!\n", .{});
|
std.debug.print("vdevice inited, hef file created!\n", .{});
|
||||||
|
|
||||||
status = hlo.hailo_init_configure_params(hef, hlo.HAILO_STREAM_INTERFACE_PCIE, @ptrCast(&device_params));
|
status = hlo.hailo_init_configure_params_by_vdevice(hef, vdevice, &config_params);
|
||||||
assert(status == hlo.HAILO_SUCCESS);
|
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", .{});
|
std.debug.print("Init configure params complete\n", .{});
|
||||||
|
|
||||||
status = hlo.hailo_configure_vdevice(vdevice, hef, @ptrCast(&device_params), &network_group, @constCast(&network_group_size));
|
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);
|
||||||
assert(status == hlo.HAILO_SUCCESS);
|
assert(status == hlo.HAILO_SUCCESS);
|
||||||
|
|
||||||
std.debug.print("Configure vdevice complete!\n", .{});
|
std.debug.print("Configure vdevice complete!\n", .{});
|
||||||
|
|
Loading…
Reference in a new issue