[Chapel Merge] Fix some issues with the GPU support to enable sim

Branch: refs/heads/main
Revision: 7e6992d
Author: e-kayrakli
Link: Fix some issues with the GPU support to enable simple Arkouda builds by e-kayrakli · Pull Request #20239 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #20239 from e-kayrakli/gpu-zmq2

Fix some issues with the GPU support to enable simple Arkouda builds

This branch makes bunch of small-ish changes in an attempt to get Arkouda to
compile with the GPU locale model. I can separate this into multiple PRs, but I
want to test it some more as a whole. Fixes with this PR:

  • Resolves Clang error compiling included C++ headers with GPU locale model · Issue #19754 · chapel-lang/chapel · GitHub
    • Stops adding extern "C" in the C headers included at the command line.
      This was proposed by @milthorhpe.
    • Fixes an interop test broken by this.
  • To be able to do that makes runtime's generated code interface for complex
    numbers C-based even if we're compiling with C++. (A prior PR that made some
    improvements in that direction is
    Adjust runtime headers to better handle C++ compilation by mppf · Pull Request #16847 · chapel-lang/chapel · GitHub)
  • This enables defining c_string_to_complex* functions to be included in the
    generated executable, because their return types are no longer
    std::complex<> which you can't link with C linkage.
  • Adds a no gpu codegen pragma to thwart gpuization within some internal
    functions. Currently this only applies to:
    • chpl__initCopy_shapeHelp: Has PRIM_ASSIGN that gets normalized after
      gpuization, but not resolved. We probably need this function, and the lack
      might be preventing us from using loop expressions to initialize arrays on
      gpus.
  • Fixes .name implementation of the GPULocale type.
    • Adds a relevant test.
  • Adds support for BitOps module.
    • Adds a relevant test.
  • While there, cleans up gpuTransforms.cpp a bit.

[Reviewed by @stonea]

Test:

  • gpu/native

  • gpu/interop

  • make check + spot checks in types/complex with intel as the host+target compiler

  • make check + spot checks in types/complex with cray as the host+target compiler

    Modified Files:
    A test/gpu/native/bitops.chpl
    A test/gpu/native/bitops.good
    A test/gpu/native/noGPUPragma.chpl
    A test/gpu/native/noGPUPragma.compopts
    A test/gpu/native/noGPUPragma.good
    M compiler/AST/FnSymbol.cpp
    M compiler/dyno/include/chpl/uast/PragmaList.h
    M compiler/llvm/clangUtil.cpp
    M compiler/optimizations/gpuTransforms.cpp
    M modules/internal/ChapelArray.chpl
    M modules/packages/Sort.chpl
    M runtime/include/chpl-bitops.h
    M runtime/include/chplcast.h
    M runtime/include/chpltypes.h
    M test/gpu/interop/stream/streamWrapper.h

    Compare: Comparing 1f551b8d6e5c...7e6992d390ea · chapel-lang/chapel · GitHub