Open jeremiah-corrado opened 1 week ago
I think this might be an instance of https://github.com/chapel-lang/chapel/issues/26140. If you change this line:
type layoutType = if layout == Layout.CSR then csrLayout else cscLayout;
to this:
type layoutType = if layout == Layout.CSR then csrLayout() else cscLayout();
does it work?
yeah, that works
Summary of Problem
Description:
When attempting to write a procedure that can create block-distributed sparse arrays that have either a CSR or CSC layout selected by a param argument, I'm running into a strange compiler error. The following procedure should be creating a fully concrete array type which is either using csrLayout or cscLayout; however, something is going wrong with runtime type construction, where the compiler thinks that one of the underlying data structures would be generic.
Steps to Reproduce
Source Code:
Error message:
The above code produces the following error message:
However, if the
sparseLayoutType=layoutType
argument inblockDist
's initializer is hard-coded to eithercsrLayout
orcscLayout
, then the code compiles successfully. Additionally, if the whole initializer call is replaced with the following, the code will also compile successfully:This indicates that there is something going wrong when creating a "type alias" for either
csrLayout
orcscLayout
.Configuration Information
printchplenv...
``` CHPL_HOST_PLATFORM: darwin CHPL_HOST_COMPILER: clang * CHPL_HOST_CC: clang CHPL_HOST_CXX: clang++ CHPL_HOST_ARCH: arm64 CHPL_TARGET_PLATFORM: darwin CHPL_TARGET_COMPILER: clang * CHPL_TARGET_CC: clang CHPL_TARGET_CXX: clang++ CHPL_TARGET_LD: /usr/bin/clang++ CHPL_TARGET_ARCH: arm64 CHPL_TARGET_CPU: unknown CHPL_LOCALE_MODEL: flat * CHPL_COMM: gasnet * CHPL_COMM_SUBSTRATE: smp * CHPL_GASNET_SEGMENT: fast CHPL_TASKS: fifo * CHPL_LAUNCHER: smp CHPL_TIMERS: generic CHPL_UNWIND: none CHPL_HOST_MEM: cstdlib * CHPL_MEM: jemalloc * CHPL_TARGET_JEMALLOC: bundled CHPL_ATOMICS: cstdlib CHPL_NETWORK_ATOMICS: none CHPL_GMP: bundled * CHPL_HWLOC: bundled * CHPL_HWLOC_PCI: enable CHPL_RE2: bundled * CHPL_LLVM: system * CHPL_LLVM_SUPPORT: system CHPL_LLVM_CONFIG: /opt/homebrew/opt/llvm@17/bin/llvm-config CHPL_LLVM_VERSION: 17 CHPL_AUX_FILESYS: none CHPL_LIB_PIC: none CHPL_SANITIZE: none CHPL_SANITIZE_EXE: none ```