Alpaka: Compiler errors and warnings

Created on 11 Sep 2019  路  9Comments  路  Source: alpaka-group/alpaka

CUDA V10.1.105
gcc 7.3.0
alpaka-0.3.5

Compiled with --std=c++14.
I got lot of errors despite your table states, that the gcc/nvcc combination is running.
In alpaka-0.3.5/include/alpaka/core/ConcurrentExecPool.hpp there is the line

auto currentTaskPackage(std::shared_ptr<ITaskPkg>{nullptr});

at various places. Apparently at least one compiler deduces currentTaskPackage as a constexpr.
I could fix it by replacing these lines with:

std::shared_ptr<ITaskPkg> currentTaskPackage{nullptr};

Also I got the following warning quite often:

warning: calling a __host__ function("std::__shared_count<( ::__gnu_cxx::_Lock_policy)2> ::__shared_count") from a __host__ __device__ function("alpaka::dev::DevCpu::DevCpu") is not allowed

~And an~

~internal compiler error: in maybe_undo_parenthesized_ref, at cp/semantics.c:1705~

~Edit. the last one is a duplicate of #765.~

CUDA Bug

Most helpful comment

FYI: I could suppress the warning

warning: calling a __host__ function("std::__shared_count<( ::__gnu_cxx::_Lock_policy)2> ::__shared_count") from a __host__ __device__ function("alpaka::dev::DevCpu::DevCpu") is not allowed

with the command line option -Xcudafe --diag_suppress=2912.

All 9 comments

@krzikalla thanks for your report!
I am slightly confused by the configuration since alpaka 0.3.5 did not claim support for CUDA 10, and gcc 7.3 was not at the table for that release. This is not to say these defects are definitely not present at the current develop.

Edit: now I see at #765 that this configuration was actually working before. Thanks for referencing that issue here!

@krzikalla so far I did not manage to reproduce the issues when building the alpaka examples. Can you please specify which alpaka backends were enabled in your failing build?

ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLED
ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLED
ALPAKA_ACC_GPU_CUDA_ENABLED

are defined.

The offending lines are still there, however slightly changed:

auto currentTaskPackage = std::shared_ptr{nullptr};

currentTaskPackage was deduced as a constexpr before that change.

The following code is a minimal example;

#include <memory>
#include <iostream>

int main(int argc, char *argv[])
{
  auto x (std::shared_ptr<int>{nullptr});
  //auto x = std::shared_ptr<int>{nullptr};
  x.reset(new int(1));

  std::cout << x.get();

  return 0;
}

Compile with nvcc -std=c++14 -x=cu (the -x=cu is important, I dunno, what it does).
Swap the comment and things work. Might be a cuda compiler error.

I changed those lines for the upcoming alpaka-0.4.0 release as well in #780 which added support for CUDA 10.1. The nvcc compiler from CUDA 10.1 seems to behave differently than the one from 10.0.
We will hopefully release alpaka-0.4.0 soon so that we have a stable supported release with this fix.

FYI: I could suppress the warning

warning: calling a __host__ function("std::__shared_count<( ::__gnu_cxx::_Lock_policy)2> ::__shared_count") from a __host__ __device__ function("alpaka::dev::DevCpu::DevCpu") is not allowed

with the command line option -Xcudafe --diag_suppress=2912.

Also I got the following warning quite often:

warning: calling a __host__ function("std::__shared_count<( ::__gnu_cxx::_Lock_policy)2> ::__shared_count") from a __host__ __device__ function("alpaka::dev::DevCpu::DevCpu") is not allowed

The number of this warning can be shown with -Xcudafe --display_error_number

@krzikalla The std::__shared_count<> warnings should be fixed by #884 and the currentTaskPackage issues were already olved on 0.4.0. Therefore all the issues should be fixed. If there is anything left, please open a new issue!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BenjaminW3 picture BenjaminW3  路  6Comments

ax3l picture ax3l  路  5Comments

psychocoderHPC picture psychocoderHPC  路  5Comments

ax3l picture ax3l  路  4Comments

psychocoderHPC picture psychocoderHPC  路  4Comments