nvc++ OpenACC compiler fails to compile a Kokkos OpenACC program where Kokkos SubView is created in a GPU kernel (Kokkos parallel_for() construct).
- 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;
}
});
- 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.
- 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.