Skip to content
Snippets Groups Projects
Commit 8da60f2a authored by Pekka Jääskeläinen's avatar Pekka Jääskeläinen
Browse files

Fix long kernel names creating too long dir/filenames

If the kernel (mangled) symbol name is longer than the allowed directory
name, there was a crash due to the temporary file / kernel cache
directory structure having the name as one of the directory levels.

Since long names are common with kernels generated from C++ templates,
this issue is likely to occur often when kernels are originating from
C++ APIs such as CUDA/HIP or SYCL. The limit seems to be 255 in most
Linux file systems.

A simple fix was to shorten the directory name and appending a hash when
needed. We still keep as much of the kernel name in the beginning of the
name as feasible to maintain easy location of the temporary bitcodes and
binaries when debugging the kernel compiler.

Fixes #1190.

Also rename POCL_FILENAME_LENGTH to a more descriptive (given how it's
been used so far) POCL_MAX_PATHNAME_LENGTH.
parent 40cacd97
No related branches found
No related tags found
Loading
Showing
with 280 additions and 198 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment