UPC++ headers choke hipcc device-mode compilation

Issue #549 resolved
Dan Bonachea created an issue

hipcc compiles the input HIP programs in several passes. The device-mode pass (identified via the __HIP_DEVICE_COMPILE__ define) implements only a subset of C++11 semantics, and in particular as of ROCm/4.5.0 does not implement dynamic initialization, a standard C++ feature that our future library relies upon by default.

As a result, passing upcxx.hpp through hipcc can result in compile-time errors like the following:

/gpfs/alpine/world-shared/csc296/spock/upcxx-hip-native/2022.3.0/amd/PrgEnv-amd-8.2.0-4.5.0/include/upcxx/future/core.hpp:184:46: error: dynamic initialization is not supported for __device__, __constant__, __shared__, and __managed__ variables.
      static constexpr future_header_always2 the_always{};
                                             ^~~~~~~~~~~~
/gpfs/alpine/world-shared/csc296/spock/upcxx-hip-native/2022.3.0/amd/PrgEnv-amd-8.2.0-4.5.0/include/upcxx/future/core.hpp:489:39: error: no return statement in constexpr function
      static constexpr future_header* always() {
                                      ^

This problem interferes with use of the HIP Kokkos device with UPC++.

Comments (2)

  1. Dan Bonachea reporter

    Configuring the 2022.3.0 release of UPC++ using configure CXXFLAGS=-DUPCXXI_ISSUE_485_SLOW_THE_ALWAYS ... is believed to be a functional but sub-optimal workaround for the problem.

    PR 435 proposes a more optimal workaround currently in development

  2. Log in to comment