unisa-hpc / sycl-bench

SYCL Benchmark Suite
BSD 3-Clause "New" or "Revised" License
56 stars 31 forks source link

Fix the run-suite brommy.bmp not found issue #35

Open illuhad opened 4 years ago

illuhad commented 4 years ago

It used to work. But we don't know why. Now it doesn't and we know why. We should transform this to a state where it works and (ideally, but at a lower priority) we know why.

biergaizi commented 1 year ago

The problem here is that the test case uses relative path to find the file, as in

load_bitmap_mirrored("../../share/Brommy.bmp", size, input);

This is entirely unreliable, since the build directory can be anywhere in the file system. It won't run without this very specific assumption of path. I suggest to fix it by always loading the file from the build directory, such as ./Brommy.bmp. Then, during build, we let CMake to copy Brommy.bmp to the specified build path. This way it can always work.

biergaizi commented 1 year ago

Wait a minute, my previous comment would only fix the in-tree file. If make install is used, search path again becomes a problem... I imagine the full solution would be, first, define a preprocessor macro for the path through CMake... And if it's not found, then fallback to searching the executable's directory, so both running from build and running from /usr is supported...