Skip to content
Snippets Groups Projects
  • Pekka Jääskeläinen's avatar
    8da60f2a
    Fix long kernel names creating too long dir/filenames · 8da60f2a
    Pekka Jääskeläinen authored
    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.
    8da60f2a
    History
    Fix long kernel names creating too long dir/filenames
    Pekka Jääskeläinen authored
    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.