New Issue: Internal error in 'foreach' loops over empty domains on GPUs

20635, "DanilaFe", "Internal error in 'foreach' loops over empty domains on GPUs", "2022-09-06T19:00:52Z"

When using the prototype GPU support, a loop over an empty domain in
an on here.gpus[0] block leads to a runtime error. The minimal snippet
to reproduce is as follows:

on here.gpus[0] {
  foreach i in {1..<1, 1..<1} {}
}

The error looks like this:

internal error: gpu-cuda.c:221: Error calling CUDA function: invalid argument (Code: 1)

Currently, this issue affects the gpu/native/nestedForeach test, which tests
iteration over a multi-dimensional, but empty, domain. When this issue
is resolved, that test should be updated to run the (currently commented
out, and failing) multi-dimensional-but-empty iteration.

Compile command:

chpl nested.chpl

Execution command:

./nested

Configuration Information

  • Output of chpl --version:
    chpl version 1.28.0 pre-release (76bbdcc00f)
      built with LLVM version 14.0.0
    
  • Output of $CHPL_HOME/util/printchplenv --anonymize:
    CHPL_TARGET_PLATFORM: cray-cs *
    CHPL_TARGET_COMPILER: llvm
    CHPL_TARGET_ARCH: x86_64
    CHPL_TARGET_CPU: native *
    CHPL_LOCALE_MODEL: gpu *
    CHPL_COMM: none *
    CHPL_TASKS: qthreads
    CHPL_LAUNCHER: slurm-srun
    CHPL_TIMERS: generic
    CHPL_UNWIND: none
    CHPL_MEM: jemalloc
    CHPL_ATOMICS: cstdlib
    CHPL_GMP: bundled
    CHPL_HWLOC: bundled
    CHPL_RE2: bundled
    CHPL_LLVM: bundled
    CHPL_AUX_FILESYS: none