StanfordAHA / Halide-to-Hardware

Other
74 stars 12 forks source link

Does the clockwork / CPU comparison script support 3D buffers? #96

Closed dillonhuff closed 3 years ago

dillonhuff commented 3 years ago

@jeffsetter @thenextged I'm trying to add max-pooling, which needs a 3D input and output (app here: https://github.com/StanfordAHA/Halide-to-Hardware/tree/maxpool_example/apps/hardware_benchmarks/apps/max_pool_2x2 ). When I run make run-cpu I get:

dhuff@kiwi:~/h2h2clockwork/Halide-to-Hardware/apps/hardware_benchmarks/apps/max_pool_2x2$ make run-cpu
./bin/process run cpu input.png 
Error: Input buffer input requires a buffer of exactly 3 dimensions, but the buffer passed in has 2 dimensions
../../hw_support/hardware_targets.mk:249: recipe for target 'run-cpu' failed
make: *** [run-cpu] Aborted (core dumped)

I've tried to modify process.cpp to use a 3D buffer here: https://github.com/StanfordAHA/Halide-to-Hardware/blob/ad089703733956408a22f3506aefea0d448871ae/apps/hardware_benchmarks/apps/max_pool_2x2/process.cpp#L71-L72

What am I doing wrong here?

gednyengs commented 3 years ago

You might need to provide a different input.png image that is actually a Buffer(64, 64, 3) instead of the default input image you're using (which is a (64, 64) gray scale image. I think you can reuse the input image used in the conv_multi app

dillonhuff commented 3 years ago

@thenextged makes sense! Which app is conv_multi? I don't see anything with that name in the hardware_benchmarks/apps directory

gednyengs commented 3 years ago

it's in hardware_benchmarks/tests instead

dillonhuff commented 3 years ago

Ahh I see. Thanks!

gednyengs commented 3 years ago

No worries. Let us know if it runs