usnistgov / hiperc

High Performance Computing Strategies for Boundary Value Problems
https://pages.nist.gov/hiperc/en/latest/index.html
39 stars 7 forks source link

CUDA code fails to compile #63

Closed amjokisaari closed 7 years ago

amjokisaari commented 7 years ago

[amj][~/projects/phasefield-accelerator-benchmarks/gpu]> make cuda/diffusion make -C cuda make[1]: Entering directory '/home/amj/projects/phasefield-accelerator-benchmarks/gpu/cuda' nvcc -Wno-deprecated-gpu-targets -std=c++11 -gencode arch=compute_35,code=sm_35 --compiler-options="-O2 -Wall -I.. -fopenmp" -dc boundaries.c nvcc -Wno-deprecated-gpu-targets -std=c++11 -gencode arch=compute_35,code=sm_35 --compiler-options="-O2 -Wall -I.. -fopenmp" -dc discretization.cu /usr/include/string.h: In function ‘void __mempcpy_inline(void, const void, size_t)’: /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope return (char ) memcpy (dest, src, n) + n; ^ Makefile:20: recipe for target 'discretization.o' failed make[1]: [discretization.o] Error 1 make[1]: Leaving directory '/home/amj/projects/phasefield-accelerator-benchmarks/gpu/cuda' Makefile:10: recipe for target 'cuda/diffusion' failed make: [cuda/diffusion] Error 2

tkphd commented 7 years ago

Weird! memcpy should definitely exist. Can you try modifying the NVCCFLAGS variable in gpu/cude/Makefile to include -D_FORCE_INLINES, e.g. NVCXXFLAGS = -Wno-deprecated-gpu-targets -std=c++11 -D_FORCE_INLINES -gencode arch=compute_35,code=sm_35 \

amjokisaari commented 7 years ago

yep, that compiled.

tkphd commented 7 years ago

OK... very strange, but it's a fix.