Compare commits
No commits in common. "89370b7ff2d52569f9880208c3bef58160b8a522" and "14c23be58128e54e1d741eeba82d01b266f2c4ee" have entirely different histories.
89370b7ff2
...
14c23be581
3 changed files with 7 additions and 20 deletions
|
@ -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 = 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,10 +15,6 @@
|
||||||
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 config_params: hlo.hailo_configure_params_t = undefined; // std.mem.zeroInit(hlo.hailo_vdevice_params_t, .{});
|
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 = undefined;
|
var network_group: hlo.hailo_configured_network_group = null;
|
||||||
var network_group_size : usize = 1;
|
const 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,11 +36,10 @@ 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);
|
||||||
|
|
||||||
|
@ -49,19 +48,12 @@ 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_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);
|
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", .{});
|
||||||
|
|
||||||
assert(vdevice != null);
|
status = hlo.hailo_configure_vdevice(vdevice, hef, @ptrCast(&device_params), &network_group, @constCast(&network_group_size));
|
||||||
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