Skip to content

runTest.cc does not build in CUDA with c++17 #290

@valassi

Description

@valassi

During a cleanup of Makefiles in #281 I have moved cuda from c++14 to c++17 as was already the case for c++.

It turns out that runTest.cc now no longer builds in CUDA.

../src -I../../../../../tools -I../../../../../tools -I../../../../../test/googletest/googletest/include -I../../../../../test/include -I/usr/local/cuda-11.1/include/ -DUSE_NVTX -arch=compute_70 -use_fast_math -ccbin /cvmfs/sft.cern.ch/lcg/releases/gcc/9.2.0-afc57/x86_64-centos7/bin/g++ -DMGONGPU_FPTYPE_DOUBLE -DMGONGPU_CURAND_ONDEVICE
runTest.cc:138:27: error: expected ‘;’ at end of member declaration
  138 |   unique_ptr_host<fptype> hstRnarray  { hstMakeUnique<fptype>( nRnarray ) }; // AOSOA[npagR][nparf][np4][neppR] (nevt=npagR*neppR)
      |                           ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                  ;
runTest.cc:138:50: error: expected unqualified-id before ‘<’ token
  138 |   unique_ptr_host<fptype> hstRnarray  { hstMakeUnique<fptype>( nRnarray ) }; // AOSOA[npagR][nparf][np4][neppR] (nevt=npagR*neppR)

... (AND SO ON)...

From https://stackoverflow.com/a/54247421 I suspected that the problem is the initialization of the struct data members outside the constructor. I made a small patch and this seems to solve the issue.

I am filing this for the record to keep track and document the issue

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions