Coder Social home page Coder Social logo

Comments (9)

jingpu avatar jingpu commented on September 20, 2024

@jeffsetter Could you please take a look at this?

from halide-hls.

jeffsetter avatar jeffsetter commented on September 20, 2024

Yea I can take a look

from halide-hls.

jeffsetter avatar jeffsetter commented on September 20, 2024

I was able to fix it by using the code below. However, it appears that there is a problem now when I attempt to cast a void* that was originally a Image<uint8_t>* to a buffer_t** in pipeline_hls.cpp with the function __pipeline_hls_argv.
However, by doing the conversion to buffer_t* first (as below), it appears to work. Do you have any suggestions on a cleaner way to do this? The code below seems a bit ugly.

buffer_t* in_buf = in;
buffer_t* weight_buf = weight;
uint16_t bias = 0;
buffer_t* out_hls_buf = out_hls;

void** arg_values = new void*[4];
arg_values[0] = (void*) &in_buf;
arg_values[1] = (void*) &weight_buf;
arg_values[2] = (void*) &bias;
arg_values[3] = (void*) &out_hls_buf;
pipeline_hls_argv(arg_values);
delete [] arg_values;

from halide-hls.

jingpu avatar jingpu commented on September 20, 2024

I find how the master branch does the _argv calling. Could you match their implementation?
https://github.com/jingpu/Halide-HLS/blob/HLS/test/generator/argvcall_aottest.cpp#L44

from halide-hls.

jeffsetter avatar jeffsetter commented on September 20, 2024

I still need to cast to buffer_t* first (because my implementation uses buffer_t**), but it's a bit cleaner now.

// cast first to buffer_t*
buffer_t* in_buf = in;
buffer_t* weight_buf = weight;
uint16_t bias = 0;
buffer_t* out_hls_buf = out_hls;

void* arg_values[4] = { &in_buf, &weight_buf, &bias, &out_hls_buf };
pipeline_hls_argv(arg_values);

from halide-hls.

jingpu avatar jingpu commented on September 20, 2024

Can you use buffer_t* instead of buffer_t**?

from halide-hls.

jeffsetter avatar jeffsetter commented on September 20, 2024

I changed Codegen_C to use buffer_t* instead, pushed the change, and now am waiting on travis.

from halide-hls.

jeffsetter avatar jeffsetter commented on September 20, 2024

Travis passed, so I'll close this.

from halide-hls.

jingpu avatar jingpu commented on September 20, 2024

from halide-hls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.