"parse use of undefined value" error when compiling Kokkos OpenACC program using nvc++ version 25.11 or later

nvc++ OpenACC compiler fails to compile a Kokkos OpenACC program where Kokkos SubView is created in a GPU kernel (Kokkos parallel_for() construct).

  1. Kokkos example
    Kokkos::parallel_for(
        "InitializeRows",
        Kokkos::RangePolicy<>(0, num_rows),
        KOKKOS_LAMBDA(const int i) {
          // Create a rank-1 subview for row i.
          auto row =
              Kokkos::subview(matrix, i, Kokkos::ALL());

          // This inner loop executes sequentially within outer iteration i.
          for (int j = 0; j < num_cols; ++j) {
            row(j) = 10 * i + j;
          }   
        }); 
  1. Error message:
nvvmCompileProgram: failed with error 9: NVVM_ERROR_COMPILATION

nvnvvmd: error: /tmp/f6l/nvaccIBYhpMopmYRno.gpu (455, 70): parse use of undefined value '@_T1148_57172'

This error occurs when compiled with recent nvc++ versions (>= 25.11).

No error occurs if Kokkos SubView is created in the host instead of in the device.

  1. Test programs to reproduce the error

test-subview1.tar.gz: Kokkos SubView is created in a device kernel (parallel_for()), which occurs errors.

test-subview1.tar.gz (1.5 KB)

test-subvie2.tar.gz: Kokkos SubView is create in a host; no error occurs.

test-subview2.tar.gz (1.5 KB)

The above test programs can be compiled using the included CMakeLists.txt, which assumes that an environment variable, KOKKOS_ROOT is defined with value of a local Kokkos repository path.

Thanks for the report, Seyong!

I added TPR #38854 and sent it to engineering for investigation. Mark let me know that he’s already been communicating with you on this one but also thanks you for posting it with the reproducing examples.

-Mat